Browse Source

* Fix tests so they run on any system

git-svn-id: trunk@40428 -
michael 6 years ago
parent
commit
5059824f44
2 changed files with 11 additions and 8 deletions
  1. 3 4
      packages/pastojs/tests/tcunitsearch.pas
  2. 8 4
      packages/pastojs/tests/testpas2js.lpi

+ 3 - 4
packages/pastojs/tests/tcunitsearch.pas

@@ -221,11 +221,10 @@ begin
   {$ENDIF}
   inherited SetUp;
   FDefaultFileAge:=DateTimeToFileDate(Now);
+  WorkDir:=ExtractFilePath(ParamStr(0));
   {$IFDEF Windows}
-  WorkDir:='P:\test';
   CompilerExe:='P:\bin\pas2js.exe';
   {$ELSE}
-  WorkDir:='/home/user';
   CompilerExe:='/usr/bin/pas2js';
   {$ENDIF}
   FCompiler:=TTestCompiler.Create;
@@ -684,7 +683,7 @@ begin
     '  a:=b;',
     'end.']);
   Compile(['test1.pas','-Jc'],ExitCodeSyntaxError);
-  AssertEquals('ErrorMsg','Duplicate file found: "/home/user/sub/unit1.pas" and "/home/user/unit1.pas"',ErrorMsg);
+  AssertEquals('ErrorMsg','Duplicate file found: "'+WorkDir+'sub/unit1.pas" and "'+WorkDir+'unit1.pas"',ErrorMsg);
 end;
 
 procedure TTestCLI_UnitSearch.TestUS_UsesInFile_IndirectDuplicate;
@@ -704,7 +703,7 @@ begin
     'begin',
     'end.']);
   Compile(['test1.pas','-Jc'],ExitCodeSyntaxError);
-  AssertEquals('ErrorMsg','Duplicate file found: "/home/user/unit1.pas" and "/home/user/sub/unit1.pas"',ErrorMsg);
+  AssertEquals('ErrorMsg','Duplicate file found: "'+WorkDir+'unit1.pas" and "'+WorkDir+'sub/unit1.pas"',ErrorMsg);
 end;
 
 Initialization

+ 8 - 4
packages/pastojs/tests/testpas2js.lpi

@@ -19,9 +19,16 @@
       <Version Value="2"/>
     </PublishOptions>
     <RunParams>
+      <local>
+        <CommandLineParams Value="--suite=TTestCLI_UnitSearch"/>
+      </local>
       <FormatVersion Value="2"/>
       <Modes Count="1">
-        <Mode0 Name="default"/>
+        <Mode0 Name="default">
+          <local>
+            <CommandLineParams Value="--suite=TTestCLI_UnitSearch"/>
+          </local>
+        </Mode0>
       </Modes>
     </RunParams>
     <RequiredPackages Count="2">
@@ -103,9 +110,6 @@
     </CodeGeneration>
     <Other>
       <CustomOptions Value="-dVerbosePas2JS"/>
-      <OtherDefines Count="1">
-        <Define0 Value="VerbosePas2JS"/>
-      </OtherDefines>
     </Other>
   </CompilerOptions>
   <Debugging>