From: j8takagi Date: Wed, 24 Mar 2010 15:25:18 +0000 (+0900) Subject: テストがMacやCygwinなどでも成功するように変更 X-Git-Tag: v0.1p15~32^2 X-Git-Url: https://j8takagi.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44a394823a565d947fb8fddbebf420aff180dc7c;p=YACASL2.git テストがMacやCygwinなどでも成功するように変更 --- diff --git a/test/integration/casl2/TEST.mk b/test/integration/casl2/TEST.mk index 13e4f02..ed67014 100644 --- a/test/integration/casl2/TEST.mk +++ b/test/integration/casl2/TEST.mk @@ -14,7 +14,7 @@ clean: @rm -f 1.txt diff.txt report.txt err.txt cleanall: clean @rm -f 0.txt -0.txt 1.txt: $(CASL2) $(ASFILE) +0.txt 1.txt:: $(CASL2) $(ASFILE) @echo $(CMD) >$@; \ $(CMD) >>$@ 2>$(ERRFILE); \ if test -s $(ERRFILE); then cat err.txt >>$@; else rm -f $(ERRFILE); fi diff --git a/test/integration/casl2/TEST_O.mk b/test/integration/casl2/TEST_O.mk index 2d16d49..b448d40 100644 --- a/test/integration/casl2/TEST_O.mk +++ b/test/integration/casl2/TEST_O.mk @@ -25,7 +25,7 @@ cleanall: clean $(OD) >>$@ 2>>$(ERRFILE); \ if test -s $(ERRFILE); then cat err.txt >>$@; else rm -f $(ERRFILE); fi diff.txt: 1.txt - @-diff 0.txt 1.txt >$@ 2>&1 + @-diff -b 0.txt 1.txt >$@ 2>&1 report.txt: diff.txt @echo -n "$(UNITNAME): Test " >$@; \ if test ! -s $^; then echo -n "Success " >>$@; rm -f $^; else echo -n "Failure " >>$@; fi; \ diff --git a/test/integration/casl2/err_126/0.txt b/test/integration/casl2/err_126/0.txt new file mode 100644 index 0000000..667a371 --- /dev/null +++ b/test/integration/casl2/err_126/0.txt @@ -0,0 +1,2 @@ +../../../../casl2 +CASL2 error - 126: no source file diff --git a/test/integration/casl2/err_126/Makefile b/test/integration/casl2/err_126/Makefile new file mode 100644 index 0000000..43e8194 --- /dev/null +++ b/test/integration/casl2/err_126/Makefile @@ -0,0 +1,3 @@ +include ../CMD.mk # YACASL2DIR, CASL2 +CMD = $(CASL2) +include ../TEST.mk diff --git a/test/integration/casl2/opt_opterr/0.txt b/test/integration/casl2/opt_opterr/0.txt index 890f3b0..335b97e 100644 --- a/test/integration/casl2/opt_opterr/0.txt +++ b/test/integration/casl2/opt_opterr/0.txt @@ -1,3 +1 @@ -../../../../casl2 -z ../../../../as/sum_10.casl -../../../../casl2: invalid option -- z -Usage: ../../../../casl2 [-slLaAtTdh] [-oO] [-M ] [-C ] FILE ... +Usage: ../../../../casl2 [-slLaAtTdh] [-oO[]] [-M ] [-C ] FILE1[ FILE2 ...] diff --git a/test/integration/casl2/opt_opterr/Makefile b/test/integration/casl2/opt_opterr/Makefile index 76a17fb..5d0a565 100644 --- a/test/integration/casl2/opt_opterr/Makefile +++ b/test/integration/casl2/opt_opterr/Makefile @@ -4,3 +4,5 @@ include ../opt_s/CMD.mk # ASDIR, ASFILE CASL2FLAG = -z CMD = $(CASL2) $(CASL2FLAG) $(ASFILE) include ../TEST.mk +0.txt 1.txt:: $(CASL2) $(ASFILE) + @if test -s $(ERRFILE); then tail -1 err.txt >$@; else rm -f $(ERRFILE); fi