瀏覽代碼

* support passing options to the emulator when using one for testing

git-svn-id: trunk@47604 -
florian 4 年之前
父節點
當前提交
9c77e4a899
共有 4 個文件被更改,包括 36 次插入24 次删除
  1. 3 0
      tests/Makefile
  2. 4 0
      tests/Makefile.fpc
  3. 1 0
      tests/readme.txt
  4. 28 24
      tests/utils/dotest.pp

+ 3 - 0
tests/Makefile

@@ -2588,6 +2588,9 @@ endif
 ifdef EMULATOR
 ifdef EMULATOR
 override DOTESTOPT+=-M$(EMULATOR)
 override DOTESTOPT+=-M$(EMULATOR)
 endif
 endif
+ifdef EMULATOR_OPTS
+override DOTESTOPT+=-N$(EMULATOR_OPTS)
+endif
 ifdef USEENV
 ifdef USEENV
 override DOTESTENV:=$(DOTESTOPT)
 override DOTESTENV:=$(DOTESTOPT)
 override DOTESTOPT=!DOTESTENV
 override DOTESTOPT=!DOTESTENV

+ 4 - 0
tests/Makefile.fpc

@@ -390,6 +390,10 @@ ifdef EMULATOR
 override DOTESTOPT+=-M$(EMULATOR)
 override DOTESTOPT+=-M$(EMULATOR)
 endif
 endif
 
 
+ifdef EMULATOR_OPTS
+override DOTESTOPT+=-N$(EMULATOR_OPTS)
+endif
+
 
 
 ifdef USEENV
 ifdef USEENV
 override DOTESTENV:=$(DOTESTOPT)
 override DOTESTENV:=$(DOTESTOPT)

+ 1 - 0
tests/readme.txt

@@ -217,6 +217,7 @@ Emulator execution is possible as well. It can't be combined with remote
 execution though.
 execution though.
 
 
 EMULATOR: name of the emulator to use
 EMULATOR: name of the emulator to use
+EMULATOR_OPTS: pass the given options to the emulator
 
 
 Examples:
 Examples:
 
 

+ 28 - 24
tests/utils/dotest.pp

@@ -112,6 +112,7 @@ const
   rquote : string = '''';
   rquote : string = '''';
   UseTimeout : boolean = false;
   UseTimeout : boolean = false;
   emulatorname : string = '';
   emulatorname : string = '';
+  EmulatorOpts : string = '';
   TargetCanCompileLibraries : boolean = true;
   TargetCanCompileLibraries : boolean = true;
   UniqueSuffix: string = '';
   UniqueSuffix: string = '';
 
 
@@ -1314,7 +1315,7 @@ begin
       { Add -Ssource_file_name for dosbox_wrapper }
       { Add -Ssource_file_name for dosbox_wrapper }
       if pos('dosbox_wrapper',EmulatorName)>0 then
       if pos('dosbox_wrapper',EmulatorName)>0 then
         s:=s+' -S'+PPFile[current];
         s:=s+' -S'+PPFile[current];
-      execres:=ExecuteEmulated(EmulatorName,s,FullExeLogFile,StartTicks,EndTicks);
+      execres:=ExecuteEmulated(EmulatorName,EmulatorOpts+' '+s,FullExeLogFile,StartTicks,EndTicks);
       {$I-}
       {$I-}
        ChDir(OldDir);
        ChDir(OldDir);
       {$I+}
       {$I+}
@@ -1543,30 +1544,31 @@ procedure getargs;
     writeln('dotest [Options] <File>');
     writeln('dotest [Options] <File>');
     writeln;
     writeln;
     writeln('Options can be:');
     writeln('Options can be:');
-    writeln('  !ENV_NAME     parse environment variable ENV_NAME for options');
-    writeln('  -A            include ALL tests');
-    writeln('  -ADB          use ADB to run tests');
-    writeln('  -B            delete executable before remote upload');
-    writeln('  -C<compiler>  set compiler to use');
-    writeln('  -D            display execution time');
-    writeln('  -E            execute test also');
-    writeln('  -G            include graph tests');
-    writeln('  -I            include interactive tests');
-    writeln('  -K            include known bug tests');
-    writeln('  -L<ext>       set extension of temporary files (prevent conflicts with parallel invocations)');
-    writeln('  -M<emulator>  run the tests using the given emulator');
-    writeln('  -O            use timeout wrapper for (remote) execution');
-    writeln('  -P<path>      path to the tests tree on the remote machine');
-    writeln('  -R<remote>    run the tests remotely with the given rsh/ssh address');
-    writeln('  -S            use ssh instead of rsh');
-    writeln('  -T[cpu-]<os>  run tests for target cpu and os');
+    writeln('  !ENV_NAME           parse environment variable ENV_NAME for options');
+    writeln('  -A                  include ALL tests');
+    writeln('  -ADB                use ADB to run tests');
+    writeln('  -B                  delete executable before remote upload');
+    writeln('  -C<compiler>        set compiler to use');
+    writeln('  -D                  display execution time');
+    writeln('  -E                  execute test also');
+    writeln('  -G                  include graph tests');
+    writeln('  -I                  include interactive tests');
+    writeln('  -K                  include known bug tests');
+    writeln('  -L<ext>             set extension of temporary files (prevent conflicts with parallel invocations)');
+    writeln('  -M<emulator>        run the tests using the given emulator');
+    writeln('  -N<emulator opts.>  pass options to the emulator');
+    writeln('  -O                  use timeout wrapper for (remote) execution');
+    writeln('  -P<path>            path to the tests tree on the remote machine');
+    writeln('  -R<remote>          run the tests remotely with the given rsh/ssh address');
+    writeln('  -S                  use ssh instead of rsh');
+    writeln('  -T[cpu-]<os>        run tests for target cpu and os');
     writeln('  -U<remotepara>');
     writeln('  -U<remotepara>');
-    writeln('                pass additional parameter to remote program. Multiple -U can be used');
-    writeln('  -V            be verbose');
-    writeln('  -W            use putty compatible file names when testing (plink and pscp)');
-    writeln('  -X            don''t use COMSPEC');
-    writeln('  -Y<opts>      extra options passed to the compiler. Several -Y<opt> can be given.');
-    writeln('  -Z            remove temporary files (executable,ppu,o)');
+    writeln('                      pass additional parameter to remote program. Multiple -U can be used');
+    writeln('  -V                  be verbose');
+    writeln('  -W                  use putty compatible file names when testing (plink and pscp)');
+    writeln('  -X                  don''t use COMSPEC');
+    writeln('  -Y<opts>            extra options passed to the compiler. Several -Y<opt> can be given.');
+    writeln('  -Z                  remove temporary files (executable,ppu,o)');
     halt(1);
     halt(1);
   end;
   end;
 
 
@@ -1630,6 +1632,8 @@ procedure getargs;
 
 
      'M' : EmulatorName:=Para;
      'M' : EmulatorName:=Para;
 
 
+     'N' : EmulatorOpts:=Para;
+
      'O' : UseTimeout:=true;
      'O' : UseTimeout:=true;
 
 
      'P' : RemotePath:=Para;
      'P' : RemotePath:=Para;