Browse Source

* finally it works on linux also from the testsuite script

git-svn-id: trunk@11012 -
florian 17 years ago
parent
commit
4dfd59a6f8
2 changed files with 8 additions and 5 deletions
  1. 7 4
      tests/test/tlib1.pp
  2. 1 1
      tests/test/tlib1a.pp

+ 7 - 4
tests/test/tlib1.pp

@@ -1,12 +1,13 @@
-{ %opt=-gl }
+{ %opt=-gl -O- }
 { %needlibrary }
 {$goto on}
 
-{ test lineinfo in libraries }
+{ test lineinfo in libraries, to get always proper results, the optimizer
+  must be turned off with -O- }
 
 {$ifdef unix}
 uses
-  dl;
+  dl,sysutils;
 {$endif unix}
 
 procedure p(var a : pointer);external 'tlib1a' name 'p';
@@ -22,6 +23,7 @@ w:
   { library }
   p(a);
   GetLineInfo(PtrUInt(a),s1,s2,l);
+  s2:=ExtractFilename(s2);  
   writeln({ 'Func: ',s1,'} 'Source: ',s2,' Line: ',l);
   { GetLineInfo of dwarf doesn't return the function name }
   if { (s1<>'P') or } (s2<>'tlib1a.pp') or (l<>9) then
@@ -29,9 +31,10 @@ w:
 
   { main program }
   GetLineInfo(PtrUInt(@w),s1,s2,l);
+  s2:=ExtractFilename(s2);
   writeln({ 'Func: ',s1,'} 'Source: ',s2,' Line: ',l);
   { GetLineInfo of dwarf doesn't return the function name }
-  if { (s1<>'P') or } (s2<>'tlib1.pp') or (l<>20) then
+  if { (s1<>'P') or } (s2<>'tlib1.pp') or (l<>21) then
     halt(1);
   
   writeln('ok');

+ 1 - 1
tests/test/tlib1a.pp

@@ -1,5 +1,5 @@
+{ %opt=-gl -O- }
 { %norun }
-{ %opt=-gl }
 {$goto on}
 library tlib1a;