dotest.pp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. {
  2. $Id$
  3. This file is part of the Free Pascal test suite.
  4. Copyright (c) 1999-2002 by the Free Pascal development team.
  5. This program makes the compilation and
  6. execution of individual test sources.
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. {$H+}
  14. program dotest;
  15. uses
  16. dos,
  17. teststr,
  18. testu,
  19. redir;
  20. const
  21. {$ifdef UNIX}
  22. ExeExt='';
  23. {$else UNIX}
  24. ExeExt='exe';
  25. {$endif UNIX}
  26. var
  27. Config : TConfig;
  28. CompilerBin : string;
  29. CompilerCPU : string;
  30. CompilerVersion : string;
  31. PPFile : string;
  32. PPFileInfo : string;
  33. TestName : string;
  34. Note : string;
  35. const
  36. LongLogfile : string[32] = 'longlog';
  37. FailLogfile : string[32] = 'faillist';
  38. DoGraph : boolean = false;
  39. DoInteractive : boolean = false;
  40. DoExecute : boolean = false;
  41. DoKnown : boolean = false;
  42. DoAll : boolean = false;
  43. DoUsual : boolean = true;
  44. Function FileExists (Const F : String) : Boolean;
  45. {
  46. Returns True if the file exists, False if not.
  47. }
  48. Var
  49. info : searchrec;
  50. begin
  51. FindFirst (F,anyfile,Info);
  52. FileExists:=DosError=0;
  53. FindClose (Info);
  54. end;
  55. function ToStr(l:longint):string;
  56. var
  57. s : string;
  58. begin
  59. Str(l,s);
  60. ToStr:=s;
  61. end;
  62. function ToStrZero(l:longint;nbzero : byte):string;
  63. var
  64. s : string;
  65. begin
  66. Str(l,s);
  67. while length(s)<nbzero do
  68. s:='0'+s;
  69. ToStrZero:=s;
  70. end;
  71. procedure SetPPFileInfo;
  72. Var
  73. info : searchrec;
  74. dt : DateTime;
  75. begin
  76. FindFirst (PPFile,anyfile,Info);
  77. If DosError=0 then
  78. begin
  79. UnpackTime(info.time,dt);
  80. PPFileInfo:=PPFile+' '+ToStr(dt.year)+'/'+ToStrZero(dt.month,2)+'/'+
  81. ToStrZero(dt.day,2)+' '+ToStrZero(dt.Hour,2)+':'+ToStrZero(dt.min,2)+':'+ToStrZero(dt.sec,2);
  82. end
  83. else
  84. PPFileInfo:=PPfile;
  85. FindClose (Info);
  86. end;
  87. function SplitPath(const s:string):string;
  88. var
  89. i : longint;
  90. begin
  91. i:=Length(s);
  92. while (i>0) and not(s[i] in ['/','\']) do
  93. dec(i);
  94. SplitPath:=Copy(s,1,i);
  95. end;
  96. function ForceExtension(Const HStr,ext:String):String;
  97. {
  98. Return a filename which certainly has the extension ext
  99. }
  100. var
  101. j : longint;
  102. begin
  103. j:=length(Hstr);
  104. while (j>0) and (Hstr[j]<>'.') do
  105. dec(j);
  106. if j=0 then
  107. j:=255;
  108. if Ext<>'' then
  109. ForceExtension:=Copy(Hstr,1,j-1)+'.'+Ext
  110. else
  111. ForceExtension:=Copy(Hstr,1,j-1);
  112. end;
  113. procedure Copyfile(const fn1,fn2:string;append:boolean);
  114. const
  115. bufsize = 16384;
  116. var
  117. f,g : file;
  118. i : longint;
  119. buf : pointer;
  120. begin
  121. if Append then
  122. Verbose(V_Debug,'Appending '+fn1+' to '+fn2)
  123. else
  124. Verbose(V_Debug,'Copying '+fn1+' to '+fn2);
  125. assign(f,fn1);
  126. assign(g,fn2);
  127. {$I-}
  128. reset(f,1);
  129. {$I+}
  130. if ioresult<>0 then
  131. Verbose(V_Error,'Can''t open '+fn1);
  132. if append then
  133. begin
  134. {$I-}
  135. reset(g,1);
  136. {$I+}
  137. if ioresult<>0 then
  138. append:=false
  139. else
  140. seek(g,filesize(g));
  141. end;
  142. if not append then
  143. begin
  144. {$I-}
  145. rewrite(g,1);
  146. {$I+}
  147. if ioresult<>0 then
  148. Verbose(V_Error,'Can''t open '+fn2+' for output');
  149. end;
  150. getmem(buf,bufsize);
  151. repeat
  152. blockread(f,buf^,bufsize,i);
  153. blockwrite(g,buf^,i);
  154. until i<bufsize;
  155. freemem(buf,bufsize);
  156. close(f);
  157. close(g);
  158. end;
  159. procedure AddLog(const logfile,s:string);
  160. var
  161. t : text;
  162. begin
  163. assign(t,logfile);
  164. {$I-}
  165. append(t);
  166. {$I+}
  167. if ioresult<>0 then
  168. begin
  169. {$I-}
  170. rewrite(t);
  171. {$I+}
  172. if ioresult<>0 then
  173. Verbose(V_Abort,'Can''t append to '+logfile);
  174. end;
  175. writeln(t,s);
  176. close(t);
  177. end;
  178. function GetConfig(const fn:string;var r:TConfig):boolean;
  179. var
  180. t : text;
  181. part,code : integer;
  182. l : longint;
  183. s,res : string;
  184. function GetEntry(const entry:string):boolean;
  185. var
  186. i : longint;
  187. begin
  188. Getentry:=false;
  189. Res:='';
  190. if Upcase(Copy(s,1,length(entry)))=Upcase(entry) then
  191. begin
  192. Delete(s,1,length(entry));
  193. TrimB(s);
  194. if (s<>'') then
  195. begin
  196. if (s[1]='=') then
  197. begin
  198. delete(s,1,1);
  199. i:=pos('}',s);
  200. if i=0 then
  201. i:=255
  202. else
  203. dec(i);
  204. res:=Copy(s,1,i);
  205. TrimB(res);
  206. TrimE(res);
  207. end;
  208. Verbose(V_Debug,'Config: '+Entry+' = "'+Res+'"');
  209. GetEntry:=true;
  210. end;
  211. end;
  212. end;
  213. begin
  214. FillChar(r,sizeof(r),0);
  215. GetConfig:=false;
  216. Verbose(V_Debug,'Reading '+fn);
  217. assign(t,fn);
  218. {$I-}
  219. reset(t);
  220. {$I+}
  221. if ioresult<>0 then
  222. begin
  223. Verbose(V_Error,'Can''t open '+fn);
  224. exit;
  225. end;
  226. Note:='';
  227. while not eof(t) do
  228. begin
  229. readln(t,s);
  230. if s<>'' then
  231. begin
  232. if s[1]='{' then
  233. begin
  234. delete(s,1,1);
  235. TrimB(s);
  236. if (s<>'') and (s[1]='%') then
  237. begin
  238. delete(s,1,1);
  239. if GetEntry('OPT') then
  240. r.NeedOptions:=res
  241. else
  242. if GetEntry('CPU') then
  243. r.NeedCPU:=res
  244. else
  245. if GetEntry('VERSION') then
  246. r.NeedVersion:=res
  247. else
  248. if GetEntry('RESULT') then
  249. Val(res,r.ResultCode,code)
  250. else
  251. if GetEntry('GRAPH') then
  252. r.UsesGraph:=true
  253. else
  254. if GetEntry('FAIL') then
  255. r.ShouldFail:=true
  256. else
  257. if GetEntry('RECOMPILE') then
  258. r.NeedRecompile:=true
  259. else
  260. if GetEntry('NORUN') then
  261. r.NoRun:=true
  262. else
  263. if GetEntry('NEEDLIBRARY') then
  264. r.NeedLibrary:=true
  265. else
  266. if GetEntry('KNOWNRUNERROR') then
  267. begin
  268. if res<>'' then
  269. begin
  270. val(res,l,code);
  271. if code>1 then
  272. begin
  273. part:=code;
  274. val(copy(res,1,code-1),l,code);
  275. delete(res,1,part);
  276. end;
  277. if code=0 then
  278. r.KnownRunError:=l;
  279. if res<>'' then
  280. r.KnownRunNote:=res;
  281. end;
  282. end
  283. else
  284. if GetEntry('KNOWN') then
  285. r.IsKnown:=true
  286. else
  287. if GetEntry('INTERACTIVE') then
  288. r.IsInteractive:=true
  289. else
  290. if GetEntry('NOTE') then
  291. begin
  292. Note:='Note: '+res;
  293. Verbose(V_Normal,Note);
  294. end
  295. else
  296. Verbose(V_Error,'Unknown entry: '+s);
  297. end;
  298. end
  299. else
  300. break;
  301. end;
  302. end;
  303. close(t);
  304. GetConfig:=true;
  305. end;
  306. function GetCompilerVersion:boolean;
  307. var
  308. t : text;
  309. begin
  310. GetCompilerVersion:=false;
  311. ExecuteRedir(CompilerBin,'-iV','','out','');
  312. assign(t,'out');
  313. {$I-}
  314. reset(t);
  315. readln(t,CompilerVersion);
  316. close(t);
  317. erase(t);
  318. {$I+}
  319. if ioresult<>0 then
  320. Verbose(V_Error,'Can''t get Compiler Version')
  321. else
  322. begin
  323. Verbose(V_Debug,'Current Compiler Version: '+CompilerVersion);
  324. GetCompilerVersion:=true;
  325. end;
  326. end;
  327. function GetCompilerCPU:boolean;
  328. var
  329. t : text;
  330. begin
  331. GetCompilerCPU:=false;
  332. ExecuteRedir(CompilerBin,'-iTP','','out','');
  333. assign(t,'out');
  334. {$I-}
  335. reset(t);
  336. readln(t,CompilerCPU);
  337. close(t);
  338. erase(t);
  339. {$I+}
  340. if ioresult<>0 then
  341. Verbose(V_Error,'Can''t get Compiler CPU Target')
  342. else
  343. begin
  344. Verbose(V_Debug,'Current Compiler CPU Target: '+CompilerCPU);
  345. GetCompilerCPU:=true;
  346. end;
  347. end;
  348. function ExitWithInternalError(const OutName:string):boolean;
  349. var
  350. t : text;
  351. s : string;
  352. begin
  353. ExitWithInternalError:=false;
  354. { open logfile }
  355. assign(t,Outname);
  356. {$I-}
  357. reset(t);
  358. {$I+}
  359. if ioresult<>0 then
  360. exit;
  361. while not eof(t) do
  362. begin
  363. readln(t,s);
  364. if pos('Fatal: Internal error ',s)>0 then
  365. begin
  366. ExitWithInternalError:=true;
  367. break;
  368. end;
  369. end;
  370. close(t);
  371. end;
  372. function RunCompiler:boolean;
  373. var
  374. outname,
  375. args : string;
  376. begin
  377. RunCompiler:=false;
  378. OutName:=ForceExtension(PPFile,'log');
  379. args:='-n -Fuunits';
  380. {$ifdef unix}
  381. { Add runtime library path to current dir to find .so files }
  382. if Config.NeedLibrary then
  383. args:=args+' ''-k-rpath .''';
  384. {$endif unix}
  385. if Config.NeedOptions<>'' then
  386. args:=args+' '+Config.NeedOptions;
  387. args:=args+' '+ppfile;
  388. Verbose(V_Debug,'Executing '+compilerbin+' '+args);
  389. { also get the output from as and ld that writes to stderr sometimes }
  390. ExecuteRedir(CompilerBin,args,'',OutName,OutName);
  391. Verbose(V_Debug,'Exitcode '+ToStr(ExecuteResult));
  392. { Check for internal error }
  393. if ExitWithInternalError(OutName) then
  394. begin
  395. AddLog(FailLogFile,TestName);
  396. if Note<>'' then
  397. AddLog(FailLogFile,Note);
  398. AddLog(ResLogFile,failed_to_compile+PPFileInfo+' internalerror generated');
  399. AddLog(LongLogFile,line_separation);
  400. AddLog(LongLogFile,failed_to_compile+PPFileInfo);
  401. if Note<>'' then
  402. AddLog(LongLogFile,Note);
  403. CopyFile(OutName,LongLogFile,true);
  404. { avoid to try again }
  405. AddLog(ForceExtension(PPFile,'elg'),'Failed to compile '++PPFileInfo);
  406. Verbose(V_Abort,'Internal error in compiler');
  407. exit;
  408. end;
  409. { Shoud the compile fail ? }
  410. if Config.ShouldFail then
  411. begin
  412. if ExecuteResult<>0 then
  413. begin
  414. AddLog(ResLogFile,success_compilation_failed+PPFileInfo);
  415. { avoid to try again }
  416. AddLog(ForceExtension(PPFile,'elg'),success_compilation_failed+PPFileInfo);
  417. RunCompiler:=true;
  418. end
  419. else
  420. begin
  421. AddLog(FailLogFile,TestName);
  422. if Note<>'' then
  423. AddLog(FailLogFile,Note);
  424. AddLog(ResLogFile,failed_compilation_successful+PPFileInfo);
  425. AddLog(LongLogFile,line_separation);
  426. AddLog(LongLogFile,failed_compilation_successful+PPFileInfo);
  427. { avoid to try again }
  428. AddLog(ForceExtension(PPFile,'elg'),failed_compilation_successful+PPFileInfo);
  429. if Note<>'' then
  430. AddLog(LongLogFile,Note);
  431. CopyFile(OutName,LongLogFile,true);
  432. end;
  433. end
  434. else
  435. begin
  436. if ExecuteResult<>0 then
  437. begin
  438. AddLog(FailLogFile,TestName);
  439. if Note<>'' then
  440. AddLog(FailLogFile,Note);
  441. AddLog(ResLogFile,failed_to_compile+PPFileInfo);
  442. AddLog(LongLogFile,line_separation);
  443. AddLog(LongLogFile,failed_to_compile+PPFileInfo);
  444. if Note<>'' then
  445. AddLog(LongLogFile,Note);
  446. CopyFile(OutName,LongLogFile,true);
  447. { avoid to try again }
  448. AddLog(ForceExtension(PPFile,'elg'),failed_to_compile+PPFileInfo);
  449. Verbose(V_Abort,'Exitcode: '+ToStr(ExecuteResult)+' (expected 0)');
  450. end
  451. else
  452. begin
  453. AddLog(ResLogFile,successfully_compiled+PPFileInfo);
  454. RunCompiler:=true;
  455. end;
  456. end;
  457. end;
  458. function RunExecutable:boolean;
  459. var
  460. outname,
  461. TestExe : string;
  462. begin
  463. RunExecutable:=false;
  464. TestExe:=ForceExtension(PPFile,ExeExt);
  465. OutName:=ForceExtension(PPFile,'elg');
  466. Verbose(V_Debug,'Executing '+TestExe);
  467. { don't redirect interactive and graph programs .. }
  468. if Config.IsInteractive or Config.UsesGraph then
  469. ExecuteRedir(TestExe,'','','','')
  470. else
  471. ExecuteRedir(TestExe,'','',OutName,'');
  472. Verbose(V_Debug,'Exitcode '+ToStr(ExecuteResult));
  473. if ExecuteResult<>Config.ResultCode then
  474. begin
  475. if (ExecuteResult<>0) and
  476. (ExecuteResult=Config.KnownRunError) then
  477. begin
  478. AddLog(FailLogFile,TestName+known_problem+Config.KnownRunNote);
  479. AddLog(ResLogFile,failed_to_run+PPFileInfo+known_problem+Config.KnownRunNote);
  480. AddLog(LongLogFile,line_separation);
  481. AddLog(LongLogFile,known_problem+Config.KnownRunNote);
  482. AddLog(LongLogFile,failed_to_run+PPFileInfo+' ('+ToStr(ExecuteResult)+')');
  483. Copyfile(OutName,LongLogFile,true);
  484. Verbose(V_Abort,known_problem+'exitcode: '+ToStr(ExecuteResult)+' (expected '+ToStr(Config.ResultCode)+')');
  485. end
  486. else
  487. begin
  488. AddLog(FailLogFile,TestName);
  489. AddLog(ResLogFile,failed_to_run+PPFileInfo);
  490. AddLog(LongLogFile,line_separation);
  491. AddLog(LongLogFile,failed_to_run+PPFileInfo+' ('+ToStr(ExecuteResult)+')');
  492. Copyfile(OutName,LongLogFile,true);
  493. Verbose(V_Abort,'Exitcode: '+ToStr(ExecuteResult)+' (expected '+ToStr(Config.ResultCode)+')');
  494. end
  495. end
  496. else
  497. begin
  498. AddLog(ResLogFile,successfully_run+PPFileInfo);
  499. RunExecutable:=true;
  500. end;
  501. end;
  502. procedure getargs;
  503. var
  504. ch : char;
  505. para : string;
  506. i : longint;
  507. procedure helpscreen;
  508. begin
  509. writeln('dotest [Options] <File>');
  510. writeln;
  511. writeln('Options can be:');
  512. writeln(' -C<compiler> set compiler to use');
  513. writeln(' -V verbose');
  514. writeln(' -E execute test also');
  515. writeln(' -X don''t use COMSPEC');
  516. writeln(' -A include ALL tests');
  517. writeln(' -G include graph tests');
  518. writeln(' -K include known bug tests');
  519. writeln(' -I include interactive tests');
  520. halt(1);
  521. end;
  522. begin
  523. PPFile:='';
  524. if exeext<>'' then
  525. CompilerBin:='ppc386.'+exeext
  526. else
  527. CompilerBin:='ppc386';
  528. for i:=1 to paramcount do
  529. begin
  530. para:=Paramstr(i);
  531. if (para[1]='-') then
  532. begin
  533. ch:=Upcase(para[2]);
  534. delete(para,1,2);
  535. case ch of
  536. 'A' :
  537. begin
  538. DoGraph:=true;
  539. DoInteractive:=true;
  540. DoKnown:=true;
  541. DoAll:=true;
  542. end;
  543. 'C' : CompilerBin:=Para;
  544. 'E' : DoExecute:=true;
  545. 'G' : begin
  546. DoGraph:=true;
  547. if para='-' then
  548. DoUsual:=false;
  549. end;
  550. 'I' : begin
  551. DoInteractive:=true;
  552. if para='-' then
  553. DoUsual:=false;
  554. end;
  555. 'K' : begin
  556. DoKnown:=true;
  557. if para='-' then
  558. DoUsual:=false;
  559. end;
  560. 'V' : DoVerbose:=true;
  561. 'X' : UseComSpec:=false;
  562. end;
  563. end
  564. else
  565. begin
  566. If PPFile<>'' then
  567. HelpScreen;
  568. PPFile:=ForceExtension(Para,'pp');
  569. end;
  570. end;
  571. if (PPFile='') then
  572. HelpScreen;
  573. SetPPFileInfo;
  574. TestName:=Copy(PPFile,1,Pos('.pp',PPFile)-1);
  575. Verbose(V_Debug,'Running test '+TestName+', file '+PPFile);
  576. end;
  577. procedure RunTest;
  578. var
  579. Res : boolean;
  580. OutName : string;
  581. begin
  582. Res:=GetConfig(ppfile,Config);
  583. OutName:=ForceExtension(PPFile,'elg');
  584. if Res then
  585. begin
  586. if Config.UsesGraph and (not DoGraph) then
  587. begin
  588. AddLog(ResLogFile,skipping_graph_test+PPFileInfo);
  589. { avoid a second attempt by writing to elg file }
  590. AddLog(OutName,skipping_graph_test+PPFileInfo);
  591. Verbose(V_Abort,skipping_graph_test);
  592. Res:=false;
  593. end;
  594. end;
  595. if Res then
  596. begin
  597. if Config.IsInteractive and (not DoInteractive) then
  598. begin
  599. { avoid a second attempt by writing to elg file }
  600. AddLog(OutName,skipping_interactive_test+PPFileInfo);
  601. AddLog(ResLogFile,skipping_interactive_test+PPFileInfo);
  602. Verbose(V_Abort,skipping_interactive_test);
  603. Res:=false;
  604. end;
  605. end;
  606. if Res then
  607. begin
  608. if Config.IsKnown and (not DoKnown) then
  609. begin
  610. { avoid a second attempt by writing to elg file }
  611. AddLog(OutName,skipping_known_bug+PPFileInfo);
  612. AddLog(ResLogFile,skipping_known_bug+PPFileInfo);
  613. Verbose(V_Abort,skipping_known_bug);
  614. Res:=false;
  615. end;
  616. end;
  617. if Res and not DoUsual then
  618. res:=(Config.IsInteractive and DoInteractive) or
  619. (Config.IsKnown and DoKnown) or
  620. (Config.UsesGraph and DoGraph);
  621. if Res then
  622. begin
  623. if (Config.NeedVersion<>'') and not DoAll then
  624. begin
  625. Verbose(V_Debug,'Required compiler version: '+Config.NeedVersion);
  626. Res:=GetCompilerVersion;
  627. if CompilerVersion<Config.NeedVersion then
  628. begin
  629. { avoid a second attempt by writing to elg file }
  630. AddLog(OutName,skipping_compiler_version_too_low+PPFileInfo);
  631. AddLog(ResLogFile,skipping_compiler_version_too_low+PPFileInfo);
  632. Verbose(V_Abort,'Compiler version too low '+CompilerVersion+' < '+Config.NeedVersion);
  633. Res:=false;
  634. end;
  635. end;
  636. end;
  637. if Res then
  638. begin
  639. if Config.NeedCPU<>'' then
  640. begin
  641. Verbose(V_Debug,'Required compiler cpu: '+Config.NeedCPU);
  642. Res:=GetCompilerCPU;
  643. if Upper(Config.NeedCPU)<>Upper(CompilerCPU) then
  644. begin
  645. { avoid a second attempt by writing to elg file }
  646. AddLog(OutName,skipping_other_cpu+PPFileInfo);
  647. AddLog(ResLogFile,skipping_other_cpu+PPFileInfo);
  648. Verbose(V_Abort,'Compiler cpu wrong '+CompilerCPU+' <> '+Config.NeedCPU);
  649. Res:=false;
  650. end;
  651. end;
  652. end;
  653. if Res then
  654. begin
  655. Res:=RunCompiler;
  656. if Res and Config.NeedRecompile then
  657. Res:=RunCompiler;
  658. end;
  659. if Res then
  660. begin
  661. if (Config.NoRun) then
  662. begin
  663. { avoid a second attempt by writing to elg file }
  664. AddLog(OutName,skipping_run_test+PPFileInfo);
  665. AddLog(ResLogFile,skipping_run_test+PPFileInfo);
  666. Verbose(V_Debug,skipping_run_test);
  667. end
  668. else
  669. begin
  670. if (not Config.ShouldFail) and DoExecute then
  671. begin
  672. if FileExists(ForceExtension(PPFile,'ppu')) or
  673. FileExists(ForceExtension(PPFile,'ppo')) or
  674. FileExists(ForceExtension(PPFile,'ppw')) then
  675. begin
  676. AddLog(ForceExtension(PPFile,'elg'),skipping_run_unit+PPFileInfo);
  677. AddLog(ResLogFile,skipping_run_unit+PPFileInfo);
  678. Verbose(V_Debug,'Unit found, skipping run test')
  679. end
  680. else
  681. Res:=RunExecutable;
  682. end;
  683. end;
  684. end;
  685. end;
  686. begin
  687. GetArgs;
  688. RunTest;
  689. end.
  690. {
  691. $Log$
  692. Revision 1.23 2002-12-17 15:04:32 michael
  693. + Added dbdigest to store results in a database
  694. Revision 1.22 2002/12/15 13:30:46 peter
  695. * NEEDLIBRARY option to add -rpath to the linker for unix. This is
  696. needed to test runtime library tests. The library needs the -FE.
  697. option to place the .so in the correct directory
  698. Revision 1.21 2002/12/05 16:03:34 pierre
  699. + -X option to disable UseComSpec
  700. Revision 1.20 2002/11/18 16:42:43 pierre
  701. + KNOWNRUNERROR added
  702. Revision 1.19 2002/11/18 01:31:07 pierre
  703. + use -n option
  704. + use -G- for only graph
  705. + use -I- for only interactive
  706. + use -K- for only known bugs.
  707. Revision 1.18 2002/11/14 10:36:12 pierre
  708. * add internalerror info to log file
  709. Revision 1.17 2002/11/13 15:26:24 pierre
  710. + digest program added
  711. Revision 1.16 2002/11/13 15:19:44 pierre
  712. log strings moved to teststr unit
  713. Revision 1.15 2002/09/07 15:40:56 peter
  714. * old logs removed and tabs fixed
  715. Revision 1.14 2002/04/21 18:15:32 peter
  716. * Check for internal errors
  717. Revision 1.13 2002/03/03 13:27:28 hajny
  718. + added support for OS/2 units (.ppo)
  719. Revision 1.12 2002/01/29 13:24:16 pierre
  720. + also generate .elg file for units
  721. Revision 1.11 2002/01/29 12:51:08 pierre
  722. + PPFileInfo to also display time stamp of test file
  723. * generate .elg file in several cases
  724. to avoid trying to recompute the same test
  725. over and over again.
  726. }