From 49c698a41b155b5970f4d22a6b913d6e79b55c81 Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 21 Oct 1998 16:24:14 +0000 Subject: [PATCH] + tests to check if filename exists --- tests/README | 1 + tests/getret.pp | 30 +++++++++++++++++++++++------- tests/makefile | 7 ++++++- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/tests/README b/tests/README index b26aec3a87..408fc1ca1d 100644 --- a/tests/README +++ b/tests/README @@ -24,6 +24,7 @@ ts010004.pp tests forward classes ts010005.pp tests method overriding ts010006.pp tests libraries ts010015.pp tests typed files. +ts010016.pp tests conversion of smallsets in normsets in consts ts10100.pp tests for delphi object model - diff --git a/tests/getret.pp b/tests/getret.pp index a38d10ced5..1ed2571747 100644 --- a/tests/getret.pp +++ b/tests/getret.pp @@ -10,6 +10,7 @@ program getret; filename,firstline : string; i : byte; ppfile, retfile : text; + exefile : file; begin assign(retfile,'retcode'); @@ -21,13 +22,18 @@ begin if pos('.',filename)=0 then filename:=filename+'.pp'; assign(ppfile,filename); +{$I-} reset(ppfile); - readln(ppfile,firstline); - if pos('$OPT=',firstline)>0 then - args:=copy(Firstline,pos('=',Firstline)+1,255); - if pos('}',args)>0 then - args:=copy(args,1,pos('}',args)-1); - close(ppfile); + if ioresult=0 then + begin +{$I+} + readln(ppfile,firstline); + if pos('$OPT=',firstline)>0 then + args:=copy(Firstline,pos('=',Firstline)+1,255); + if pos('}',args)>0 then + args:=copy(args,1,pos('}',args)-1); + close(ppfile); + end; end; for i:=2 to paramcount do args:=args+' '+paramstr(i); @@ -37,7 +43,17 @@ begin com:=com+'.exe'; {$endif not linux} - com:=fsearch(com,getenv('PATH')); + assign(exefile,com); +{$I-} + Writeln('testing ',com); + reset(exefile,1); + if ioresult<>0 then + begin + com:=fsearch(com,getenv('PATH')); + end + else + close(exefile); +{$I+} Writeln('Executing "',com,' ',args,'"'); Flush(output); swapvectors; diff --git a/tests/makefile b/tests/makefile index 9abdb2b563..2d31a915ff 100644 --- a/tests/makefile +++ b/tests/makefile @@ -62,6 +62,8 @@ endif ifndef PP PP=ppc386 +else +export PP endif ifndef OPT @@ -104,7 +106,10 @@ clean : -rm *.re* *.o *.ppu ts*.exe tf*.exe log faillist # $Log$ -# Revision 1.4 1998-10-21 12:14:30 pierre +# Revision 1.5 1998-10-21 16:24:16 pierre +# + tests to check if filename exists +# +# Revision 1.4 1998/10/21 12:14:30 pierre # * stupid error removing getret.exe each time # # Revision 1.3 1998/10/21 12:12:09 pierre