diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2011-02-14 21:38:32 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2011-02-14 21:38:32 +0200 |
commit | b9d87ba0b9ea6bbd939fd9a906d5721202d8f78d (patch) | |
tree | ee309aaf9755917bcb8d882194002f2865b59f5c | |
parent | 105ed6e1ef928ba0bc55a0eba59f4a5ecc4eb876 (diff) | |
download | egawk-b9d87ba0b9ea6bbd939fd9a906d5721202d8f78d.tar.gz egawk-b9d87ba0b9ea6bbd939fd9a906d5721202d8f78d.tar.bz2 egawk-b9d87ba0b9ea6bbd939fd9a906d5721202d8f78d.zip |
VMS fixes, including ripple effect into pc and test directories.
-rw-r--r-- | pc/ChangeLog | 4 | ||||
-rw-r--r-- | pc/Makefile.tst | 10 | ||||
-rw-r--r-- | test/ChangeLog | 10 | ||||
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/Makefile.in | 4 | ||||
-rw-r--r-- | test/profile2.ok | 4 | ||||
-rw-r--r-- | test/xref.awk | 3 | ||||
-rw-r--r-- | vms/ChangeLog | 10 | ||||
-rw-r--r-- | vms/descrip.mms | 8 | ||||
-rw-r--r-- | vms/gawkmisc.vms | 23 | ||||
-rw-r--r-- | vms/vmsbuild.com | 10 | ||||
-rw-r--r-- | vms/vmstest.com | 81 |
12 files changed, 144 insertions, 27 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog index 9143dee5..44ba33f2 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,7 @@ +Mon Feb 14 21:30:48 2011 Arnold Robbins <arnold@skeeve.com> + + * Makefile.tst: Sync with mainline version. + Sun Feb 13 20:23:07 2011 Eli Zaretskii <eliz@gnu.org> * gawkmisc.pc (files_are_same): Change arguments. Compare file diff --git a/pc/Makefile.tst b/pc/Makefile.tst index 5df5fd67..500dd670 100644 --- a/pc/Makefile.tst +++ b/pc/Makefile.tst @@ -156,7 +156,7 @@ GAWK_EXT_TESTS = \ gnuops2 gnuops3 gnureops \ icasefs icasers igncdym igncfs ignrcas2 ignrcase indirectcall lint \ lintold manyfiles match1 match2 match3 mbstr1 nondec nondec2 patsplit \ - posix profile1 profile2 printfbad1 printfbad2 \ + posix profile1 profile2 profile3 printfbad1 printfbad2 \ procinfs rebuf regx8bit reint reint2 rsstart1 rsstart2 rsstart3 \ rstest6 shadow sortfor splitarg4 strftime strtonum switch2 @@ -722,7 +722,13 @@ profile1: profile2: @echo $@ - @$(PGAWK) -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null + @$(PGAWK) -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null + @sed 1,2d < awkprof.out > _$@; rm awkprof.out + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +profile3: + @echo $@ + @$(PGAWK) -f $(srcdir)/$@.awk > /dev/null @sed 1,2d < awkprof.out > _$@; rm awkprof.out @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ Gt-dummy: diff --git a/test/ChangeLog b/test/ChangeLog index b0593353..6ef33984 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,13 @@ +Mon Feb 14 21:31:10 2011 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (profile2): Add -v sortcmd=sort to pgawk invocation. + (profile1): Remove awkprof.out. Thanks to Pat Rankin for noticing. + +Sun Feb 13 20:27:35 2011 Pat Rankin <rankin@pactechdata.com> + + * xref.awk: Allow sortcmd to be preset via -v option. + * profile2.ok: Sync with updated xref.awk. + Sun Feb 13 19:55:15 2011 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (profile3): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 65082f7f..92372197 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1315,12 +1315,12 @@ dumpvars:: profile1: @echo $@ @$(AWK) --profile -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1 - @$(AWK) -f awkprof.out $(srcdir)/dtdgport.awk > _$@.out2 + @$(AWK) -f awkprof.out $(srcdir)/dtdgport.awk > _$@.out2 ; rm awkprof.out @cmp _$@.out1 _$@.out2 && rm _$@.out[12] || echo EXIT CODE: $$? >>_$@ profile2: @echo $@ - @$(PGAWK) -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null + @$(PGAWK) -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null @sed 1,2d < awkprof.out > _$@; rm awkprof.out @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ diff --git a/test/Makefile.in b/test/Makefile.in index f5ec9b1a..37c50e0e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1663,12 +1663,12 @@ dumpvars:: profile1: @echo $@ @$(AWK) --profile -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1 - @$(AWK) -f awkprof.out $(srcdir)/dtdgport.awk > _$@.out2 + @$(AWK) -f awkprof.out $(srcdir)/dtdgport.awk > _$@.out2 ; rm awkprof.out @cmp _$@.out1 _$@.out2 && rm _$@.out[12] || echo EXIT CODE: $$? >>_$@ profile2: @echo $@ - @$(PGAWK) -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null + @$(PGAWK) -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null @sed 1,2d < awkprof.out > _$@; rm awkprof.out @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ diff --git a/test/profile2.ok b/test/profile2.ok index 793ee32f..fe76a2c9 100644 --- a/test/profile2.ok +++ b/test/profile2.ok @@ -1,6 +1,9 @@ # BEGIN block(s) BEGIN { + 1 if (sortcmd == "") { + sortcmd = "sort" + } 1 asplit("BEGIN:END:atan2:break:close:continue:cos:delete:" "do:else:exit:exp:for:getline:gsub:if:in:index:int:" "length:log:match:next:print:printf:rand:return:sin:" "split:sprintf:sqrt:srand:sub:substr:system:while", keywords, ":") 1 split("00:00:00:00:00:00:00:00:00:00:" "20:10:10:12:12:11:07:00:00:00:" "08:08:08:08:08:33:08:00:00:00:" "08:44:08:36:08:08:08:00:00:00:" "08:44:45:42:42:41:08", machine, ":") 1 state = 1 @@ -68,7 +71,6 @@ } 570 state = nextstate } - 1 sortcmd = "sort" 47 for (i = 1; i <= nnames; i++) { 47 printf("%d ", xnames[names[i]]) | sortcmd 47 if (index(names[i], "(") == 0) { # 3 diff --git a/test/xref.awk b/test/xref.awk index 94d587f8..d23a0c8d 100644 --- a/test/xref.awk +++ b/test/xref.awk @@ -4,6 +4,7 @@ # for the sort command and to use `sort -k1' instead of `sort +1' BEGIN { + if (sortcmd == "") sortcmd = "sort" # "sort -k1" # create array of keywords to be ignored by lexer asplit("BEGIN:END:atan2:break:close:continue:cos:delete:" \ @@ -76,8 +77,6 @@ state = nextstate } # finished parsing, now ready to print output - #sortcmd = "sort -k1" - sortcmd = "sort" for ( i = 1; i <= nnames; i++ ) { printf "%d ", xnames[names[i]] | sortcmd if ( index(names[i],"(") == 0 ) diff --git a/vms/ChangeLog b/vms/ChangeLog index 1347bc37..56b97b21 100644 --- a/vms/ChangeLog +++ b/vms/ChangeLog @@ -1,3 +1,13 @@ +Sun Feb 13 18:48:29 2011 Pat Rankin <rankin@pactechdata.com> + + * gawkmisc.vms (files_are_same): Update to handle new arguments. + + * vmstest.com (profile1, profile2, profile3): New tests. + (pgawk_tests, profile_tests): New test sets. + (iobug1): Clean up spurious extra output file. Sigh. + + * descrip.mms, vmsbuild.com: Include hard-locale.c in build. + Sun Feb 13 20:23:57 2011 Eli Zaretskii <eliz@gnu.org> * gawkmisc.vms (files_are_same): Change arguments; call `stat' as diff --git a/vms/descrip.mms b/vms/descrip.mms index 0357dd2b..6496a416 100644 --- a/vms/descrip.mms +++ b/vms/descrip.mms @@ -103,7 +103,8 @@ GAWKOBJ = eval.obj,profile.obj PGAWKOBJ = eval_p.obj,profile_p.obj DGAWKOBJ = eval_d.obj,profile.obj,command.obj,debug.obj AWKOBJ1 = array.obj,awkgram.obj,builtin.obj,dfa.obj,ext.obj,\ - field.obj,floatcomp.obj,gawkmisc.obj,getopt.obj,getopt1.obj,io.obj + field.obj,floatcomp.obj,gawkmisc.obj,getopt.obj,getopt1.obj,\ + hard-locale.obj,io.obj AWKOBJ2 = main.obj,msg.obj,node.obj,random.obj,re.obj,\ regex.obj,replace.obj,version.obj AWKOBJS = $(AWKOBJ1),$(AWKOBJ2) @@ -117,7 +118,7 @@ VMSOBJS = $(VMSCODE),$(VMSCMD) # primary source files AWKSRC = array.c,builtin.c,dfa.c,eval.c,eval_p.c,ext.c,field.c,\ - floatcomp.c,gawkmisc.c,getopt.c,getopt1.c,io.c,main.c,\ + floatcomp.c,gawkmisc.c,getopt.c,getopt1.c,hard-locale.c,io.c,main.c,\ msg.c,node.c,profile.c,profile_p.c,random.c,re.c,regcomp.c,\ regex.c,regex_internal.c,regexec.c,replace.c,version.c @@ -222,7 +223,8 @@ $(DGAWKOBJ) : awk.h config.h $(VMSDIR)redirect.h random.obj : random.h builtin.obj : floatmagic.h random.h awkgram.obj : awkgram.c awk.h -dfa.obj : dfa.c dfa.h +dfa.obj : dfa.c dfa.h hard-locale.h +hard-locale.obj : hard-locale.c hard-locale.h regex.obj : regex.c regcomp.c regex_internal.c regexec.c regex.h regex_internal.h command.obj,debug.obj : cmd.h diff --git a/vms/gawkmisc.vms b/vms/gawkmisc.vms index 316e613d..afff3b8c 100644 --- a/vms/gawkmisc.vms +++ b/vms/gawkmisc.vms @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-1996, 2003 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-1996, 2003, 2011 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. @@ -173,13 +173,18 @@ int fd; /* files_are_same --- deal with VMS struct stat */ int -files_are_same(struct stat *f1, struct stat *f2) +files_are_same(char *newfile, SRCFILE *oldfile) { - struct stat st; - - return (stat(path, & st) == 0 - && strcmp(f1->st_dev, f2->st_dev) == 0 - && f1->st_ino[0] == f2->st_ino[0] - && f1->st_ino[1] == f2->st_ino[1] - && f1->st_ino[2] == f2->st_ino[2]); + struct stat st, *f1, *f2; + + f1 = &st; + if (stat(newfile, f1) != 0) return 0; + + f2 = &oldfile->sbuf; + /* compare device string */ + return (strcmp(f1->st_dev, f2->st_dev) == 0 + /* and 48-bit file id cookie stored in 3 short ints */ + && f1->st_ino[0] == f2->st_ino[0] + && f1->st_ino[1] == f2->st_ino[1] + && f1->st_ino[2] == f2->st_ino[2]); } diff --git a/vms/vmsbuild.com b/vms/vmsbuild.com index a6674371..3e378e49 100644 --- a/vms/vmsbuild.com +++ b/vms/vmsbuild.com @@ -79,6 +79,7 @@ $ cc floatcomp.c $ cc gawkmisc.c $ cc getopt.c $ cc getopt1.c +$ cc hard-locale.c $ cc io.c $ cc main.c $ cc msg.c @@ -108,7 +109,8 @@ $ close/noLog Fopt $ create gawk.opt ! GAWK -- GNU awk array.obj,awkgram.obj,builtin.obj,dfa.obj,ext.obj,field.obj,floatcomp.obj -gawkmisc.obj,getopt.obj,getopt1.obj,io.obj,main.obj,msg.obj,node.obj +gawkmisc.obj,getopt.obj,getopt1.obj,hard-locale.obj,io.obj +main.obj,msg.obj,node.obj random.obj,re.obj,regex.obj,replace.obj,version.obj,eval.obj,profile.obj []vms_misc.obj,vms_popen.obj,vms_fwrite.obj,vms_args.obj []vms_gawk.obj,vms_cli.obj,gawk_cmd.obj @@ -123,7 +125,8 @@ $! $ create pgawk.opt ! PGAWK -- GNU awk w/ run-time profiling array.obj,awkgram.obj,builtin.obj,dfa.obj,ext.obj,field.obj,floatcomp.obj -gawkmisc.obj,getopt.obj,getopt1.obj,io.obj,main.obj,msg.obj,node.obj +gawkmisc.obj,getopt.obj,getopt1.obj,hard-locale.obj,io.obj +main.obj,msg.obj,node.obj random.obj,re.obj,regex.obj,replace.obj,version.obj,eval_p.obj,profile_p.obj []vms_misc.obj,vms_popen.obj,vms_fwrite.obj,vms_args.obj []vms_gawk.obj,vms_cli.obj,gawk_cmd.obj @@ -138,7 +141,8 @@ $! $ create dgawk.opt ! DGAWK -- GNU awk w/ debugging array.obj,awkgram.obj,builtin.obj,dfa.obj,ext.obj,field.obj,floatcomp.obj -gawkmisc.obj,getopt.obj,getopt1.obj,io.obj,main.obj,msg.obj,node.obj +gawkmisc.obj,getopt.obj,getopt1.obj,hard-locale.obj,io.obj +main.obj,msg.obj,node.obj random.obj,re.obj,regex.obj,replace.obj,version.obj eval_d.obj,profile.obj,command.obj,debug.obj []vms_misc.obj,vms_popen.obj,vms_fwrite.obj,vms_args.obj diff --git a/vms/vmstest.com b/vms/vmstest.com index cafbf458..ee2242b1 100644 --- a/vms/vmstest.com +++ b/vms/vmstest.com @@ -11,13 +11,16 @@ $! $ echo = "write sys$output" $ cmp = "diff/Output=_NL:/Maximum=1" $ igncascmp = "''cmp'/Ignore=Case" +$ sumslp = "edit/Sum" $ rm = "delete/noConfirm/noLog" $ mv = "rename/New_Vers" $ gawk = "$sys$disk:[-]gawk" +$ pgawk = "$sys$disk:[-]pgawk" $ AWKPATH_srcdir = "define/User AWKPATH sys$disk:[]" $ $ listdepth = 0 $ pipeok = 0 +$ pgawkok = -1 $ floatmode = -1 ! 0: D_float, 1: G_float, 2: IEEE T_float $ $ list = p1+" "+p2+" "+p3+" "+p4+" "+p5+" "+p6+" "+p7+" "+p8 @@ -30,7 +33,8 @@ $ $all: $bigtest: echo "bigtest..." $ ! omits "printlang" and "extra" -$ list = "basic unix_tests gawk_ext vms_tests charset_tests machine_tests" +$ list = "basic unix_tests gawk_ext vms_tests charset_tests" - + + " machine_tests pgawk_tests" $ gosub list_of_tests $ return $ @@ -95,8 +99,8 @@ $ list = "aadelete1 aadelete2 aarray1 aasort" - + " icasers igncdym igncfs ignrcase ignrcas2" $ gosub list_of_tests $ list = "indirectcall lint lintold match1" - - + " match2 match3 manyfiles mbprintf3 mbstr1" - - + " nondec nondec2 patsplit posix procinfs printfbad1" - + + " match2 match3 manyfiles mbprintf3 mbstr1 nondec" - + + " nondec2 patsplit posix profile1 procinfs printfbad1" - + " printfbad2 regx8bit rebuf reint reint2 rsstart1" - + " rsstart2 rsstart3 rstest6 shadow sortfor" - + " splitarg4 strtonum strftime switch2" @@ -125,6 +129,16 @@ $ list = "double1 double2 fmtspcl intformat" $ gosub list_of_tests $ return $ +$ ! pgawk_tests is part of bigtest; profile_tests is a separate subset +$profile_tests: echo "profile_tests..." +$ list = "profile1" +$ gosub list_of_tests +$ ! fall through to pgawk_tests +$pgawk_tests: echo "pgawk_tests..." +$ list = "profile2 profile3" +$ gosub list_of_tests +$ return +$ $extra: echo "extra..." $ list = "regtest inftest inet" $ gosub list_of_tests @@ -979,7 +993,10 @@ $! FIXME: gawk generates an extra, empty output file while running this test... $iobug1: echo "iobug1" $ cat = "TYPE sys$input:" $ true = "exit 1" !success +$ oldout = f$search("_iobug1.tmp;") $ gawk -f iobug1.awk iobug1.in >_iobug1.tmp +$ badout = f$search("_iobug1.tmp;-1") +$ if badout.nes."" .and. badout.nes.oldout then rm 'badout' $ cmp iobug1.ok _iobug1.tmp $ if $status then rm _iobug1.tmp; $ return @@ -1346,6 +1363,64 @@ $ cmp intformat.ok _intformat.tmp $ if $status then rm _intformat.tmp; $ return $ +$profile1: echo "profile1" +$ ! this profile test is run with gawk rather than pgawk +$ ! FIXME: for both gawk invocations which pipe output to SORT, +$ ! two output files get created; the top version has real output +$ ! but there's also an empty lower version. +$ oldout = f$search("_profile1.tmp1") +$ gawk --profile -v "sortcmd=SORT sys$intput: sys$output:" - + -f xref.awk dtdgport.awk > _'test'.tmp1 +$ badout = f$search("_profile1.tmp1;-1") +$ if badout.nes."" .and. badout.nes.oldout then rm 'badout' +$ oldout = f$search("_profile1.tmp2") +$ gawk -v "sortcmd=SORT sys$intput: sys$output:" - + -f awkprof.out dtdgport.awk > _'test'.tmp2 +$ badout = f$search("_profile1.tmp2;-1") +$ if badout.nes."" .and. badout.nes.oldout then rm 'badout' +$ cmp _profile1.tmp1 _profile1.tmp2 +$ if $status then rm _profile1.tmp%;,awkprof.out; +$ return +$ +$ ! pgawk tests; building pgawk is optional so have to check whether it's here +$profile2: +$profile3: +$ if pgawkok.lt.0 +$ then f = f$parse(pgawk,".exe;") +$ ! expect first parse to fail due to leading dollar sign +$ if f.eqs."" then f = f$parse(f$extract(1,999,pgawk),".exe;") +$ if f.nes."" then f = f$search(f) +$ pgawkok = (f.nes."").and.1 ! set to 1 or 0 +$ if .not.pgawkok then - + echo "Can't find pgawk.exe so can't run profiling tests." +$ endif +$ if pgawkok then goto do__'test' +$ echo "''test' skipped" +$ return +$ +$do__profile2: echo "profile2" +$ pgawk -v "sortcmd=SORT sys$input: sys$output:" - + -f xref.awk dtdgport.awk > _NL: +$ ! sed <awkprof.out 1,2d >_profile2.tmp +$ sumslp awkprof.out /update=sys$input: /output=_profile2.tmp +-1,2 +/ +$ rm awkprof.out; +$ cmp profile2.ok _profile2.tmp +$ if $status then rm _profile2.tmp;* +$ return +$ +$do__profile3: echo "profile3" +$ pgawk -f profile3.awk > _NL: +$ ! sed <awkprof.out 1,2d >_profile3.tmp +$ sumslp awkprof.out /update=sys$input: /output=_profile3.tmp +-1,2 +/ +$ rm awkprof.out; +$ cmp profile3.ok _profile3.tmp +$ if $status then rm _profile3.tmp;* +$ return +$ $vms_cmd: echo "vms_cmd" $ if f$search("vms_cmd.ok").eqs."" $ then create vms_cmd.ok |