]> mj.ucw.cz Git - libucw.git/commitdiff
run testing utities in rundir instead of in source tree
authorPavel Charvat <pavel.charvat@netcentrum.cz>
Thu, 21 Jun 2007 13:13:49 +0000 (15:13 +0200)
committerPavel Charvat <pavel.charvat@netcentrum.cz>
Thu, 21 Jun 2007 13:13:49 +0000 (15:13 +0200)
14 files changed:
build/tester
images/color.t
images/hilbert-test.t
lib/bbuf.t
lib/bitops.t
lib/getopt.t
lib/hash-test.t
lib/kmp-test.t
lib/mempool.t
lib/regex.t
lib/shell/config.t
lib/slists.t
lib/stkstring.t
lib/unicode-utf8.t

index a9bdfd60f7de2f2c350942917361814b7e605dd0..73794d9396b818711c0e70854d627ab16b31e848 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 # A simple unit testing script
 # (c) 2004 Martin Mares <mj@ucw.cz>
+# (c) 2007 Pavel Charvat <pchar@ucw.cz>
 
 my @tests = ();
 my $tt;
@@ -36,8 +37,8 @@ foreach $tt (@tests) {
        $prev_run = $run;
        my ($ifi, $ofi);
        if (defined $tt->{'In'}) {
-               $ifi = "run/tmp/test$i.in";
-               open X, ">$ifi" or die "Unable to create $ifi";
+               $ifi = "tmp/test$i.in";
+               open X, ">run/$ifi" or die "Unable to create $ifi";
                print X $tt->{'In'}, "\n";
                close X;
                $run .= " <$ifi";
@@ -45,20 +46,20 @@ foreach $tt (@tests) {
                $run .= " </dev/null";
        }
        if (defined $tt->{'Out'}) {
-               $ofi = "run/tmp/test$i.out";
-               unlink $ofi;
+               $ofi = "tmp/test$i.out";
+               unlink "run/$ofi";
                $run .= " >$ofi";
        } else {
                $run .= " >/dev/null";
        }
-       `$run`;
+       system "cd run && ( $run )";
        if ($?) {
                print "FAILED with exit code $?\n";
                $errors++;
                next;
        }
        if (defined $tt->{'Out'}) {
-               open X, "<$ofi" or die "Unable to read $ofi";
+               open X, "<run/$ofi" or die "Unable to read $ofi";
                my $out;
                {
                        local $/ = undef;
index acae30f4b760d6336f288dcbb7a2f81e17d7488f..510a3205f9d6ceeb0377d1f99d9a0abff6c0485b 100644 (file)
@@ -1,3 +1,3 @@
 # Tests for color conversion module
 
-Run:   obj/images/color-t
+Run:   ../obj/images/color-t
index f8794e3c8a0d645ccabcb3d787d520010619b83c..0247a4d55cdfdb3f11532a454d2baf778c39281a 100644 (file)
@@ -1,3 +1,3 @@
 # Tests for multidimensional Hilbert curves
 
-Run:   obj/images/hilbert-test
+Run:   ../obj/images/hilbert-test
index cfc70b314a25425def5af6b131883fe3d670515d..ebf9ecced4cd2fd1ca5de421b41e01dc7caded98 100644 (file)
@@ -1,4 +1,4 @@
 # Tests for growing buffers
 
-Run:   obj/lib/bbuf-t
+Run:   ../obj/lib/bbuf-t
 Out:   <Hello, World!><Hello,                                              World!>
index abf350ead5cbe95cb9f587115878acdf9b667149..97b2b3585f7efde5fd159925adde03732be0f14c 100644 (file)
@@ -1,6 +1,6 @@
 # Tests for bitops modules
 
-Run:   obj/lib/bit-ffs-t
+Run:   ../obj/lib/bit-ffs-t
 In:    1
        2
        3
@@ -26,7 +26,7 @@ Out:  0
        30
        31
 
-Run:   obj/lib/bit-fls-t
+Run:   ../obj/lib/bit-fls-t
 In:    1
        2
        3
index 6a821cdb7112fcf087351e895f08068f9adfaf39..79e7fe2cd38f9b4fe59ddf0385acb72830e1b40b 100644 (file)
@@ -1,6 +1,6 @@
 # Tests for getopt
 
-Run:   obj/lib/getopt-t -a -b --longc 2819 -d -a 1 2 3
+Run:   ../obj/lib/getopt-t -a -b --longc 2819 -d -a 1 2 3
 Out:   option a
        option b
        option c with value `2819'
@@ -13,7 +13,7 @@ Out:  option a
        option d with value `-a'
        3 nonoption arguments
 
-Run:   obj/lib/getopt-t -a -x
+Run:   ../obj/lib/getopt-t -a -x
 Out:   option a
        unknown option
        reset
index 1f3692cc8da339ff28aa405fe1803eea7a729fb4..ba5a61e50b57dc13b1ab90648ed00aa6c13103a6 100644 (file)
@@ -1,13 +1,13 @@
 # Tests for the hash table modules
 
-Run:   obj/lib/hash-test 1
+Run:   ../obj/lib/hash-test 1
 Out:   OK
 
-Run:   obj/lib/hash-test 2
+Run:   ../obj/lib/hash-test 2
 Out:   OK
 
-Run:   obj/lib/hash-test 3
+Run:   ../obj/lib/hash-test 3
 Out:   OK
 
-Run:   obj/lib/hash-test 4
+Run:   ../obj/lib/hash-test 4
 Out:   OK
index 2a9bce3ff2414e4c2be543afa6b68cba38333c30..bfcc127148c36378dedad6ea5c5af87ce6bb68a0 100644 (file)
@@ -1,3 +1,3 @@
 # Tests for the kmp module
 
-Run:   obj/lib/kmp-test
+Run:   ../obj/lib/kmp-test
index bebe922bc0f893a9979b8a3085746d9b7f00c618..10c396e18aeb3d9d07f4f65ca86166bb19b6e37f 100644 (file)
@@ -1,11 +1,11 @@
 # Tests for mempool modules
 
-Run:   obj/lib/mempool-t
+Run:   ../obj/lib/mempool-t
 
-Run:   obj/lib/mempool-fmt-t
+Run:   ../obj/lib/mempool-fmt-t
 Out:   <Hello, World!><Hello, World!><Appended><Hello,                                              World!>
 
-Run:   obj/lib/mempool-str-t
+Run:   ../obj/lib/mempool-str-t
 Out:   <<12345>>
        bugs.gnats.insects
        bugsgnatsinsects
index 9b47cd99fdbf5ce98ddd9668eeb746b74a651f44..45b92a5d51c18e75cbf229c6bb47419e4b1a5a22 100644 (file)
@@ -1,6 +1,6 @@
 # Tests for the regex module
 
-Run:   obj/lib/regex-t 'a.*b.*c'
+Run:   ../obj/lib/regex-t 'a.*b.*c'
 In:    abc
        ajkhkbbbbbc
        Aabc
@@ -8,7 +8,7 @@ Out:    MATCH
        MATCH
        NO MATCH
 
-Run:   obj/lib/regex-t -i 'a.*b.*c'
+Run:   ../obj/lib/regex-t -i 'a.*b.*c'
 In:    aBc
        ajkhkbBBBBC
        Aabc
@@ -16,7 +16,7 @@ Out:  MATCH
        MATCH
        MATCH
 
-Run:   obj/lib/regex-t -i '(ahoj|nebo)'
+Run:   ../obj/lib/regex-t -i '(ahoj|nebo)'
 In:    Ahoj
        nEBo
        ahoja
@@ -26,19 +26,19 @@ Out:        MATCH
        NO MATCH
        NO MATCH
 
-Run:   obj/lib/regex-t '\(ahoj\)'
+Run:   ../obj/lib/regex-t '\(ahoj\)'
 In:    (ahoj)
        ahoj
 Out:   MATCH
        NO MATCH
 
-Run:   obj/lib/regex-t '(.*b)*'
+Run:   ../obj/lib/regex-t '(.*b)*'
 In:    ababababab
        ababababababababababababababababababababababababababababa
 Out:   MATCH
        NO MATCH
 
-Run:   obj/lib/regex-t '(.*)((aabb)|cc)(b.*)' '\1<\3>\4'
+Run:   ../obj/lib/regex-t '(.*)((aabb)|cc)(b.*)' '\1<\3>\4'
 In:    aaabbb
        aabbccb
        abcabc
@@ -48,13 +48,13 @@ Out:        a<aabb>b
        NO MATCH
        aa<>bb
 
-Run:   obj/lib/regex-t '.*\?(.*&)*([a-z_]*sess[a-z_]*|random|sid|S_ID|rnd|timestamp|referer)=.*'
+Run:   ../obj/lib/regex-t '.*\?(.*&)*([a-z_]*sess[a-z_]*|random|sid|S_ID|rnd|timestamp|referer)=.*'
 In:    /nemecky/ubytovani/hotel.php?sort=&cislo=26&mena=EUR&typ=Hotel&luz1=ANO&luz2=ANO&luz3=&luz4=&luz5=&maxp1=99999&maxp2=99999&maxp3=99999&maxp4=99999&maxp5=99999&apart=&rada=8,9,10,11,19,22,26,27,28,29,3&cislo=26&mena=EUR&typ=Hotel&luz1=ANO&luz2=ANO&luz3=&luz4=&luz5=&maxp1=99999&maxp2=99999&maxp3=99999&maxp4=99999&maxp5=99999&apart=&rada=8,9,10,11,19,22,26,27,28,29,3&cislo=26&mena=EUR&typ=Hotel&luz1=ANO&luz2=ANO&luz3=&luz4=&luz5=&maxp1=99999&maxp2=99999&maxp3=99999&maxp4=99999&maxp5=99999&apart=&rada=8,9,10,11,19,22,26,27,28,29,3
        /test...?f=1&s=3&sid=123&q=3&
 Out:   NO MATCH
        MATCH
 
-Run:   obj/lib/regex-t '.*[0-9a-f]{8,16}.*'
+Run:   ../obj/lib/regex-t '.*[0-9a-f]{8,16}.*'
 In:    abcdabcdabcd
        aaaaaaaaaaaaaaaaaaaaaaaaaaaa
        asddajlkdkajlqwepoiequwiouio
index 97fad73d8a6749e8322a241b3b8fc6a82371251c..a8aeb7276c8924da78681e66077ab18154c128e6 100644 (file)
@@ -1,6 +1,6 @@
 # Tests for configuration parser
 
-Run:   obj/lib/shell/config -C/dev/null -S 'sec1{int1=23; long1=1234567812345678; long2=4321; str1="s1"; str2="s2"}' 'sec1 {#int1; ##long1; -str1; str2; #int2=123; ##long2=1234; #int3=0x10; #int4; $dbl1=001.100; $dbl2}; sec2{str3}'
+Run:   ../obj/lib/shell/config -C/dev/null -S 'sec1{int1=23; long1=1234567812345678; long2=4321; str1="s1"; str2="s2"}' 'sec1 {#int1; ##long1; -str1; str2; #int2=123; ##long2=1234; #int3=0x10; #int4; $dbl1=001.100; $dbl2}; sec2{str3}'
 Out:   CF_sec1_int1='23'
        CF_sec1_long1='1234567812345678'
        CF_sec1_str2='s2'
@@ -12,13 +12,13 @@ Out:        CF_sec1_int1='23'
        CF_sec1_dbl2='0'
        CF_sec2_str3=''
 
-Run:   obj/lib/shell/config -C/dev/null -S 'sec1{list1 1 a1 b1; list1:clear; list1 2 a2 b2 3 a3 b3}' 'sec1 {@list1 {#int1; str1; -str2}}'
+Run:   ../obj/lib/shell/config -C/dev/null -S 'sec1{list1 1 a1 b1; list1:clear; list1 2 a2 b2 3 a3 b3}' 'sec1 {@list1 {#int1; str1; -str2}}'
 Out:   CF_sec1_list1_int1[1]='2'
        CF_sec1_list1_str1[1]='a2'
        CF_sec1_list1_int1[2]='3'
        CF_sec1_list1_str1[2]='a3'
 
-Run:   obj/lib/shell/config -C/dev/null -S 'sec1{ar1 a b c d; ar1 a b c; ar2 1 2; ar3 1.1}' 'sec1 {ar1[]; #ar2[2]; $ar3[-2]}'
+Run:   ../obj/lib/shell/config -C/dev/null -S 'sec1{ar1 a b c d; ar1 a b c; ar2 1 2; ar3 1.1}' 'sec1 {ar1[]; #ar2[2]; $ar3[-2]}'
 Out:   CF_sec1_ar1[1]='a'
        CF_sec1_ar1[2]='b'
        CF_sec1_ar1[3]='c'
@@ -26,7 +26,7 @@ Out:  CF_sec1_ar1[1]='a'
        CF_sec1_ar2[2]='2'
        CF_sec1_ar3[1]='1.1'
 
-Run:   obj/lib/shell/config -C/dev/null -S 'sec1{list1 {str1=1; list2=a b c}; list1 {str1=2; list2=d e}}' 'sec1 {@list1 {str1; @list2{str2}}}'
+Run:   ../obj/lib/shell/config -C/dev/null -S 'sec1{list1 {str1=1; list2=a b c}; list1 {str1=2; list2=d e}}' 'sec1 {@list1 {str1; @list2{str2}}}'
 Out:   CF_sec1_list1_str1[1]='1'
        CF_sec1_list1_list2_str2[1]='a'
        CF_sec1_list1_list2_str2[2]='b'
@@ -35,5 +35,5 @@ Out:  CF_sec1_list1_str1[1]='1'
        CF_sec1_list1_list2_str2[4]='d'
        CF_sec1_list1_list2_str2[5]='e'
 
-Run:   obj/lib/shell/config -C/dev/null 'sec{str=a'\''b"c'\''d"\\e'\''f"g}'
+Run:   ../obj/lib/shell/config -C/dev/null 'sec{str=a'\''b"c'\''d"\\e'\''f"g}'
 Out:   CF_sec_str='ab"cd\e'\''fg'
index f18dc7ad065065573a93b29ee9ea2cbcae01fc90..fe642b1c57a8e42d1b0d4fffe0efbcef83efd8c9 100644 (file)
@@ -1,4 +1,4 @@
 # Test for slists module
 
-Run:   obj/lib/slists-t
+Run:   ../obj/lib/slists-t
 Out:   9/7/3/1/2/4/8/10/
index 2b0c191c7367b14a038532d21cd4f195dd1af6c8..7c7f90cd007e1abb597a1b172a9f3527965d1870 100644 (file)
@@ -1,6 +1,6 @@
 # Tests for stkstring modules
 
-Run:   obj/lib/stkstring-t
+Run:   ../obj/lib/stkstring-t
 Out:   Beware the Jabberwock, my son!
        42 65 77
        The jaws that bite
index f41fb5a1308888e3cce1751cd4b95ac9bdd7ee3e..187afefd24b31bd4a7802b0496eb14557294de05 100644 (file)
@@ -1,33 +1,33 @@
 # Tests for the Unicode UTF-8 module
 
-Run:   obj/lib/unicode-utf8-t put
+Run:   ../obj/lib/unicode-utf8-t put
 In:    0041 0048 004f 004a
 Out:   41 48 4f 4a
 
-Run:   obj/lib/unicode-utf8-t put
+Run:   ../obj/lib/unicode-utf8-t put
 In:    00aa 01aa 02a5 05a5 0a5a 15a5 2a5a 5a5a a5a5
 Out:   c2 aa c6 aa ca a5 d6 a5 e0 a9 9a e1 96 a5 e2 a9 9a e5 a9 9a ea 96 a5
 
-Run:   obj/lib/unicode-utf8-t get
+Run:   ../obj/lib/unicode-utf8-t get
 In:    41 48 4f 4a
 Out:   0041 0048 004f 004a
 
-Run:   obj/lib/unicode-utf8-t get
+Run:   ../obj/lib/unicode-utf8-t get
 In:    c2 aa c6 aa ca a5 d6 a5 e0 a9 9a e1 96 a5 e2 a9 9a e5 a9 9a ea 96 a5
 Out:   00aa 01aa 02a5 05a5 0a5a 15a5 2a5a 5a5a a5a5
 
-Run:   obj/lib/unicode-utf8-t get
+Run:   ../obj/lib/unicode-utf8-t get
 In:    84 ff f9 f8 c2 aa 41
 Out:   fffc fffc fffc fffc 00aa 0041
 
-Run:   obj/lib/unicode-utf8-t put32
+Run:   ../obj/lib/unicode-utf8-t put32
 In:    15a5a 2a5a5 5a5a5 a5a5a 15a5a5 2a5a5a 5a5a5a a5a5a5 15a5a5a 2a5a5a5 5a5a5a5 a5a5a5a 15a5a5a5 2a5a5a5a 5a5a5a5a
 Out:   f0 95 a9 9a f0 aa 96 a5 f1 9a 96 a5 f2 a5 a9 9a f5 9a 96 a5 f8 8a a5 a9 9a f8 96 a5 a9 9a f8 a9 9a 96 a5 f9 96 a5 a9 9a fa a9 9a 96 a5 fc 85 a9 9a 96 a5 fc 8a 96 a5 a9 9a fc 95 a9 9a 96 a5 fc aa 96 a5 a9 9a fd 9a 96 a5 a9 9a
 
-Run:   obj/lib/unicode-utf8-t get32
+Run:   ../obj/lib/unicode-utf8-t get32
 In:    f0 95 a9 9a f0 aa 96 a5 f1 9a 96 a5 f2 a5 a9 9a f5 9a 96 a5 f8 8a a5 a9 9a f8 96 a5 a9 9a f8 a9 9a 96 a5 f9 96 a5 a9 9a fa a9 9a 96 a5 fc 85 a9 9a 96 a5 fc 8a 96 a5 a9 9a fc 95 a9 9a 96 a5 fc aa 96 a5 a9 9a fd 9a 96 a5 a9 9a
 Out:   15a5a 2a5a5 5a5a5 a5a5a 15a5a5 2a5a5a 5a5a5a a5a5a5 15a5a5a 2a5a5a5 5a5a5a5 a5a5a5a 15a5a5a5 2a5a5a5a 5a5a5a5a
 
-Run:   obj/lib/unicode-utf8-t get32
+Run:   ../obj/lib/unicode-utf8-t get32
 In:    fe 83 81
 Out:   fffc fffc fffc