diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/fts.awk | 31 | ||||
-rw-r--r-- | test/rwarray.awk | 25 |
3 files changed, 49 insertions, 12 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 5b911fa0..29dff6c3 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -4,6 +4,11 @@ seems that plain en_US doesn't exist anymore. Thanks to Richard Palo. +2013-12-29 John E. Malmberg <wb8tyw@qsl.net> + + * fts.awk: Adjust for VMS. + * rwarray.awk: Adjust for VMS. + 2013-12-10 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am: Remove instances of "" that were incorrect. diff --git a/test/fts.awk b/test/fts.awk index a1b49cbd..70af560f 100644 --- a/test/fts.awk +++ b/test/fts.awk @@ -3,8 +3,19 @@ BEGIN { Level = 0 - system("rm -fr d1 d2") - system("mkdir d1 d2 ; touch d1/f1 d1/f2 d2/f1 d2/f2") + os = "" + if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") { + os = "VMS" + system("create/dir/prot=o:rwed [.d1]") + system("create/dir/prot=o:rwed [.d2]") + system("copy fts.awk [.d1]f1") + system("copy fts.awk [.d1]f2") + system("copy fts.awk [.d2]f1") + system("copy fts.awk [.d2]f2") + } else { + system("rm -fr d1 d2") + system("mkdir d1 d2 ; touch d1/f1 d1/f2 d2/f1 d2/f2") + } pathlist[1] = "d1" pathlist[2] = "d2" flags = FTS_PHYSICAL @@ -19,7 +30,14 @@ BEGIN { traverse(data2) close(output) - system("rm -fr d1 d2") + if (os == "VMS") { + system("delete [.d1]*.*;*") + system("delete [.d2]*.*;*") + system("delete d1.dir;*") + system("delete d2.dir;*") + } else { + system("rm -fr d1 d2") + } } function indent( i) @@ -96,6 +114,13 @@ function process(pathname, data_array, for (i in stat_data) data_array[pathname]["."]["stat"][i] = stat_data[i] + os = "" + if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") { + os = "VMS" + # Command in next section not valid on VMS. + return + } + command = ("ls -f " pathname) while ((command | getline direntry) > 0) { if (direntry == "." || direntry == "..") diff --git a/test/rwarray.awk b/test/rwarray.awk index 5d1b7e9d..0cb214ee 100644 --- a/test/rwarray.awk +++ b/test/rwarray.awk @@ -21,13 +21,20 @@ BEGIN { printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]]) > "new.out" close("new.out"); - ret = system("cmp orig.out new.out") - - if (ret == 0) - print "old and new are equal - GOOD" - else - print "old and new are not equal - BAD" - - if (ret == 0 && !("KEEPIT" in ENVIRON)) - system("rm -f orig.bin orig.out new.out") + os = "" + if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") { + os = "VMS" + # return status from system() on VMS can not be used here + } + if (os != "VMS") { + ret = system("cmp orig.out new.out") + + if (ret == 0) + print "old and new are equal - GOOD" + else + print "old and new are not equal - BAD" + + if (ret == 0 && !("KEEPIT" in ENVIRON)) + system("rm -f orig.bin orig.out new.out") + } } |