Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions src/tests/run.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ set __LongGCTests=
set __GCSimulatorTests=
set __IlasmRoundTrip=
set __PrintLastResultsOnly=
set __Verbose=
set __LimitedCoreDumps=
set LogsDirArg=
set RunInUnloadableContext=
set TieringTest=
Expand Down Expand Up @@ -65,8 +67,8 @@ if /i "%1" == "jitforcerelocs" (set DOTNET_ForceRelocs=
if /i "%1" == "printlastresultsonly" (set __PrintLastResultsOnly=1&shift&goto Arg_Loop)
if /i "%1" == "logsdir" (set LogsDirArg=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "runcrossgen2tests" (set RunCrossGen2=1&shift&goto Arg_Loop)
REM This test feature is currently intentionally undocumented
if /i "%1" == "runlargeversionbubblecrossgen2tests" (set RunCrossGen2=1&set CrossgenLargeVersionBubble=1&shift&goto Arg_Loop)
if /i "%1" == "composite" (set __CompositeBuildMode=1&shift&goto Arg_Loop)
if /i "%1" == "synthesizepgo" (set CrossGen2SynthesizePgo=1&shift&goto Arg_Loop)
if /i "%1" == "gcname" (set DOTNET_GCName=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "gcstresslevel" (set DOTNET_GCStress=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
Expand All @@ -79,6 +81,8 @@ if /i "%1" == "tieringtest" (set TieringTest=1&shift
if /i "%1" == "runnativeaottests" (set RunNativeAot=1&shift&goto Arg_Loop)
if /i "%1" == "interpreter" (set RunInterpreter=1&shift&goto Arg_Loop)
if /i "%1" == "node" (set RunWithNodeJS=1&shift&goto Arg_Loop)
if /i "%1" == "verbose" (set __Verbose=1&shift&goto Arg_Loop)
if /i "%1" == "limiteddumpgeneration" (set __LimitedCoreDumps=1&shift&goto Arg_Loop)

if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs
:: All the rest of the args will be collected and passed directly to msbuild.
Expand Down Expand Up @@ -167,6 +171,10 @@ if defined CrossgenLargeVersionBubble (
set __RuntestPyArgs=%__RuntestPyArgs% --large_version_bubble
)

if defined __CompositeBuildMode (
set __RuntestPyArgs=%__RuntestPyArgs% --composite
)

if defined CrossGen2SynthesizePgo (
set __RuntestPyArgs=%__RuntestPyArgs% --synthesize_pgo
)
Expand Down Expand Up @@ -195,6 +203,14 @@ if defined RunWithNodeJS (
set __RuntestPyArgs=%__RuntestPyArgs% --node
)

if defined __Verbose (
set __RuntestPyArgs=%__RuntestPyArgs% --verbose
)

if defined __LimitedCoreDumps (
set __RuntestPyArgs=%__RuntestPyArgs% --limited_core_dumps
)

REM Find python and set it to the variable PYTHON
set _C=-c "import sys; sys.stdout.write(sys.executable)"
(py -3 %_C% || py -2 %_C% || python3 %_C% || python2 %_C% || python %_C%) > %TEMP%\pythonlocation.txt 2> NUL
Expand Down Expand Up @@ -235,6 +251,8 @@ echo TestEnv ^<test_env_script^> - Run a custom script before every test to set
echo sequential - Run tests sequentially ^(no parallelism^).
echo parallel ^<type^> - Run tests with given level of parallelism: none, collections, assemblies, all. Default: collections.
echo RunCrossgen2Tests - Runs ReadytoRun tests compiled with Crossgen2
echo runlargeversionbubblecrossgen2tests - ^(Experimental^) Runs Crossgen2 tests with large version bubble enabled.
echo composite - ^(Experimental^) Use Crossgen2 composite mode for tests.
echo synthesizepgo - Enabled synthesizing PGO data in CrossGen2
echo jitstress ^<n^> - Runs the tests with DOTNET_JitStress=n
echo jitstressregs ^<n^> - Runs the tests with DOTNET_JitStressRegs=n
Expand All @@ -259,8 +277,12 @@ echo Note: some options override this ^(gcstressleve
echo logsdir ^<dir^> - Specify the logs directory ^(default: artifacts/log^)
echo msbuildargs ^<args...^> - Pass all subsequent args directly to msbuild invocations.
echo ^<CORE_ROOT^> - Path to the runtime to test ^(if specified^).
echo tieringtest - Run each test to encourage tier1 rejitting.
echo runnativeaottests - Run NativeAOT compiled tests.
echo interpreter - Runs the tests with the interpreter enabled.
echo node - Runs the tests with NodeJS ^(wasm only^).
echo node - Runs the tests with NodeJS ^(wasm only^).
echo verbose - Enable verbose output ^(show output from each test^).
echo limitedDumpGeneration - Limits the number of core dumps generated for this test run.
echo.
echo Note that arguments are not case-sensitive.
echo.
Expand Down
10 changes: 10 additions & 0 deletions src/tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
parser.add_argument("--ilasmroundtrip", dest="ilasmroundtrip", action="store_true", default=False)
parser.add_argument("--run_crossgen2_tests", dest="run_crossgen2_tests", action="store_true", default=False)
parser.add_argument("--large_version_bubble", dest="large_version_bubble", action="store_true", default=False)
parser.add_argument("--composite", dest="composite", action="store_true", default=False)
parser.add_argument("--synthesize_pgo", dest="synthesize_pgo", action="store_true", default=False)
parser.add_argument("--sequential", dest="sequential", action="store_true", default=False)
parser.add_argument("--interpreter", dest="interpreter", action="store_true", default=False)
Expand Down Expand Up @@ -834,6 +835,10 @@ def run_tests(args,
print("Large Version Bubble enabled")
os.environ["LargeVersionBubble"] = "1"

if args.composite:
print("Composite Crossgen2 mode enabled")
os.environ["CompositeBuildMode"] = "1"

if args.synthesize_pgo:
print("Synthesizing PGO")
os.environ["CrossGen2SynthesizePgo"] = "1"
Expand Down Expand Up @@ -979,6 +984,11 @@ def setup_args(args):
lambda arg: True,
"Error setting large_version_bubble")

coreclr_setup_args.verify(args,
"composite",
lambda arg: True,
"Error setting composite")

coreclr_setup_args.verify(args,
"run_crossgen2_tests",
lambda unused: True,
Expand Down
32 changes: 30 additions & 2 deletions src/tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ function print_usage {
echo ' --coreRootDir=<path> : Directory to the CORE_ROOT location.'
echo ' --enableEventLogging : Enable event logging through LTTNG.'
echo ' --sequential : Run tests sequentially (default is to run in parallel).'
echo ' --parallel=<type> : Run tests in parallel (none, collections, assemblies, all) (default: collections).'
echo ' --runcrossgen2tests : Runs the ReadyToRun tests compiled with Crossgen2'
echo ' --runlargeversionbubblecrossgen2tests : (Experimental) Runs Crossgen2 tests with large version bubble enabled'
echo ' --composite : (Experimental) Use Crossgen2 composite mode for tests'
echo ' --synthesizepgo : Runs the tests allowing crossgen2 to synthesize PGO data'
echo ' --jitstress=<n> : Runs the tests with DOTNET_JitStress=n'
echo ' --jitstressregs=<n> : Runs the tests with DOTNET_JitStressRegs=n'
Expand All @@ -43,7 +46,7 @@ function print_usage {
echo ' --runnativeaottests : Run NativeAOT compiled tests'
echo ' --interpreter : Runs the tests with the interpreter enabled'
echo ' --node : Runs the tests with NodeJS (wasm only)'
echo ' --limitedDumpGeneration : '
echo ' --limitedDumpGeneration : Limits the number of core dumps generated for this test run'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Don't we need largeversionbubblecrossgen2tests here too? And I don't think Composite mode is in run.py, but is in the test runners via an environment variable. We should add it to run.py and run.sh and run.cmd.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9f41b7c:

  • Added --runlargeversionbubblecrossgen2tests to run.sh (argument parsing, help menu, forwarding --run_crossgen2_tests + --large_version_bubble to run.py)
  • Added --composite to run.py (sets CompositeBuildMode=1 env var, matching helixpublishwitharcade.proj)
  • Added --composite to run.sh and composite to run.cmd (both forward --composite to run.py)
  • All three entries documented in their respective help menus as (Experimental)

}

# Exit code constants
Expand All @@ -70,9 +73,12 @@ verbose=0
ilasmroundtrip=
printLastResultsOnly=
runSequential=0
parallelType=
runincontext=0
tieringtest=0
nativeaottest=0
largeversionbubble=0
compositemode=0

for i in "$@"
do
Expand Down Expand Up @@ -153,12 +159,22 @@ do
--runcrossgen2tests)
export RunCrossGen2=1
;;
--runlargeversionbubblecrossgen2tests)
export RunCrossGen2=1
largeversionbubble=1
;;
--composite)
compositemode=1
;;
--synthesizepgo)
export CrossGen2SynthesizePgo=1
;;
--sequential)
runSequential=1
;;
--parallel=*)
parallelType=${i#*=}
;;
--useServerGC)
export DOTNET_gcServer=1
;;
Expand Down Expand Up @@ -275,6 +291,10 @@ if [ "$runSequential" -ne 0 ]; then
runtestPyArguments+=("--sequential")
fi

if [[ -n "$parallelType" ]]; then
runtestPyArguments+=("-parallel" "$parallelType")
fi

if [[ -n "$printLastResultsOnly" ]]; then
runtestPyArguments+=("--analyze_results_only")
fi
Expand All @@ -283,6 +303,14 @@ if [[ -n "$RunCrossGen2" ]]; then
runtestPyArguments+=("--run_crossgen2_tests")
fi

if [[ "$largeversionbubble" -ne 0 ]]; then
runtestPyArguments+=("--large_version_bubble")
fi

if [[ "$compositemode" -ne 0 ]]; then
runtestPyArguments+=("--composite")
fi

if [[ -n "$CrossGen2SynthesizePgo" ]]; then
runtestPyArguments+=("--synthesize_pgo")
fi
Expand All @@ -298,7 +326,7 @@ fi

if [[ "$tieringtest" -ne 0 ]]; then
echo "Running to encourage tier1 rejitting"
runtestPyArguments+=("--tieringtest")
runtestPyArguments+=("--tiering_test")
fi

if [[ "$nativeaottest" -ne 0 ]]; then
Expand Down