diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 11 | ||||
-rw-r--r-- | test/Makefile.am | 33 | ||||
-rw-r--r-- | test/Makefile.in | 38 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/badargs.ok | 1 | ||||
-rw-r--r-- | test/hello.awk | 3 | ||||
-rw-r--r-- | test/incdupe.ok | 3 | ||||
-rw-r--r-- | test/incdupe2.ok | 2 | ||||
-rw-r--r-- | test/incdupe3.ok | 2 | ||||
-rw-r--r-- | test/inclib.awk | 7 | ||||
-rw-r--r-- | test/include.awk | 5 | ||||
-rw-r--r-- | test/include.ok | 2 | ||||
-rw-r--r-- | test/include2.ok | 2 |
13 files changed, 110 insertions, 4 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 95bd42dd..755caeb2 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,14 @@ +2012-05-19 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * Makefile.am (EXTRA_DIST): Add new files hello.awk, inclib.awk, + include.awk, include.ok, include2.ok, incdupe.ok, incdupe2.ok and + incdupe3.ok. + (GAWK_EXT_TESTS): Add include, include2, incdupe, incdupe2 and incdupe3. + (include2, incdupe, incdupe2, incdupe3): New tests. + * badargs.ok: Fix usage message to include new -i option. + * hello.awk, incdupe.ok, incdupe2.ok, incdupe3.ok, inclib.awk, + include.awk, include.ok, include2.ok: New files. + 2012-05-09 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (jarebug): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 726c89ce..e782d1c0 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -347,6 +347,7 @@ EXTRA_DIST = \ gsubtst8.in \ gsubtst8.ok \ gtlnbufv.awk \ + hello.awk \ hex.awk \ hex.ok \ hsprint.awk \ @@ -367,6 +368,13 @@ EXTRA_DIST = \ ignrcase.ok \ ignrcas2.awk \ ignrcas2.ok \ + inclib.awk \ + include.awk \ + include.ok \ + include2.ok \ + incdupe.ok \ + incdupe2.ok \ + incdupe3.ok \ indirectcall.awk \ indirectcall.in \ indirectcall.ok \ @@ -859,7 +867,8 @@ GAWK_EXT_TESTS = \ profile1 profile2 profile3 pty1 \ rebuf regx8bit reint reint2 rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \ - strtonum switch2 + strtonum switch2 \ + include include2 incdupe incdupe2 incdupe3 EXTRA_TESTS = inftest regtest @@ -892,7 +901,7 @@ CHECK_MPFR = \ rand fnarydel fnparydl # List of the files that appear in manual tests or are for reserve testing: -GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk +GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk inclib.awk hello.awk CMP = cmp AWKPROG = ../gawk$(EXEEXT) @@ -1548,6 +1557,26 @@ readfile:: @$(AWK) -l readfile 'BEGIN {printf "%s", readfile("Makefile")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) Makefile _$@ && rm -f _$@ || cp -p Makefile $@.ok +include2:: + @echo $@ + @$(AWK) -i inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +incdupe:: + @echo $@ + @$(AWK) --lint -i inclib -i inclib.awk 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +incdupe2:: + @echo $@ + @$(AWK) --lint -f inclib -f inclib.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +incdupe3:: + @echo $@ + @$(AWK) --lint -f hello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index fb48935d..d6ffc309 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -579,6 +579,7 @@ EXTRA_DIST = \ gsubtst8.in \ gsubtst8.ok \ gtlnbufv.awk \ + hello.awk \ hex.awk \ hex.ok \ hsprint.awk \ @@ -599,6 +600,13 @@ EXTRA_DIST = \ ignrcase.ok \ ignrcas2.awk \ ignrcas2.ok \ + inclib.awk \ + include.awk \ + include.ok \ + include2.ok \ + incdupe.ok \ + incdupe2.ok \ + incdupe3.ok \ indirectcall.awk \ indirectcall.in \ indirectcall.ok \ @@ -1091,7 +1099,8 @@ GAWK_EXT_TESTS = \ profile1 profile2 profile3 pty1 \ rebuf regx8bit reint reint2 rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \ - strtonum switch2 + strtonum switch2 \ + include include2 incdupe incdupe2 incdupe3 EXTRA_TESTS = inftest regtest INET_TESTS = inetdayu inetdayt inetechu inetecht @@ -1123,7 +1132,7 @@ CHECK_MPFR = \ # List of the files that appear in manual tests or are for reserve testing: -GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk +GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk inclib.awk hello.awk CMP = cmp AWKPROG = ../gawk$(EXEEXT) @@ -1955,6 +1964,26 @@ readfile:: @echo $@ @$(AWK) -l readfile 'BEGIN {printf "%s", readfile("Makefile")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) Makefile _$@ && rm -f _$@ || cp -p Makefile $@.ok + +include2:: + @echo $@ + @$(AWK) -i inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +incdupe:: + @echo $@ + @$(AWK) --lint -i inclib -i inclib.awk 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +incdupe2:: + @echo $@ + @$(AWK) --lint -f inclib -f inclib.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +incdupe3:: + @echo $@ + @$(AWK) --lint -f hello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: @@ -3092,6 +3121,11 @@ switch2: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +include: + @echo $@ + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + double1: @echo $@ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index e6a985b0..6856b870 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1135,6 +1135,11 @@ switch2: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +include: + @echo $@ + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + double1: @echo $@ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/badargs.ok b/test/badargs.ok index 35c7d027..1be81ec3 100644 --- a/test/badargs.ok +++ b/test/badargs.ok @@ -15,6 +15,7 @@ Short options: GNU long options: (extensions) -E file --exec=file -g --gen-pot -h --help + -i includefile --include=includefile -l library --load=library -L [fatal] --lint[=fatal] -n --non-decimal-data diff --git a/test/hello.awk b/test/hello.awk new file mode 100644 index 00000000..9e6d569d --- /dev/null +++ b/test/hello.awk @@ -0,0 +1,3 @@ +BEGIN { + print "Hello" +} diff --git a/test/incdupe.ok b/test/incdupe.ok new file mode 100644 index 00000000..63c85e41 --- /dev/null +++ b/test/incdupe.ok @@ -0,0 +1,3 @@ +gawk: warning: already included source file `inclib.awk' +Include library loaded. +abc diff --git a/test/incdupe2.ok b/test/incdupe2.ok new file mode 100644 index 00000000..11787238 --- /dev/null +++ b/test/incdupe2.ok @@ -0,0 +1,2 @@ +gawk: inclib.awk:5: error: function name `sandwich' previously defined +EXIT CODE: 1 diff --git a/test/incdupe3.ok b/test/incdupe3.ok new file mode 100644 index 00000000..af17d2f8 --- /dev/null +++ b/test/incdupe3.ok @@ -0,0 +1,2 @@ +Hello +Hello diff --git a/test/inclib.awk b/test/inclib.awk new file mode 100644 index 00000000..51785283 --- /dev/null +++ b/test/inclib.awk @@ -0,0 +1,7 @@ +BEGIN { + print "Include library loaded." +} + +function sandwich(pfx,x,sfx) { + return (pfx x sfx) +} diff --git a/test/include.awk b/test/include.awk new file mode 100644 index 00000000..8fc7837d --- /dev/null +++ b/test/include.awk @@ -0,0 +1,5 @@ +@include "inclib.awk" + +BEGIN { + print sandwich("a", "b", "c") +} diff --git a/test/include.ok b/test/include.ok new file mode 100644 index 00000000..a720efca --- /dev/null +++ b/test/include.ok @@ -0,0 +1,2 @@ +Include library loaded. +abc diff --git a/test/include2.ok b/test/include2.ok new file mode 100644 index 00000000..a720efca --- /dev/null +++ b/test/include2.ok @@ -0,0 +1,2 @@ +Include library loaded. +abc |