From: jbj Date: Thu, 21 Oct 1999 21:38:18 +0000 (+0000) Subject: Functional "make check". X-Git-Tag: rpm-4.4-release~2529 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5b272105ba8b2a9e38cb70166f503bd974f5ee5;p=platform%2Fupstream%2Frpm.git Functional "make check". CVS patchset: 3395 CVS date: 1999/10/21 21:38:18 --- diff --git a/popt/Makefile.am b/popt/Makefile.am index ec8480d..903109f 100644 --- a/popt/Makefile.am +++ b/popt/Makefile.am @@ -15,6 +15,13 @@ noinst_PROGRAMS = test1 test1_SOURCES = test1.c test1_LDADD = $(lib_LTLIBRARIES) +noinst_SCRIPTS = testit.sh + +TESTS_ENVIRONMENT = \ +test1="`pwd`/.libs/lt-test1" + +TESTS = testit.sh + include_HEADERS = popt.h lib_LTLIBRARIES = libpopt.la libpopt_la_SOURCES = popt.c findme.c poptparse.c poptconfig.c popthelp.c diff --git a/popt/testit.sh b/popt/testit.sh index f81edb2..e54b737 100755 --- a/popt/testit.sh +++ b/popt/testit.sh @@ -1,5 +1,7 @@ #!/bin/sh +${test1:=./test1} + run() { prog=$1; shift name=$1; shift @@ -7,7 +9,7 @@ run() { echo Running test $name. - result=`./$prog $*` + result=`$prog $*` if [ "$answer" != "$result" ]; then echo "Test \"$*\" failed with: $result" exit 2 @@ -16,34 +18,34 @@ run() { make -q testcases -run test1 "test1 - 1" "arg1: 1 arg2: (none)" --arg1 -run test1 "test1 - 2" "arg1: 0 arg2: foo" --arg2 foo -run test1 "test1 - 3" "arg1: 1 arg2: something" --arg1 --arg2 something -run test1 "test1 - 4" "arg1: 0 arg2: another" --simple another -run test1 "test1 - 5" "arg1: 1 arg2: alias" --two -run test1 "test1 - 6" "arg1: 1 arg2: (none) rest: --arg2" --arg1 -- --arg2 -run test1 "test1 - 7" "arg1: 0 arg2: abcd rest: --arg1" --simple abcd -- --arg1 -run test1 "test1 - 8" "arg1: 1 arg2: (none) rest: --arg2" --arg1 --takerest --arg2 -run test1 "test1 - 9" "arg1: 0 arg2: foo" -2 foo -run test1 "test1 - 10" "arg1: 0 arg2: (none) arg3: 50" -3 50 -run test1 "test1 - 11" "arg1: 0 arg2: bar" -T bar -run test1 "test1 - 12" "arg1: 1 arg2: (none)" -O -run test1 "test1 - 13" "arg1: 1 arg2: foo" -OT foo -run test1 "test1 - 14" "arg1: 0 arg2: (none) inc: 1" --inc -run test1 "test1 - 15" "arg1: 0 arg2: foo inc: 1" -i --arg2 foo -POSIX_ME_HARDER=1 run test1 "test1 - 16" "arg1: 1 arg2: (none) rest: foo --arg2 something" --arg1 foo --arg2 something -POSIXLY_CORRECT=1 run test1 "test1 - 17" "arg1: 1 arg2: (none) rest: foo --arg2 something" --arg1 foo --arg2 something -run test1 "test1 - 18" "callback: c sampledata bar arg1: 1 arg2: (none)" --arg1 --cb bar -run test1 "test1 - 19" "./test1 ;" --echo-args -run test1 "test1 - 20" "./test1 ; --arg1" --echo-args --arg1 -run test1 "test1 - 21" "./test1 ; --arg2 something" -T something -e -run test1 "test1 - 22" "./test1 ; --arg2 something -- more args" -T something -a more args -run test1 "test1 - 23" "./test1 ; --echo-args -a" --echo-args -e -a -run test1 "test1 - 24" "arg1: 0 arg2: (none) short: 1" -shortoption -run test1 "test1 - 25" "arg1: 0 arg2: (none) short: 1" --shortoption -run test1 "test1 - 26" "callback: c arg for cb2 foo arg1: 0 arg2: (none)" --cb2 foo -run test1 "test1 - 27" "arg1: 0 arg2: (none) -" - -run test1 "test1 - 28" "arg1: 0 arg2: foo -" - -2 foo +run ${test1} "test1 - 1" "arg1: 1 arg2: (none)" --arg1 +run ${test1} "test1 - 2" "arg1: 0 arg2: foo" --arg2 foo +run ${test1} "test1 - 3" "arg1: 1 arg2: something" --arg1 --arg2 something +run ${test1} "test1 - 4" "arg1: 0 arg2: another" --simple another +run ${test1} "test1 - 5" "arg1: 1 arg2: alias" --two +run ${test1} "test1 - 6" "arg1: 1 arg2: (none) rest: --arg2" --arg1 -- --arg2 +run ${test1} "test1 - 7" "arg1: 0 arg2: abcd rest: --arg1" --simple abcd -- --arg1 +run ${test1} "test1 - 8" "arg1: 1 arg2: (none) rest: --arg2" --arg1 --takerest --arg2 +run ${test1} "test1 - 9" "arg1: 0 arg2: foo" -2 foo +run ${test1} "test1 - 10" "arg1: 0 arg2: (none) arg3: 50" -3 50 +run ${test1} "test1 - 11" "arg1: 0 arg2: bar" -T bar +run ${test1} "test1 - 12" "arg1: 1 arg2: (none)" -O +run ${test1} "test1 - 13" "arg1: 1 arg2: foo" -OT foo +run ${test1} "test1 - 14" "arg1: 0 arg2: (none) inc: 1" --inc +run ${test1} "test1 - 15" "arg1: 0 arg2: foo inc: 1" -i --arg2 foo +POSIX_ME_HARDER=1 run ${test1} "test1 - 16" "arg1: 1 arg2: (none) rest: foo --arg2 something" --arg1 foo --arg2 something +POSIXLY_CORRECT=1 run ${test1} "test1 - 17" "arg1: 1 arg2: (none) rest: foo --arg2 something" --arg1 foo --arg2 something +run ${test1} "test1 - 18" "callback: c sampledata bar arg1: 1 arg2: (none)" --arg1 --cb bar +run ${test1} "test1 - 19" "${test1} ;" --echo-args +run ${test1} "test1 - 20" "${test1} ; --arg1" --echo-args --arg1 +run ${test1} "test1 - 21" "${test1} ; --arg2 something" -T something -e +run ${test1} "test1 - 22" "${test1} ; --arg2 something -- more args" -T something -a more args +run ${test1} "test1 - 23" "${test1} ; --echo-args -a" --echo-args -e -a +run ${test1} "test1 - 24" "arg1: 0 arg2: (none) short: 1" -shortoption +run ${test1} "test1 - 25" "arg1: 0 arg2: (none) short: 1" --shortoption +run ${test1} "test1 - 26" "callback: c arg for cb2 foo arg1: 0 arg2: (none)" --cb2 foo +run ${test1} "test1 - 27" "arg1: 0 arg2: (none) -" - +run ${test1} "test1 - 28" "arg1: 0 arg2: foo -" - -2 foo echo "" echo "Passed."