diff options
Diffstat (limited to 'vms')
-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 |
5 files changed, 114 insertions, 18 deletions
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 |