From 1dcad08845ba0febbb9832c474358b86c9f9c360 Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Mon, 30 Jul 2018 18:06:25 +0100 Subject: [PATCH] Simplify tests by using common test script. This reduces duplicated checking logic between each test and makes it easier to run and check result of individual tests. --- tests/test10.sh | 10 +--------- tests/test11.sh | 10 +--------- tests/test12.sh | 10 +--------- tests/test13.sh | 10 +--------- tests/test14.sh | 10 +--------- tests/test15.sh | 10 +--------- tests/test16.sh | 10 +--------- tests/test17.sh | 10 +--------- tests/test18.sh | 10 +--------- tests/test19.sh | 10 +--------- tests/test2.sh | 10 +--------- tests/test20.sh | 10 +--------- tests/test21.sh | 10 +--------- tests/test22.sh | 10 +--------- tests/test23.sh | 10 +--------- tests/test24.sh | 10 +--------- tests/test25.sh | 10 +--------- tests/test26.sh | 10 +--------- tests/test27.sh | 10 +--------- tests/test28.sh | 10 +--------- tests/test29.sh | 10 +--------- tests/test3.sh | 10 +--------- tests/test30.sh | 10 +--------- tests/test31.sh | 10 +--------- tests/test32.sh | 10 +--------- tests/test33.sh | 10 +--------- tests/test34.sh | 10 +--------- tests/test35.sh | 10 +--------- tests/test36.sh | 10 +--------- tests/test37.sh | 10 +--------- tests/test38.sh | 10 +--------- tests/test39.sh | 10 +--------- tests/test4.sh | 10 +--------- tests/test40.sh | 10 +--------- tests/test41.sh | 10 +--------- tests/test42.sh | 10 +--------- tests/test43.sh | 10 +--------- tests/test44.sh | 10 +--------- tests/test45.sh | 10 +--------- tests/test46.sh | 10 +--------- tests/test47.sh | 10 +--------- tests/test48.sh | 10 +--------- tests/test49.sh | 10 +--------- tests/test5.sh | 10 +--------- tests/test50.sh | 10 +--------- tests/test51.sh | 10 +--------- tests/test52.sh | 10 +--------- tests/test53.sh | 10 +--------- tests/test54.sh | 10 +--------- tests/test55.sh | 10 +--------- tests/test56.sh | 10 +--------- tests/test57.sh | 10 +--------- tests/test58.sh | 10 +--------- tests/test59.sh | 10 +--------- tests/test6.sh | 10 +--------- tests/test60.sh | 10 +--------- tests/test61.sh | 10 +--------- tests/test62.sh | 10 +--------- tests/test63.sh | 10 +--------- tests/test64.sh | 10 +--------- tests/test65.sh | 13 ++----------- tests/test66.sh | 10 +--------- tests/test67.sh | 10 +--------- tests/test68.sh | 10 +--------- tests/test69.sh | 10 +--------- tests/test7.sh | 10 +--------- tests/test70.sh | 10 +--------- tests/test71.sh | 10 +--------- tests/test72.sh | 10 +--------- tests/test73.sh | 10 +--------- tests/test74.sh | 10 +--------- tests/test75.sh | 10 +--------- tests/test76.sh | 10 +--------- tests/test77.sh | 10 +--------- tests/test78.sh | 10 +--------- tests/test79.sh | 10 +--------- tests/test8.sh | 10 +--------- tests/test9.sh | 10 +--------- 78 files changed, 79 insertions(+), 704 deletions(-) diff --git a/tests/test10.sh b/tests/test10.sh index 8d9f545..d3e9f92 100755 --- a/tests/test10.sh +++ b/tests/test10.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test2 -i 10 -s hello > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test10.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 10 -s hello diff --git a/tests/test11.sh b/tests/test11.sh index 3151d76..7d3faa8 100755 --- a/tests/test11.sh +++ b/tests/test11.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test2 -i 10 -s hello -i 9 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test11.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 10 -s hello -i 9 diff --git a/tests/test12.sh b/tests/test12.sh index 1c23d09..57c36a8 100755 --- a/tests/test12.sh +++ b/tests/test12.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test2 -i 10 -s hello -f nine > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test12.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 10 -s hello -f nine diff --git a/tests/test13.sh b/tests/test13.sh index 8631460..3f8b8f4 100755 --- a/tests/test13.sh +++ b/tests/test13.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test3 --stringTest=bill -i=9 -i=8 -B homer marge bart > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test13.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test3 --stringTest=bill -i=9 -i=8 -B homer marge bart diff --git a/tests/test14.sh b/tests/test14.sh index 4a3c106..6de1bb6 100755 --- a/tests/test14.sh +++ b/tests/test14.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test3 --stringTest=aaa homer marge bart -- one two > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test14.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test3 --stringTest=aaa homer marge bart -- one two diff --git a/tests/test15.sh b/tests/test15.sh index 5c2e09d..4c3fbb6 100755 --- a/tests/test15.sh +++ b/tests/test15.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test3 --stringTest bbb homer marge bart -- -hv two > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test15.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test3 --stringTest bbb homer marge bart -- -hv two diff --git a/tests/test16.sh b/tests/test16.sh index 217e258..6646a17 100755 --- a/tests/test16.sh +++ b/tests/test16.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test3 --stringTest one homer -B -Bh > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test16.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test3 --stringTest one homer -B -Bh diff --git a/tests/test17.sh b/tests/test17.sh index b876dec..45b71c4 100755 --- a/tests/test17.sh +++ b/tests/test17.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test3 --stringTest=one homer -B > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test17.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test3 --stringTest=one homer -B diff --git a/tests/test18.sh b/tests/test18.sh index ebc8646..0e4c930 100755 --- a/tests/test18.sh +++ b/tests/test18.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test4 -Bs --Bs asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test18.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test4 -Bs --Bs asdf diff --git a/tests/test19.sh b/tests/test19.sh index 759d997..d22ce7f 100755 --- a/tests/test19.sh +++ b/tests/test19.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test4 -BA --Bs asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test19.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test4 -BA --Bs asdf diff --git a/tests/test2.sh b/tests/test2.sh index 729970e..d293b6b 100755 --- a/tests/test2.sh +++ b/tests/test2.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test1 -n mike > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test2.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test1 -n mike diff --git a/tests/test20.sh b/tests/test20.sh index ab1af77..c78ed73 100755 --- a/tests/test20.sh +++ b/tests/test20.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test5 -a asdf -c fdas --eee blah -i sss -i fdsf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test20.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test5 -a asdf -c fdas --eee blah -i sss -i fdsf diff --git a/tests/test21.sh b/tests/test21.sh index eca74e9..2924938 100755 --- a/tests/test21.sh +++ b/tests/test21.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test5 -b asdf -c fdas -g asdf -j homer > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test21.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test5 -b asdf -c fdas -g asdf -j homer diff --git a/tests/test22.sh b/tests/test22.sh index bdbcb26..ee01f9c 100755 --- a/tests/test22.sh +++ b/tests/test22.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test5 -a fdsa -b asdf -c fdas > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test22.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test5 -a fdsa -b asdf -c fdas diff --git a/tests/test23.sh b/tests/test23.sh index df67794..67ff31b 100755 --- a/tests/test23.sh +++ b/tests/test23.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test5 -d junk -c fdas > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test23.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test5 -d junk -c fdas diff --git a/tests/test24.sh b/tests/test24.sh index d935ec7..3e196c9 100755 --- a/tests/test24.sh +++ b/tests/test24.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test5 --aaa dilbert -b asdf -c fdas > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test24.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test5 --aaa dilbert -b asdf -c fdas diff --git a/tests/test25.sh b/tests/test25.sh index 10c4b80..f1c930a 100755 --- a/tests/test25.sh +++ b/tests/test25.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test5 --aaa asdf -c fdas --fff blah -i one -i two > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test25.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test5 --aaa asdf -c fdas --fff blah -i one -i two diff --git a/tests/test26.sh b/tests/test26.sh index 9043b83..894d1af 100755 --- a/tests/test26.sh +++ b/tests/test26.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test2 -i 2 -f 4..2 -s asdf asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test26.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 2 -f 4..2 -s asdf asdf diff --git a/tests/test27.sh b/tests/test27.sh index 81908a3..04d5f0d 100755 --- a/tests/test27.sh +++ b/tests/test27.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test2 -i 2 -f 4.0.2 -s asdf asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test27.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 2 -f 4.0.2 -s asdf asdf diff --git a/tests/test28.sh b/tests/test28.sh index bdf1d05..b0315ab 100755 --- a/tests/test28.sh +++ b/tests/test28.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test2 -i 2a -f 4.2 -s asdf asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test28.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 2a -f 4.2 -s asdf asdf diff --git a/tests/test29.sh b/tests/test29.sh index 15982d8..7ba1728 100755 --- a/tests/test29.sh +++ b/tests/test29.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure... no hex here, but see test19.cpp for how to use hex -../examples/test2 -i 0xA -f 4.2 -s asdf asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test29.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 0xA -f 4.2 -s asdf asdf diff --git a/tests/test3.sh b/tests/test3.sh index 26ccacf..041f120 100755 --- a/tests/test3.sh +++ b/tests/test3.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test1 -n mike -r > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test3.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test1 -n mike -r diff --git a/tests/test30.sh b/tests/test30.sh index f7c9709..a2575e6 100755 --- a/tests/test30.sh +++ b/tests/test30.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test2 -i 2.1 -f 4.2 -s asdf asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test30.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 2.1 -f 4.2 -s asdf asdf diff --git a/tests/test31.sh b/tests/test31.sh index 07259ea..2a8e46e 100755 --- a/tests/test31.sh +++ b/tests/test31.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test3 -i=9a -i=1 -s=asdf asdf asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test31.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test3 -i=9a -i=1 -s=asdf asdf asdf diff --git a/tests/test32.sh b/tests/test32.sh index 87c12c2..c6ec68a 100755 --- a/tests/test32.sh +++ b/tests/test32.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test3 -f=9 -f=1.0.0 -s=asdf asdf asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test32.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test3 -f=9 -f=1.0.0 -s=asdf asdf asdf diff --git a/tests/test33.sh b/tests/test33.sh index 210cd09..58adb5f 100755 --- a/tests/test33.sh +++ b/tests/test33.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test5 -a asdf -c fdas --eee blah --ddd -j o --jjj t > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test33.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test5 -a asdf -c fdas --eee blah --ddd -j o --jjj t diff --git a/tests/test34.sh b/tests/test34.sh index a9d4bc1..b115150 100755 --- a/tests/test34.sh +++ b/tests/test34.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test6 -n homer 2 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test34.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test6 -n homer 2 diff --git a/tests/test35.sh b/tests/test35.sh index db6032e..789a193 100755 --- a/tests/test35.sh +++ b/tests/test35.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test6 -n mike 2 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test35.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test6 -n mike 2 diff --git a/tests/test36.sh b/tests/test36.sh index 4ead7ef..485a81c 100755 --- a/tests/test36.sh +++ b/tests/test36.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test6 -n homer 6 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test36.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test6 -n homer 6 diff --git a/tests/test37.sh b/tests/test37.sh index 865fa11..6c3ba7a 100755 --- a/tests/test37.sh +++ b/tests/test37.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test7 -n homer 2 -n marge 1 3 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test37.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test7 -n homer 2 -n marge 1 3 diff --git a/tests/test38.sh b/tests/test38.sh index f453af7..78ec7d3 100755 --- a/tests/test38.sh +++ b/tests/test38.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test7 -n mike 2 1 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test38.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test7 -n mike 2 1 diff --git a/tests/test39.sh b/tests/test39.sh index 8b77d3e..0c84f29 100755 --- a/tests/test39.sh +++ b/tests/test39.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test7 2 -n homer -n bart 6 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test39.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test7 2 -n homer -n bart 6 diff --git a/tests/test4.sh b/tests/test4.sh index afaedc7..68a0c93 100755 --- a/tests/test4.sh +++ b/tests/test4.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test1 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test4.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test1 diff --git a/tests/test40.sh b/tests/test40.sh index 592e001..9f04234 100755 --- a/tests/test40.sh +++ b/tests/test40.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test1 --help > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test40.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test1 --help diff --git a/tests/test41.sh b/tests/test41.sh index 7ebc153..50563b6 100755 --- a/tests/test41.sh +++ b/tests/test41.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test2 --help > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test41.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 --help diff --git a/tests/test42.sh b/tests/test42.sh index 1556498..10751de 100755 --- a/tests/test42.sh +++ b/tests/test42.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test3 --help > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test42.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test3 --help diff --git a/tests/test43.sh b/tests/test43.sh index dba057f..879947f 100755 --- a/tests/test43.sh +++ b/tests/test43.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test4 --help > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test43.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test4 --help diff --git a/tests/test44.sh b/tests/test44.sh index c379124..7c30ae9 100755 --- a/tests/test44.sh +++ b/tests/test44.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test5 --help > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test44.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test5 --help diff --git a/tests/test45.sh b/tests/test45.sh index 69cdbdd..369007c 100755 --- a/tests/test45.sh +++ b/tests/test45.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test6 --help > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test45.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test6 --help diff --git a/tests/test46.sh b/tests/test46.sh index cf033ac..ee33671 100755 --- a/tests/test46.sh +++ b/tests/test46.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test7 --help > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test46.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test7 --help diff --git a/tests/test47.sh b/tests/test47.sh index 4bfdddc..14c4df4 100755 --- a/tests/test47.sh +++ b/tests/test47.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test8 -s=bill -i=9 -i=8 -B homer marge bart > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test47.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test8 -s=bill -i=9 -i=8 -B homer marge bart diff --git a/tests/test48.sh b/tests/test48.sh index 2efa2e2..0482e7b 100755 --- a/tests/test48.sh +++ b/tests/test48.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test8 -s=aaa homer marge bart -- one two > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test48.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test8 -s=aaa homer marge bart -- one two diff --git a/tests/test49.sh b/tests/test49.sh index bc07694..1240d99 100755 --- a/tests/test49.sh +++ b/tests/test49.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test8 -s bbb homer marge bart -- -hv two > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test49.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test8 -s bbb homer marge bart -- -hv two diff --git a/tests/test5.sh b/tests/test5.sh index 7c3618e..f0570e8 100755 --- a/tests/test5.sh +++ b/tests/test5.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test2 -i 10 -s homer marge bart lisa > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test5.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 10 -s homer marge bart lisa diff --git a/tests/test50.sh b/tests/test50.sh index 7c027ad..fa3365b 100755 --- a/tests/test50.sh +++ b/tests/test50.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test8 -s one homer -B -Bh > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test50.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test8 -s one homer -B -Bh diff --git a/tests/test51.sh b/tests/test51.sh index b7921dc..7cb43a6 100755 --- a/tests/test51.sh +++ b/tests/test51.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test8 -s=one homer -B > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test51.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test8 -s=one homer -B diff --git a/tests/test52.sh b/tests/test52.sh index 85a28f7..b26bcff 100755 --- a/tests/test52.sh +++ b/tests/test52.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test8 -i=9a -i=1 -s=asdf asdf asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test52.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test8 -i=9a -i=1 -s=asdf asdf asdf diff --git a/tests/test53.sh b/tests/test53.sh index 0e1ef42..ba26b9e 100755 --- a/tests/test53.sh +++ b/tests/test53.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test8 -f=9 -f=1.0.0 -s=asdf asdf asdf > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test53.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test8 -f=9 -f=1.0.0 -s=asdf asdf asdf diff --git a/tests/test54.sh b/tests/test54.sh index d38ecca..f2f5439 100755 --- a/tests/test54.sh +++ b/tests/test54.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test8 --help > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test54.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test8 --help diff --git a/tests/test55.sh b/tests/test55.sh index c0526d5..87d417b 100755 --- a/tests/test55.sh +++ b/tests/test55.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test3 --stringTest=asdf - asdf zero one > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test55.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test3 --stringTest=asdf - asdf zero one diff --git a/tests/test56.sh b/tests/test56.sh index 8a06a83..2d4f2fa 100755 --- a/tests/test56.sh +++ b/tests/test56.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test2 -i 1 - -s fdsa one two > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test56.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 1 - -s fdsa one two diff --git a/tests/test57.sh b/tests/test57.sh index 5256b8f..47a1d99 100755 --- a/tests/test57.sh +++ b/tests/test57.sh @@ -1,13 +1,5 @@ #!/bin/sh - # failure # This used to fail on the "Too many arguments!" but now fails sooner, # and on a more approriate error. -../examples/test5 --aaa asdf -c fdas --fff blah -i one -i two -j huh > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test57.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test5 --aaa asdf -c fdas --fff blah -i one -i two -j huh diff --git a/tests/test58.sh b/tests/test58.sh index 6294fd5..06fab72 100755 --- a/tests/test58.sh +++ b/tests/test58.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test9 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test58.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test9 diff --git a/tests/test59.sh b/tests/test59.sh index c2a04bd..16dd28f 100755 --- a/tests/test59.sh +++ b/tests/test59.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test9 -VVV -N --noise -r blah > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test59.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test9 -VVV -N --noise -r blah diff --git a/tests/test6.sh b/tests/test6.sh index 9e7f8b7..f6211c3 100755 --- a/tests/test6.sh +++ b/tests/test6.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test2 -i 10 -s hello goodbye -ABC > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test6.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 10 -s hello goodbye -ABC diff --git a/tests/test60.sh b/tests/test60.sh index d73e0d3..364fbbf 100755 --- a/tests/test60.sh +++ b/tests/test60.sh @@ -1,11 +1,3 @@ #!/bin/sh - # failure -../examples/test9 -VVV -N --noise -rr > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test60.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test9 -VVV -N --noise -rr diff --git a/tests/test61.sh b/tests/test61.sh index a402880..1c2b5f7 100755 --- a/tests/test61.sh +++ b/tests/test61.sh @@ -1,12 +1,4 @@ #!/bin/sh - # this tests a bug in handling of - chars in Unlabeled args # success -../examples/test2 -i 10 -s hello "-1 -1" > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test61.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 10 -s hello "-1 -1" diff --git a/tests/test62.sh b/tests/test62.sh index 9b365e3..9f3ecd4 100755 --- a/tests/test62.sh +++ b/tests/test62.sh @@ -1,13 +1,5 @@ #!/bin/sh - # this tests whether all required args are listed as # missing when no arguments are specified # failure -../examples/test2 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test62.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 diff --git a/tests/test63.sh b/tests/test63.sh index 69947d3..3ee284c 100755 --- a/tests/test63.sh +++ b/tests/test63.sh @@ -1,13 +1,5 @@ #!/bin/sh - # this tests whether all required args are listed as # missing when no arguments are specified # failure -../examples/test11 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test63.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test11 diff --git a/tests/test64.sh b/tests/test64.sh index 0090f81..f79a098 100755 --- a/tests/test64.sh +++ b/tests/test64.sh @@ -1,13 +1,5 @@ #!/bin/sh - # this tests whether all required args are listed as # missing when no arguments are specified # failure -../examples/test11 -v "1 2 3" > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test64.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test11 -v "1 2 3" diff --git a/tests/test65.sh b/tests/test65.sh index 1b737c7..4893196 100755 --- a/tests/test65.sh +++ b/tests/test65.sh @@ -1,14 +1,5 @@ #!/bin/sh - # this tests whether all required args are listed as # missing when no arguments are specified -# failure -../examples/test12 -v "1 2 3" -v "4 5 6" -v "7 8 9" -v "-1 0.2 0.4" \ - > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test65.out; then - exit 0 -else - exit 1 -fi - +# failure +./simple-test.sh `basename $0 .sh` test12 -v "1 2 3" -v "4 5 6" -v "7 8 9" -v "-1 0.2 0.4" diff --git a/tests/test66.sh b/tests/test66.sh index 99ca94e..50fcb0e 100755 --- a/tests/test66.sh +++ b/tests/test66.sh @@ -1,13 +1,5 @@ #!/bin/sh - # this tests whether all required args are listed as # missing when no arguments are specified # failure -../examples/test12 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test66.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test12 diff --git a/tests/test67.sh b/tests/test67.sh index 72bf285..abb364e 100755 --- a/tests/test67.sh +++ b/tests/test67.sh @@ -1,13 +1,5 @@ #!/bin/sh - # this tests whether all required args are listed as # missing when no arguments are specified # failure -../examples/test12 -v "a 1 0.3" > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test67.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test12 -v "a 1 0.3" diff --git a/tests/test68.sh b/tests/test68.sh index c8f19d7..4350c51 100755 --- a/tests/test68.sh +++ b/tests/test68.sh @@ -1,15 +1,7 @@ #!/bin/sh - # this tests whether we can parse args from # a vector of strings and that combined switch # handling doesn't get fooled if the delimiter # is in the string # success -../examples/test13 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test68.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test13 diff --git a/tests/test69.sh b/tests/test69.sh index 843b9ce..29a7df6 100755 --- a/tests/test69.sh +++ b/tests/test69.sh @@ -1,12 +1,4 @@ #!/bin/sh - # Checks that parsing exceptions are properly # propagated to the caller. -../examples/test18 --bob > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test69.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test18 --bob diff --git a/tests/test7.sh b/tests/test7.sh index 4f92d8d..4359080 100755 --- a/tests/test7.sh +++ b/tests/test7.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test2 -i 10 -s hello goodbye -hABC > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test7.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 10 -s hello goodbye -hABC diff --git a/tests/test70.sh b/tests/test70.sh index 596d404..1f40bc8 100755 --- a/tests/test70.sh +++ b/tests/test70.sh @@ -1,12 +1,4 @@ #!/bin/sh - # Checks that parsing exceptions are properly # propagated to the caller. -../examples/test18 --help > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test70.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test18 --help diff --git a/tests/test71.sh b/tests/test71.sh index 0e418d5..27ea038 100755 --- a/tests/test71.sh +++ b/tests/test71.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success test hex -../examples/test19 -i 0xA > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test71.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test19 -i 0xA diff --git a/tests/test72.sh b/tests/test72.sh index d62b74a..842e4c7 100755 --- a/tests/test72.sh +++ b/tests/test72.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success test octal -../examples/test19 -i 012 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test72.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test19 -i 012 diff --git a/tests/test73.sh b/tests/test73.sh index 8556ca4..ebc3e5a 100755 --- a/tests/test73.sh +++ b/tests/test73.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success tests whether * in UnlabeledValueArg passes -../examples/test2 -i 1 -s asdf fff*fff > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test73.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 1 -s asdf fff*fff diff --git a/tests/test74.sh b/tests/test74.sh index fff59e9..9024f4d 100755 --- a/tests/test74.sh +++ b/tests/test74.sh @@ -1,12 +1,4 @@ #!/bin/sh - # failure validates that the correct error message # is displayed for XOR'd args -../examples/test20 -a -b > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test74.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test20 -a -b diff --git a/tests/test75.sh b/tests/test75.sh index 99bba2c..8af013a 100755 --- a/tests/test75.sh +++ b/tests/test75.sh @@ -1,12 +1,4 @@ #!/bin/sh - # failure validates that the correct error message # is displayed for XOR'd args -../examples/test20 -b -a > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test75.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test20 -b -a diff --git a/tests/test76.sh b/tests/test76.sh index 3f5f854..9205a5e 100755 --- a/tests/test76.sh +++ b/tests/test76.sh @@ -1,12 +1,4 @@ #!/bin/sh - # failure validates that the correct error message # is displayed for XOR'd args -../examples/test20 -ba > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test76.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test20 -ba diff --git a/tests/test77.sh b/tests/test77.sh index 745d93b..6177344 100755 --- a/tests/test77.sh +++ b/tests/test77.sh @@ -1,12 +1,4 @@ #!/bin/sh - # failure validates that the correct error message # is displayed for XOR'd args -../examples/test20 -ab > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test77.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test20 -ab diff --git a/tests/test78.sh b/tests/test78.sh index b02ff4d..1164b58 100755 --- a/tests/test78.sh +++ b/tests/test78.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test21 ~~reverse /n mike > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test78.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test21 ~~reverse /n mike diff --git a/tests/test79.sh b/tests/test79.sh index 62f5c02..eddc48c 100755 --- a/tests/test79.sh +++ b/tests/test79.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test21 > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test79.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test21 diff --git a/tests/test8.sh b/tests/test8.sh index 798f6a3..ba891c2 100755 --- a/tests/test8.sh +++ b/tests/test8.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test2 --version > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test8.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 --version diff --git a/tests/test9.sh b/tests/test9.sh index e3b1bf4..49a89e6 100755 --- a/tests/test9.sh +++ b/tests/test9.sh @@ -1,11 +1,3 @@ #!/bin/sh - # success -../examples/test2 -i 10 -s hello goodbye -- -hv one two > tmp.out 2>&1 - -if cmp -s tmp.out $srcdir/test9.out; then - exit 0 -else - exit 1 -fi - +./simple-test.sh `basename $0 .sh` test2 -i 10 -s hello goodbye -- -hv one two