Browse Source

+ test for previous commit with main program linking to libc
(apparently already works after all :)

git-svn-id: trunk@10496 -

Jonas Maebe 17 years ago
parent
commit
b4d59bf0fb
3 changed files with 46 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 9 1
      tests/webtbs/tw8730c.pp
  3. 36 0
      tests/webtbs/tw8730d.pp

+ 1 - 0
.gitattributes

@@ -8921,6 +8921,7 @@ tests/webtbs/tw8685.pp svneol=native#text/plain
 tests/webtbs/tw8730a.pp svneol=native#text/plain
 tests/webtbs/tw8730a.pp svneol=native#text/plain
 tests/webtbs/tw8730b.pp svneol=native#text/plain
 tests/webtbs/tw8730b.pp svneol=native#text/plain
 tests/webtbs/tw8730c.pp svneol=native#text/plain
 tests/webtbs/tw8730c.pp svneol=native#text/plain
+tests/webtbs/tw8730d.pp svneol=native#text/plain
 tests/webtbs/tw8757.pp svneol=native#text/plain
 tests/webtbs/tw8757.pp svneol=native#text/plain
 tests/webtbs/tw8777f.pp svneol=native#text/plain
 tests/webtbs/tw8777f.pp svneol=native#text/plain
 tests/webtbs/tw8777g.pp svneol=native#text/plain
 tests/webtbs/tw8777g.pp svneol=native#text/plain

+ 9 - 1
tests/webtbs/tw8730c.pp

@@ -17,9 +17,17 @@ const
 
 
 function Lib2Func: pchar; CDecl; external libname name 'Lib2Func';
 function Lib2Func: pchar; CDecl; external libname name 'Lib2Func';
 
 
+var
+  error: byte;
 begin
 begin
+  error:=0;
   WriteLn( Lib2Func );
   WriteLn( Lib2Func );
   if not(fileexists('tw8730a.txt')) or
   if not(fileexists('tw8730a.txt')) or
      not(fileexists('tw8730b.txt')) then
      not(fileexists('tw8730b.txt')) then
-    halt(1);
+   error:=1;
+  if (fileexists('tw8730a.txt')) then
+    deletefile('tw8730a.txt');
+  if (fileexists('tw8730b.txt')) then
+    deletefile('tw8730b.txt');
+  halt(error);
 end.
 end.

+ 36 - 0
tests/webtbs/tw8730d.pp

@@ -0,0 +1,36 @@
+{ %target=win32,win64,wince,darwin,linux,freebsd,solaris,beos}
+{ %NEEDLIBRARY }
+
+{ same as tw8730c, but linking to libc so it uses different }
+{ startup code                                              }
+
+{$mode delphi}
+program MainApp;
+
+uses
+  initc, sysutils;
+
+const
+{$ifdef windows}
+  libname='tw8730b.dll';
+{$else}
+  libname='tw8730b';
+  {$linklib tw8730b}
+{$endif}
+
+function Lib2Func: pchar; CDecl; external libname name 'Lib2Func';
+
+var
+  error: byte;
+begin
+  error:=0;
+  WriteLn( Lib2Func );
+  if not(fileexists('tw8730a.txt')) or
+     not(fileexists('tw8730b.txt')) then
+   error:=1;
+  if (fileexists('tw8730a.txt')) then
+    deletefile('tw8730a.txt');
+  if (fileexists('tw8730b.txt')) then
+    deletefile('tw8730b.txt');
+  halt(error);
+end.