summaryrefslogtreecommitdiff
path: root/test/run
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2011-02-12 17:31:49 -0500
committerJohn Wiegley <johnw@newartisans.com>2011-02-12 18:11:26 -0500
commit9c62463f84dc398b41b387fbacce31abed7e4839 (patch)
treeba73122f301f477b8a4174bd1c3ff27334709ad0 /test/run
parent512542552b3e3e78f610f3d3f2fd1c8169188324 (diff)
downloadfork-ledger-9c62463f84dc398b41b387fbacce31abed7e4839.tar.gz
fork-ledger-9c62463f84dc398b41b387fbacce31abed7e4839.tar.bz2
fork-ledger-9c62463f84dc398b41b387fbacce31abed7e4839.zip
Changed testing format to aid with debugging
Diffstat (limited to 'test/run')
-rwxr-xr-xtest/run44
1 files changed, 0 insertions, 44 deletions
diff --git a/test/run b/test/run
deleted file mode 100755
index 55eb39f3..00000000
--- a/test/run
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/bash
-
-LEDGER=ledger
-ARGS="--args-only --no-color --columns=80"
-
-output_only=false
-update_test=false
-if [[ "$1" == "-v" ]]; then
- output_only=true
- shift 1
-elif [[ "$1" == "-u" ]]; then
- update_test=true
- shift 1
-fi
-
-COMMAND=$(perl -ne 'print unless /^<<</ .. eof();' $1)
-
-if [[ $output_only == false && $update_test == false ]]; then
- perl -ne 'print unless 1 .. /^>>>/ or /^(===|>>>2)/ .. eof();' $1 > /tmp/expected.$$
-fi
-
-perl -ne 'print unless 1 .. /^<<</ or /^>>>/ .. eof();' $1 \
- | eval "$LEDGER -f - -o /tmp/received.$$ $ARGS $COMMAND"
-
-if [[ $update_test == true ]]; then
- if [[ -f /tmp/received.$$ ]]; then
- perl -ne 'print if 1 .. /^>>>/;' $1 > /tmp/command.$$
- perl -ne 'print if /^(===|>>>2)/ .. eof();' $1 > /tmp/epilog.$$
- cat /tmp/command.$$ /tmp/received.$$ /tmp/epilog.$$ > replace.$$
- mv replace.$$ $1
- /bin/rm -f /tmp/command.$$ /tmp/received.$$ /tmp/epilog.$$
- echo Test updated.
- fi
-
-elif [[ $output_only == false ]]; then
- if [[ -f /tmp/expected.$$ && -f /tmp/received.$$ ]]; then
- diff -w -U3 /tmp/expected.$$ /tmp/received.$$ && echo Test passed.
- fi
-
-elif [[ -f /tmp/received.$$ ]]; then
- cat /tmp/received.$$
-fi
-
-/bin/rm -f /tmp/expected.$$ /tmp/received.$$