From bef4d583dac7d150da552544f73b6963ca237f3e Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 26 Nov 2020 21:35:00 +0000 Subject: [PATCH] * support passing options to the emulator when using one for testing git-svn-id: trunk@47604 - (cherry picked from commit 9c77e4a899e8b21bda456e704ff7245838bbd66b) --- tests/Makefile | 3 +++ tests/Makefile.fpc | 4 ++++ tests/readme.txt | 1 + tests/utils/dotest.pp | 52 +++++++++++++++++++++++-------------------- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 3143b707f6..c106d21443 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -2383,6 +2383,9 @@ endif ifdef EMULATOR override DOTESTOPT+=-M$(EMULATOR) endif +ifdef EMULATOR_OPTS +override DOTESTOPT+=-N$(EMULATOR_OPTS) +endif ifdef USEENV override DOTESTENV:=$(DOTESTOPT) override DOTESTOPT=!DOTESTENV diff --git a/tests/Makefile.fpc b/tests/Makefile.fpc index 6b950e1153..02e2052023 100644 --- a/tests/Makefile.fpc +++ b/tests/Makefile.fpc @@ -386,6 +386,10 @@ ifdef EMULATOR override DOTESTOPT+=-M$(EMULATOR) endif +ifdef EMULATOR_OPTS +override DOTESTOPT+=-N$(EMULATOR_OPTS) +endif + ifdef USEENV override DOTESTENV:=$(DOTESTOPT) diff --git a/tests/readme.txt b/tests/readme.txt index 20f8e10f87..a2f852cf5d 100644 --- a/tests/readme.txt +++ b/tests/readme.txt @@ -217,6 +217,7 @@ Emulator execution is possible as well. It can't be combined with remote execution though. EMULATOR: name of the emulator to use +EMULATOR_OPTS: pass the given options to the emulator Examples: diff --git a/tests/utils/dotest.pp b/tests/utils/dotest.pp index d66e1b29dd..9aa88073f0 100644 --- a/tests/utils/dotest.pp +++ b/tests/utils/dotest.pp @@ -112,6 +112,7 @@ const rquote : string = ''''; UseTimeout : boolean = false; emulatorname : string = ''; + EmulatorOpts : string = ''; TargetCanCompileLibraries : boolean = true; UniqueSuffix: string = ''; @@ -1314,7 +1315,7 @@ begin { Add -Ssource_file_name for dosbox_wrapper } if pos('dosbox_wrapper',EmulatorName)>0 then s:=s+' -S'+PPFile[current]; - execres:=ExecuteEmulated(EmulatorName,s,FullExeLogFile,StartTicks,EndTicks); + execres:=ExecuteEmulated(EmulatorName,EmulatorOpts+' '+s,FullExeLogFile,StartTicks,EndTicks); {$I-} ChDir(OldDir); {$I+} @@ -1543,30 +1544,31 @@ procedure getargs; writeln('dotest [Options] '); writeln; 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 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 set extension of temporary files (prevent conflicts with parallel invocations)'); - writeln(' -M run the tests using the given emulator'); - writeln(' -O use timeout wrapper for (remote) execution'); - writeln(' -P path to the tests tree on the remote machine'); - writeln(' -R run the tests remotely with the given rsh/ssh address'); - writeln(' -S use ssh instead of rsh'); - writeln(' -T[cpu-] 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 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 set extension of temporary files (prevent conflicts with parallel invocations)'); + writeln(' -M run the tests using the given emulator'); + writeln(' -N pass options to the emulator'); + writeln(' -O use timeout wrapper for (remote) execution'); + writeln(' -P path to the tests tree on the remote machine'); + writeln(' -R run the tests remotely with the given rsh/ssh address'); + writeln(' -S use ssh instead of rsh'); + writeln(' -T[cpu-] run tests for target cpu and os'); writeln(' -U'); - 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 extra options passed to the compiler. Several -Y 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 extra options passed to the compiler. Several -Y can be given.'); + writeln(' -Z remove temporary files (executable,ppu,o)'); halt(1); end; @@ -1630,6 +1632,8 @@ procedure getargs; 'M' : EmulatorName:=Para; + 'N' : EmulatorOpts:=Para; + 'O' : UseTimeout:=true; 'P' : RemotePath:=Para;