@@ -46,7 +46,6 @@ function print_usage {
46
46
echo ' --useServerGC : Enable server GC for this test run'
47
47
echo ' --test-env : Script to set environment variables for tests'
48
48
echo ' --runcrossgentests : Runs the ready to run tests'
49
- echo ' '
50
49
echo ' --jitstress=<n> : Runs the tests with COMPlus_JitStress=n'
51
50
echo ' --jitstressregs=<n> : Runs the tests with COMPlus_JitStressRegs=n'
52
51
echo ' --jitminopts : Runs the tests with COMPlus_JITMinOpts=1'
@@ -55,6 +54,8 @@ function print_usage {
55
54
echo ' 0: None 1: GC on all allocs and ' easy' places'
56
55
echo ' 2: GC on transitions to preemptive GC 4: GC on every allowable JITed instr'
57
56
echo ' 8: GC on every allowable NGEN instr 16: GC only on a unique stack trace'
57
+ echo ' --show-time : Print execution sequence and running time for each test'
58
+ echo ' --no-lf-conversion : Do not execute LF conversion before running test script'
58
59
echo ' '
59
60
echo ' Runtime Code Coverage options:'
60
61
echo ' --coreclr-coverage : Optional argument to get coreclr code coverage reports'
@@ -381,9 +382,9 @@ function create_core_overlay {
381
382
function precompile_overlay_assemblies {
382
383
383
384
if [ $doCrossgen == 1 ]; then
384
-
385
+
385
386
local overlayDir=$CORE_ROOT
386
-
387
+
387
388
filesToPrecompile=$( ls -trh $overlayDir /* .dll)
388
389
for fileToPrecompile in ${filesToPrecompile}
389
390
do
@@ -395,7 +396,7 @@ function precompile_overlay_assemblies {
395
396
$overlayDir /crossgen /Platform_Assemblies_Paths $overlayDir $filename 2> /dev/null
396
397
local exitCode=$?
397
398
if [ $exitCode == -2146230517 ]; then
398
- echo $filename is not a managed assembly.
399
+ echo $filename is not a managed assembly.
399
400
elif [ $exitCode != 0 ]; then
400
401
echo Unable to precompile $filename .
401
402
else
@@ -406,7 +407,7 @@ function precompile_overlay_assemblies {
406
407
done
407
408
else
408
409
echo Skipping crossgen of FX assemblies.
409
- fi
410
+ fi
410
411
}
411
412
412
413
function copy_test_native_bin_to_test_root {
554
555
declare -a scriptFilePaths
555
556
declare -a outputFilePaths
556
557
declare -a processIds
558
+ declare -a testStartTimes
557
559
558
560
function finish_test {
559
561
wait ${processIds[$nextProcessIndex]}
@@ -564,26 +566,36 @@ function finish_test {
564
566
local outputFilePath=${outputFilePaths[$nextProcessIndex]}
565
567
local scriptFileName=$( basename " $scriptFilePath " )
566
568
569
+ local testEndTime=
570
+ local testRunningTime=
571
+ local header=
572
+
573
+ if [ " $showTime " == " ON" ]; then
574
+ testEndTime=$( date +%s)
575
+ testRunningTime=$( echo " $testEndTime - ${testStartTimes[$nextProcessIndex]} " | bc)
576
+ header=$( printf " [%03d:%4.0fs] " " $countTotalTests " " $testRunningTime " )
577
+ fi
578
+
567
579
local xunitTestResult
568
580
case $testScriptExitCode in
569
581
0)
570
582
let countPassedTests++
571
583
xunitTestResult=' Pass'
572
584
if (( verbose == 1 || runFailingTestsOnly == 1 )) ; then
573
- echo " PASSED - $scriptFilePath "
585
+ echo " PASSED - ${header}${ scriptFilePath} "
574
586
else
575
- echo " - $scriptFilePath "
587
+ echo " - ${header}${ scriptFilePath} "
576
588
fi
577
589
;;
578
590
2)
579
591
let countSkippedTests++
580
592
xunitTestResult=' Skip'
581
- echo " SKIPPED - $scriptFilePath "
593
+ echo " SKIPPED - ${header}${ scriptFilePath} "
582
594
;;
583
595
* )
584
596
let countFailedTests++
585
597
xunitTestResult=' Fail'
586
- echo " FAILED - $scriptFilePath "
598
+ echo " FAILED - ${header}${ scriptFilePath} "
587
599
;;
588
600
esac
589
601
let countTotalTests++
@@ -614,9 +626,11 @@ function prep_test {
614
626
615
627
test " $verbose " == 1 && echo " Preparing $scriptFilePath "
616
628
617
- # Convert DOS line endings to Unix if needed
618
- perl -pi -e ' s/\r\n|\n|\r/\n/g' " $scriptFilePath "
619
-
629
+ if [ ! " $noLFConversion " == " ON" ]; then
630
+ # Convert DOS line endings to Unix if needed
631
+ perl -pi -e ' s/\r\n|\n|\r/\n/g' " $scriptFilePath "
632
+ fi
633
+
620
634
# Add executable file mode bit if needed
621
635
chmod +x " $scriptFilePath "
622
636
@@ -630,7 +644,7 @@ function start_test {
630
644
if (( runFailingTestsOnly == 1 )) && ! is_failing_test " $scriptFilePath " ; then
631
645
return
632
646
fi
633
-
647
+
634
648
# Skip any test that's not in the current playlist, if a playlist was
635
649
# given to us.
636
650
if [ -n " $playlistFile " ] && ! is_playlist_test " $scriptFilePath " ; then
@@ -646,6 +660,10 @@ function start_test {
646
660
local outputFilePath=$( dirname " $scriptFilePath " ) /${scriptFileName} .out
647
661
outputFilePaths[$nextProcessIndex ]=$outputFilePath
648
662
663
+ if [ " $showTime " == " ON" ]; then
664
+ testStartTimes[$nextProcessIndex ]=$( date +%s)
665
+ fi
666
+
649
667
test " $verbose " == 1 && echo " Starting $scriptFilePath "
650
668
if is_unsupported_test " $scriptFilePath " ; then
651
669
skip_unsupported_test " $scriptFilePath " " $outputFilePath " &
@@ -742,6 +760,8 @@ coreClrSrc=
742
760
coverageOutputDir=
743
761
testEnv=
744
762
playlistFile=
763
+ showTime=
764
+ noLFConversion=
745
765
746
766
(( disableEventLogging = 0 ))
747
767
(( serverGC = 0 ))
838
858
--gcstresslevel=* )
839
859
export COMPlus_GCStress=${i#* =}
840
860
;;
861
+ --show-time)
862
+ showTime=ON
863
+ ;;
864
+ --no-lf-conversion)
865
+ noLFConversion=ON
866
+ ;;
841
867
* )
842
868
echo " Unknown switch: $i "
843
869
print_usage
@@ -868,7 +894,7 @@ if [ -z "$mscorlibDir" ]; then
868
894
mscorlibDir=$coreClrBinDir
869
895
fi
870
896
if [ -d $mscorlibDir /bin ]; then
871
- cp $mscorlibDir /bin/* $mscorlibDir
897
+ cp $mscorlibDir /bin/* $mscorlibDir
872
898
fi
873
899
874
900
# If this is a coverage run, make sure the appropriate args have been passed
@@ -928,7 +954,7 @@ cd "$testRootDir"
928
954
time_start=$( date +" %s" )
929
955
if [ -z " $testDirectories " ]
930
956
then
931
- # No test directories were specified, so run everything in the current
957
+ # No test directories were specified, so run everything in the current
932
958
# directory and its subdirectories.
933
959
run_tests_in_directory " ."
934
960
else
0 commit comments