aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-12-06 22:48:34 +0200
committerArnold D. Robbins <arnold@skeeve.com>2011-12-06 22:48:34 +0200
commit44892d91d048309234aebd820d312d357eb4b2df (patch)
tree2d132d67d5edbe5dc852475330b0bbc9a90bcf71
parent3ba2f61ff006c308a904c8b1a4bc433082ce87c8 (diff)
downloadegawk-44892d91d048309234aebd820d312d357eb4b2df.tar.gz
egawk-44892d91d048309234aebd820d312d357eb4b2df.tar.bz2
egawk-44892d91d048309234aebd820d312d357eb4b2df.zip
Revise pc/Makefile.tst.
-rw-r--r--pc/ChangeLog9
-rw-r--r--pc/Makefile.tst13
-rw-r--r--pc/testoutcmp.awk38
3 files changed, 57 insertions, 3 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 3d8ef415..429a88ed 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,12 @@
+2011-12-06 Scott Deifik <scottd.mail@sbcglobal.net>
+
+ * Makefile.tst: Sync with mainline version.
+ Use testoutcmp.awk script.
+
+2011-12-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testoutcmp.awk: Script to replace cmd for DJGPP.
+
2011-11-01 Scott Deifik <scottd.mail@sbcglobal.net>
* config.sed: Additional update.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index e63b8eb5..db214348 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -90,6 +90,10 @@ CMP = diff
#CMP = diff -c
#CMP = gcmp
+# cmp replacement program for PC where the error messages aren't
+# exactly the same. Should run even on old awk.
+TESTOUTCMP = $(AWK) -f ../testoutcmp.awk
+
# Set your "cp," "mv," and "mkdir" commands here. Note: DOS's copy must take
# forward slashes.
#CP = cp
@@ -115,6 +119,7 @@ PATH_SEPARATOR = ;
# ============================================================================
srcdir = .
+abs_builddir = .
# Get rid of core files when cleaning and generated .ok file
CLEANFILES = core core.* fmtspcl.ok
@@ -512,9 +517,9 @@ gsubtst3::
space::
@echo $@
- @echo Expect space to fail with DJGPP.
@$(AWK) -f ' ' $(srcdir)/space.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+# @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @-$(TESTOUTCMP) $(srcdir)/$@.ok _$@ && rm -f _$@
printf0::
@echo $@
@@ -741,7 +746,8 @@ beginfile1::
beginfile2:
@echo $@
@-( cd $(srcdir) && AWK="$(abs_builddir)/$(AWKPROG)" $(srcdir)/$@.sh $(srcdir)/$@.in ) > _$@ 2>&1
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+# @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @-$(TESTOUTCMP) $(srcdir)/$@.ok _$@ && rm -f _$@
dumpvars::
@echo $@
@@ -1876,6 +1882,7 @@ procinfs:
pty1:
@echo pty1
+ @echo Expect pty1 to fail with DJGPP.
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
diff --git a/pc/testoutcmp.awk b/pc/testoutcmp.awk
new file mode 100644
index 00000000..ff190155
--- /dev/null
+++ b/pc/testoutcmp.awk
@@ -0,0 +1,38 @@
+# cmp replacement program for PC where the error messages aren't
+# exactly the same. should run even on old awk
+
+{
+ if (FNR == NR)
+ file = 0
+ else
+ file = 1
+ gsub(/\r/, "", $0)
+ lines[file, FNR] = $0
+}
+
+END {
+ if (NR/2 != FNR) {
+ printf("testoutcmp: warning: files are not of equal length!\n") > "/dev/stderr"
+ exit 1
+ }
+
+ for (i = 1; i <= FNR; i++) {
+ good = lines[0, i]
+ actual = lines[1, i]
+ if (good == actual)
+ continue
+
+ l = length(good)
+ if (substr(good, l, 1) == ")")
+ l--
+ if (substr(good, 1, l) == substr(actual, 1, l))
+ continue
+ else {
+ printf("%s and %s are not equal\n", ARGV[1],
+ ARGV[2]) > "/dev/stderr"
+ exit 1
+ }
+ }
+
+ exit 0
+}