Enable jit disasm in test scripts
authorSven Boemer <sbomer@gmail.com>
Fri, 28 Oct 2016 19:55:57 +0000 (12:55 -0700)
committerSven Boemer <sbomer@gmail.com>
Mon, 21 Nov 2016 22:21:56 +0000 (14:21 -0800)
This change adds a section to the generated bash/cmd scripts for each
test that will run jit-dasm on the test dll when runtests is invoked
with the jitdasm flag.

Also begin updating netci.groovy to support jit-diff scenario.

Other minor fixes:
- Add corefxlab feed for System.CommandLine test dependency

  Without this, restoring the test dependencies retrieved an obsolete
  package of the same name from nuget.org.

- Skip jit-diff job generation for arm

  This fixes an assert that was checking that we are in the default
  scenario on arm.

- Fix an assert in netci.groovy

- Add branch that skips non-checked configurations for jitdiff scenario.

- Fix some dasm failures and a typo in dasm job name

- Some jit-dasm runs were failing because the dependencies in the
  current directory wasn't included in the arguments.

- Escape argument to jit-dasm

- increase timeout for jit-diff job

- Put PR job under a trigger, and some temporary changes for testing

- Make PR trigger look for comment

- Update Newtonsoft.Json version for compatibility with cijobs

- Update cijobs version for retrieving job by commit

- Temporarily run only one test

- Archive raw dasm output instead of zip

- Remove pr-specific logic, enable framework dasm

- Remove windows System.Private.CoreLib.ni.dll from test overlay

  The new test runtime dependencies were placing
  System.Private.CoreLib.ni.dll in the core_root directory, which resulted
  in the native image for windows being placed in the coreoverlay
  directory. We already had similar logic handling this case for
  mscorlib.ni.dll.

  This change also fixes the framework dasm output directory to match the
  test dasm output directory, and fixes some typos in the generated .sh
  files for running dasm on linux.

- Add dasm archiving on non-windows jobs

- Use core_root in bash scripts

netci.groovy
tests/dir.props
tests/runtest.cmd
tests/runtest.sh
tests/src/CLRTest.Execute.Bash.targets
tests/src/CLRTest.Execute.Batch.targets
tests/src/CLRTest.Jit.targets
tests/src/Common/test_dependencies/project.json
tests/src/Common/test_runtime/project.json
tests/src/dirs.proj

index 8550d19..a6809ea 100755 (executable)
@@ -77,7 +77,7 @@ class Constants {
                                         'r2r_jitstressregs4', 'r2r_jitstressregs8', 'r2r_jitstressregsx10', 'r2r_jitstressregsx80',
                                         'r2r_jitminopts', 'r2r_jitforcerelocs']
     // This is the basic set of scenarios
-    def static basicScenarios = ['default', 'pri1', 'ilrt', 'r2r', 'pri1r2r', 'gcstress15_pri1r2r', 'longgc', 'coverage', 'formatting', 'gcsimulator', 'standalone_gc'] + r2rJitStressScenarios
+    def static basicScenarios = ['default', 'pri1', 'ilrt', 'r2r', 'pri1r2r', 'gcstress15_pri1r2r', 'longgc', 'coverage', 'formatting', 'gcsimulator', 'jitdiff', 'standalone_gc'] + r2rJitStressScenarios
     def static configurationList = ['Debug', 'Checked', 'Release']
     // This is the set of architectures
     def static architectureList = ['arm', 'arm64', 'x64', 'x86ryujit', 'x86lb']
@@ -140,6 +140,10 @@ def static isLongGc(def scenario) {
     return (scenario == 'longgc' || scenario == 'gcsimulator')
 }
 
+def static isJitDiff(def scenario) {
+    return (scenario == 'jitdiff')
+}
+
 def static setTestJobTimeOut(newJob, scenario) {
     if (isGCStressRelatedTesting(scenario)) {
         Utilities.setJobTimeout(newJob, 4320)
@@ -159,6 +163,9 @@ def static setTestJobTimeOut(newJob, scenario) {
     else if (isLongGc(scenario)) {
         Utilities.setJobTimeout(newJob, 1440)
     }
+    else if (isJitDiff(scenario)) {
+        Utilities.setJobTimeout(newJob, 240)
+    }
     // Non-test jobs use the default timeout value.
 }
 
@@ -453,6 +460,12 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
                     }
                 }
                 break
+            case 'jitdiff':
+                assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX')
+                assert configuration == 'Checked'
+                assert (architecture == 'x64' || architecture == 'x86') 
+                Utilities.addGithubPushTrigger(job)
+                break
             case 'coverage':
                 assert (os == 'Ubuntu' || os == 'Windows_NT')
                 assert configuration == 'Release'
@@ -606,6 +619,11 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
                                 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
                             }
                             break
+                        case 'jitdiff':
+                            if (configuration == 'Checked') {
+                                Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
+                            }
+                            break
                         case 'ilrt':
                             if (configuration == 'Release') {
                                 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
@@ -883,6 +901,11 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
                                 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test")
                             }
                             break
+                        case 'jitdiff':
+                            if (configuration == 'Checked') {
+                                Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
+                            }
+                            break
                         case 'ilrt':
                             if (configuration == 'Release') {
                                 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
@@ -1580,7 +1603,7 @@ combinedScenarios.each { scenario ->
                         }
                     }
                     else {
-                        // If this is a r2r jitstress, jitstressregs, jitminopts or forcerelocs scenario
+                        // If this is a r2r jitstress, jitstressregs, jitminopts, or forcerelocs scenario
                         // and configuration is not Checked, bail out.
                         if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
                             return;
@@ -1614,6 +1637,17 @@ combinedScenarios.each { scenario ->
                                     return
                                 }
                                 break
+                            case 'jitdiff':
+                                if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX') {
+                                    return
+                                }
+                                if (architecture != 'x64' && architecture != 'x86') {
+                                    return
+                                }
+                                if (configuration != 'Checked') {
+                                    return
+                                }
+                                break
                             case 'r2r':
                                 // The r2r build isn't necessary except for Windows_NT.  Non-Windows NT uses
                                 // the default scenario build
@@ -1756,6 +1790,7 @@ combinedScenarios.each { scenario ->
                                     if (Constants.jitStressModeScenarios.containsKey(scenario) ||
                                             scenario == 'default' ||
                                             scenario == 'r2r' ||
+                                            scenario == 'jitdiff' ||
                                             Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
                                         buildOpts += enableCorefxTesting ? ' skiptests' : ''
                                         buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts}"
@@ -1803,6 +1838,7 @@ combinedScenarios.each { scenario ->
                                         def runjitstressregsStr = ''
                                         def runjitmioptsStr = ''
                                         def runjitforcerelocsStr = ''
+                                        def runjitdisasmStr = ''
                                         def gcstressStr = ''
                                         def runtestArguments = ''
                                         def gcTestArguments = ''
@@ -1853,11 +1889,16 @@ combinedScenarios.each { scenario ->
                                            gcstressStr = 'gcstresslevel 0xF'
                                         }
 
+                                        if (scenario == 'jitdiff')
+                                        {
+                                            runjitdisasmStr = 'jitdisasm crossgen'
+                                        }
+
                                         if (isLongGc(scenario)) {
                                             gcTestArguments = "${scenario} sequential"
                                         }
 
-                                        runtestArguments = "${lowerConfiguration} ${arch} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${gcTestArguments}"
+                                        runtestArguments = "${lowerConfiguration} ${arch} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${gcTestArguments}"
                                         if (Constants.jitStressModeScenarios.containsKey(scenario)) {
                                             if (enableCorefxTesting) {
                                                 // Sync to corefx repo
@@ -1906,16 +1947,22 @@ combinedScenarios.each { scenario ->
                                         buildCommands += "build.cmd ${lowerConfiguration} ${arch} linuxmscorlib"
                                         buildCommands += "build.cmd ${lowerConfiguration} ${arch} freebsdmscorlib"
                                         buildCommands += "build.cmd ${lowerConfiguration} ${arch} osxmscorlib"
-                                    
+
                                         // Zip up the tests directory so that we don't use so much space/time copying
                                         // 10s of thousands of files around.
                                         buildCommands += "powershell -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${arch}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
-                                        
-                                        if (!Constants.jitStressModeScenarios.containsKey(scenario)) {
+
+                                        if (!Constants.jitStressModeScenarios.containsKey(scenario) && scenario != 'jitdiff') {
                                             // For windows, pull full test results and test drops for x86/x64.
                                             // No need to pull for stress mode scenarios (downstream builds use the default scenario)
                                             Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip")
                                         }
+
+                                        if (scenario == 'jitdiff') {
+                                            // retrive jit-dasm output for base commit, and run jit-diff
+
+                                            Utilities.addArchival(newJob, "bin/tests/${osGroup}.${arch}.${configuration}/dasm/**")
+                                        }
                                         
                                         if (!isBuildOnly) {
                                             if (architecture == 'x64' || !isPR) {
@@ -2227,6 +2274,10 @@ combinedScenarios.each { scenario ->
                                     return
                                 }
                                 break
+                            case 'jitdiff':
+                                if (configuration != 'Checked') {
+                                    return;
+                                }
                             case 'r2r':
                                 //Skip configs that aren't Checked or Release (so just Debug, for now)
                                 if (configuration != 'Checked' && configuration != 'Release') {
@@ -2344,6 +2395,7 @@ combinedScenarios.each { scenario ->
                     def runjitstressregsStr = ''
                     def runjitmioptsStr = ''
                     def runjitforcerelocsStr = ''
+                    def runjitdisasmStr = ''
                     def gcstressStr = ''
 
                     if (scenario == 'r2r' ||
@@ -2392,6 +2444,11 @@ combinedScenarios.each { scenario ->
                         gcstressStr = '--gcstresslevel=0xF'
                     }
 
+                    if (scenario == 'jitdiff')
+                    {
+                        runjitdisasmStr = '--jitdisasm --crossgen'
+                    }
+                    
                     if (isLongGc(scenario)) {
                         // Long GC tests behave very poorly when they are not
                         // the only test running (many of them allocate until OOM).
@@ -2557,7 +2614,7 @@ combinedScenarios.each { scenario ->
                 --coreFxBinDir=\"\${WORKSPACE}/bin/${osGroup}.AnyCPU.Release;\${WORKSPACE}/bin/Unix.AnyCPU.Release;\${WORKSPACE}/bin/AnyOS.AnyCPU.Release\" \\
                 --coreFxNativeBinDir=\"\${WORKSPACE}/bin/${osGroup}.${architecture}.Release\" \\
                 --limitedDumpGeneration \\
-                ${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${sequentialString} ${playlistString}""")
+                ${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${sequentialString} ${playlistString}""")
                             }
                         }
                     }
@@ -2569,6 +2626,10 @@ combinedScenarios.each { scenario ->
                         // addEmailPublisher(newJob, 'clrcoverage@microsoft.com')
                     }
 
+                    if (scenario == 'jitdiff') {
+                        Utilities.addArchival(newJob, "bin/tests/${osGroup}.${architecture}.${configuration}/dasm/**")
+                    }
+
                     // Experimental: If on Ubuntu 14.04, then attempt to pull in crash dump links
                     if (os in ['Ubuntu']) {
                         SummaryBuilder summaries = new SummaryBuilder()
index 9d93e93..43026ca 100644 (file)
@@ -54,7 +54,8 @@
 
    <!-- list of nuget package sources passed to dnu --> 
    <ItemGroup> 
-     <!-- Need to escape double forward slash (%2F) or MSBuild will normalize to one slash on Unix. --> 
+     <!-- Need to escape double forward slash (%2F) or MSBuild will normalize to one slash on Unix. -->
+     <DnuSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json" />
      <DnuSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-core/api/v3/index.json" /> 
      <DnuSourceList Include="https:%2F%2Fapi.nuget.org/v3/index.json" /> 
    </ItemGroup> 
index a369c29..86ed0dd 100644 (file)
@@ -32,6 +32,7 @@ set __msbuildExtraArgs=
 set __LongGCTests=
 set __GCSimulatorTests=
 set __AgainstPackages=
+set __JitDisasm=
 
 :Arg_Loop
 if "%1" == "" goto ArgsDone
@@ -67,6 +68,7 @@ if /i "%1" == "jitstress"             (set COMPlus_JitStress=%2&shift&shift&goto
 if /i "%1" == "jitstressregs"         (set COMPlus_JitStressRegs=%2&shift&shift&goto Arg_Loop)
 if /i "%1" == "jitminopts"            (set COMPlus_JITMinOpts=1&shift&shift&goto Arg_Loop)
 if /i "%1" == "jitforcerelocs"        (set COMPlus_ForceRelocs=1&shift&shift&goto Arg_Loop)
+if /i "%1" == "jitdisasm"             (set __JitDisasm=1&shift&goto Arg_Loop)
 if /i "%1" == "GenerateLayoutOnly"    (set __GenerateLayoutOnly=1&set __SkipWrapperGeneration=true&shift&goto Arg_Loop)
 if /i "%1" == "PerfTests"             (set __PerfTests=true&set __SkipWrapperGeneration=true&shift&goto Arg_Loop)
 if /i "%1" == "runcrossgentests"      (set RunCrossGen=true&shift&goto Arg_Loop)
@@ -256,6 +258,8 @@ REM ============================================================================
 REM Compile the managed assemblies in Core_ROOT before running the tests
 :PrecompileAssembly
 
+if defined __JitDisasm goto :jitdisasm
+
 REM Skip mscorlib since it is already precompiled.
 if /I "%3" == "mscorlib.dll" exit /b 0
 if /I "%3" == "mscorlib.ni.dll" exit /b 0
@@ -275,6 +279,27 @@ if %__exitCode% neq 0 (
 echo Successfully precompiled %2
 exit /b 0
 
+:jitdisasm
+
+if /I "%3" == "mscorlib.ni.dll" exit /b 0
+
+echo "%1\corerun" "%1\jit-dasm.dll" --crossgen %1\crossgen.exe --platform %CORE_ROOT% --output %__TestWorkingDir%\dasm "%2"
+"%1\corerun" "%1\jit-dasm.dll" --crossgen %1\crossgen.exe --platform %CORE_ROOT% --output %__TestWorkingDir%\dasm "%2"
+set /a __exitCode = %errorlevel%
+
+if "%__exitCode%" == "-2146230517" (
+    echo %2 is not a managed assembly.
+    exit /b 0
+)
+
+if %__exitCode% neq 0 (
+    echo Unable to precompile %2
+    exit /b 0
+)
+
+echo Successfully precompiled and generated dasm for %2
+exit /b 0
+
 :PrecompileFX
 for %%F in (%CORE_ROOT%\*.dll) do call :PrecompileAssembly "%CORE_ROOT%" "%%F" %%~nF%%~xF
 exit /b 0
@@ -305,6 +330,7 @@ set __msbuildLogArgs=^
 set __msbuildArgs=%* %__msbuildCommonArgs% %__msbuildLogArgs%
 
 @REM The next line will overwrite the existing log file, if any.
+echo %_msbuildexe% %__msbuildArgs%
 echo Invoking: %_msbuildexe% %__msbuildArgs% > "%__BuildLog%"
 
 %_msbuildexe% %__msbuildArgs%
@@ -342,13 +368,23 @@ if defined __GCSimulatorTests (
     set RunningGCSimulatorTests=1
 )
 
+if defined __JitDisasm (
+    if defined __DoCrossgen (
+        echo Running jit disasm on framework and test assemblies
+    )
+    if not defined __DoCrossgen (
+       echo Running jit disasm on test assemblies only
+    )
+    set RunningJitDisasm=1
+)
+
 set __BuildLogRootName=Tests_GenerateRuntimeLayout
 call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:GenerateRuntimeLayout=true 
 if errorlevel 1 (
     echo Test Dependency Resolution Failed
     exit /b 1
 )
-echo %__MsgPrefix% Created the runtime layout with all dependencies in %CORE_ROOT%
+echo %__MsgPrefix%Created the runtime layout with all dependencies in %CORE_ROOT%
 exit /b 0
 
 
@@ -375,6 +411,7 @@ echo jitstress n        - Runs the tests with COMPlus_JitStress=n
 echo jitstressregs n    - Runs the tests with COMPlus_JitStressRegs=n
 echo jitminopts         - Runs the tests with COMPlus_JITMinOpts=1
 echo jitforcerelocs     - Runs the tests with COMPlus_ForceRelocs=1
+echo jitdisasm          - Runs jit-dasm on the tests
 echo gcstresslevel n    - Runs the tests with COMPlus_GCStress=n
 echo     0: None                                1: GC on all allocs and 'easy' places
 echo     2: GC on transitions to preemptive GC  4: GC on every allowable JITed instr
index df552be..51c0192 100755 (executable)
@@ -50,6 +50,7 @@ function print_usage {
     echo '  --jitstressregs=<n>              : Runs the tests with COMPlus_JitStressRegs=n'
     echo '  --jitminopts                     : Runs the tests with COMPlus_JITMinOpts=1'
     echo '  --jitforcerelocs                 : Runs the tests with COMPlus_ForceRelocs=1'
+    echo '  --jitdisasm                      : Runs jit-dasm on the tests'
     echo '  --gcstresslevel n                : Runs the tests with COMPlus_GCStress=n'
     echo '    0: None                                1: GC on all allocs and '"'easy'"' places'
     echo '    2: GC on transitions to preemptive GC  4: GC on every allowable JITed instr'
@@ -392,31 +393,43 @@ function create_core_overlay {
         # Test dependencies come from a Windows build, and mscorlib.ni.dll would be the one from Windows
         rm -f "$coreOverlayDir/mscorlib.ni.dll"
     fi
+    if [ -f "$coreOverlayDir/System.Private.CoreLib.ni.dll" ]; then
+        # Test dependencies come from a Windows build, and System.Private.CoreLib.ni.dll would be the one from Windows
+        rm -f "$coreOverlayDir/System.Private.CoreLib.ni.dll"
+    fi
     copy_test_native_bin_to_test_root
 }
 
 function precompile_overlay_assemblies {
 
     if [ $doCrossgen == 1 ]; then
-
         local overlayDir=$CORE_ROOT
 
         filesToPrecompile=$(ls -trh $overlayDir/*.dll)
         for fileToPrecompile in ${filesToPrecompile}
         do
             local filename=${fileToPrecompile}
-            # Precompile any assembly except mscorlib since we already have its NI image available.
-            if [[ "$filename" != *"mscorlib.dll"* ]]; then
-                if [[ "$filename" != *"mscorlib.ni.dll"* ]]; then
-                    echo Precompiling $filename
-                    $overlayDir/crossgen /Platform_Assemblies_Paths $overlayDir $filename 2>/dev/null
-                    local exitCode=$?
-                    if [ $exitCode == -2146230517 ]; then
-                        echo $filename is not a managed assembly.
-                    elif [ $exitCode != 0 ]; then
-                        echo Unable to precompile $filename.
-                    else
-                        echo Successfully precompiled $filename
+            if [ $jitdisasm == 1]; then
+
+                $overlayDir/corerun $overlayDir/jit-dasm.dll --crossgen $overlayDir/crossgen --platform $overlayDir --output $testRootDir/dasm $filename
+                local exitCode=$?
+                if [ $exitCode != 0 ]; then
+                    echo Unable to generate dasm for $filename
+                fi
+            else
+                # Precompile any assembly except mscorlib since we already have its NI image available.
+                if [[ "$filename" != *"mscorlib.dll"* ]]; then
+                    if [[ "$filename" != *"mscorlib.ni.dll"* ]]; then
+                        echo Precompiling $filename
+                        $overlayDir/crossgen /Platform_Assemblies_Paths $overlayDir $filename 2>/dev/null
+                        local exitCode=$?
+                        if [ $exitCode == -2146230517 ]; then
+                            echo $filename is not a managed assembly.
+                        elif [ $exitCode != 0 ]; then
+                            echo Unable to precompile $filename.
+                        else
+                            echo Successfully precompiled $filename
+                        fi
                     fi
                 fi
             fi
@@ -973,6 +986,7 @@ limitedCoreDumps=
 # Handle arguments
 verbose=0
 doCrossgen=0
+jitdisasm=0
 
 for i in "$@"
 do
@@ -999,6 +1013,9 @@ do
         --jitforcerelocs)
             export COMPlus_ForceRelocs=1
             ;;
+        --jitdisasm)
+            jitdisasm=1
+            ;;
         --testRootDir=*)
             testRootDir=${i#*=}
             ;;
@@ -1125,6 +1142,11 @@ if [ ! -z "$gcsimulator" ]; then
     export RunningGCSimulatorTests=1
 fi
 
+if [ ! -z "$jitdisasm" ]; then
+    echo "Running jit disasm"
+    export RunningJitDisasm=1
+fi
+
 # If this is a coverage run, make sure the appropriate args have been passed
 if [ "$CoreClrCoverage" == "ON" ]
 then
index e9c06ee..60270a1 100644 (file)
@@ -99,7 +99,7 @@ fi
   <Target Name="GenerateBashExecutionScript"
     Inputs="$(MSBuildProjectFullPath)"
     Outputs="$(OutputPath)\$(MSBuildProjectName).sh"
-    DependsOnTargets="FetchExternalPropertiesForXpalt;$(BashScriptSnippetGen);GetIlasmRoundTripBashScript">
+    DependsOnTargets="FetchExternalPropertiesForXpalt;$(BashScriptSnippetGen);GetJitDisasmBashScript;GetIlasmRoundTripBashScript">
 
     <Message Text="Project depends on $(_CLRTestToRunFileFullPath)." Condition="'$(_CLRTestNeedsProjectToRun)' == 'True'" />
 
@@ -307,6 +307,7 @@ $(BashEnvironmentVariables)
 $(BashCLRTestEnvironmentCompatibilityCheck)
 $(BashCLRTestArgPrep)
 $(BashCLRTestExitCodePrep)
+$(JitDisasmBashScript)
 # IlasmRoundTrip Script
 $(IlasmRoundTripBashScript)
 # PreCommands
index d118db7..5de78b4 100644 (file)
@@ -95,7 +95,7 @@ IF NOT "!ERRORLEVEL!"=="0" (
   <Target Name="GenerateBatchExecutionScript"
     Inputs="$(MSBuildProjectFullPath)"
     Outputs="$(OutputPath)\$(MSBuildProjectName).cmd"
-    DependsOnTargets="FetchExternalProperties;$(BatchScriptSnippetGen);GetIlasmRoundTripBatchScript">
+    DependsOnTargets="FetchExternalProperties;$(BatchScriptSnippetGen);GetJitDisasmBatchScript;GetIlasmRoundTripBatchScript">
 
     <Message Text="Project depends on $(_CLRTestToRunFileFullPath)." Condition="'$(_CLRTestNeedsProjectToRun)' == 'True'" />
 
@@ -327,6 +327,8 @@ $(BatchEnvironmentVariables)
 
 $(BatchCLRTestEnvironmentCompatibilityCheck)
 
+$(JitDisasmBatchScript)
+
 REM IlasmRoundTrip Script
 $(IlasmRoundTripBatchScript)
 
index c295634..4eb6327 100644 (file)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 
 <!--
 ***********************************************************************************************
@@ -18,18 +19,68 @@ WARNING:   When setting properties based on their current state (for example:
 ***********************************************************************************************
 -->
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-   <PropertyGroup Condition="$(RunWithGcStress) != ''" >
-      <CLRTestBatchPreCommands>
+
+  <Target Name="GetJitDisasmBashScript"
+          Returns="$(JitDisasmBashScript)">
+    <PropertyGroup>
+      <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/"))</InputAssemblyName>
+      <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName>
+      <JitDisasmOut>$(BaseOutputPathWithConfig.Replace("\","/"))dasm/$(BuildProjectRelativeDir.Replace("\","/"))</JitDisasmOut>
+      <JitDisasmBashScript>
+<![CDATA[
+# JitDisasm Script
+if [ ! -z $RunningJitDisasm ]
+then
+    echo $CORE_ROOT/corerun "$CORE_ROOT/jit-dasm.dll" --crossgen $CORE_ROOT/crossgen.exe --platform $CORE_ROOT --output $(JitDisasmOut) $(InputAssemblyName)
+    "$CORE_ROOT/corerun" "$CORE_ROOT/jit-dasm" --crossgen $CORE_ROOT/crossgen.exe --platform $CORE_ROOT --output $(JitDisasmOut) $(InputAssemblyName)
+    if [ $ERRORLEVEL -ne 0 ]
+    then
+        echo EXECUTION OF JIT-DASM - FAILED $ERRORLEVEL
+        exit 1
+    fi
+fi
+]]>
+      </JitDisasmBashScript>
+    </PropertyGroup>
+  </Target>
+
+  <Target Name="GetJitDisasmBatchScript"
+          Returns="$(JitDisasmBatchScript)">
+    <PropertyGroup>
+      <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)))</InputAssemblyName>
+      <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName>
+      <JitDisasmOut>$(BaseOutputPathWithConfig)dasm\$(BuildProjectRelativeDir)</JitDisasmOut>
+      <JitDisasmBatchScript>
+<![CDATA[
+REM JitDisasm Script
+if defined RunningJitDisasm (
+  echo %CORE_ROOT%\corerun %CORE_ROOT%\jit-dasm.dll --crossgen %CORE_ROOT%/crossgen.exe --platform %CORE_ROOT%%3B%25cd%25 --output $(JitDisasmOut) $(InputAssemblyName)
+  %CORE_ROOT%\corerun %CORE_ROOT%\jit-dasm.dll --crossgen %CORE_ROOT%/crossgen.exe --platform %CORE_ROOT%%3B%25cd%25 --output $(JitDisasmOut) $(InputAssemblyName)
+  IF NOT "!ERRORLEVEL!"=="0" (
+    ECHO EXECUTION OF JIT-DASM - FAILED !ERRORLEVEL!
+    Exit /b 1
+  )
+  Exit /b 0
+)
+    ]]>
+      </JitDisasmBatchScript>
+    </PropertyGroup>
+  </Target>
+  
+  <PropertyGroup Condition="$(RunWithGcStress) != ''" >
+    <CLRTestBatchPreCommands>
 <![CDATA[
       $(CLRTestBatchPreCommands)
 set COMPlus_GCStress=$(RunWithGcStress)
     ]]>
-      </CLRTestBatchPreCommands>
-      <BashCLRTestPreCommands>
+    </CLRTestBatchPreCommands>
+    <BashCLRTestPreCommands>
 <![CDATA[
       $(BashCLRTestPreCommands)
 export COMPlus_GCStress=$(RunWithGcStress)
     ]]>
-     </BashCLRTestPreCommands>
-   </PropertyGroup>
+    </BashCLRTestPreCommands>
+  </PropertyGroup>
+
+
 </Project> 
index 918b5d7..9844788 100644 (file)
@@ -8,7 +8,7 @@
     "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0040",
     "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0040",
     "Microsoft.Win32.Primitives": "4.4.0-beta-24710-01",
-    "Newtonsoft.Json": "7.0.1",
+    "Newtonsoft.Json": "8.0.3",
     "Microsoft.NETCore.Platforms": "1.2.0-beta-24710-01",
     "Microsoft.NETCore.Targets": "1.2.0-beta-24710-01",
     "System.Collections.Immutable": "1.4.0-beta-24710-01",
index 0e718d9..2c7c15f 100644 (file)
@@ -1,6 +1,9 @@
 {
   "dependencies": {
     "Microsoft.DotNet.CoreCLR.TestDependencies": "1.0.0-prerelease",
+    "jit-dasm": "0.0.1.1",
+    "cijobs": "0.0.1.2",
+    "jit-analyze": "0.0.1.0"
   },
   "frameworks": {
     "netcoreapp1.1": {
index 99a50a4..bb79302 100644 (file)
     </ItemGroup>
     
     <ItemGroup>
-      <Project Include="*\**\*.csproj" Exclude="@(DisabledProjects)">
+      <Project Include="JIT\RyuJit\DoWhileBndChk.csproj" Exclude="@(DisabledProjects)">
         <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
       </Project>
-      <Project Include="*\**\*.ilproj" Exclude="@(DisabledProjects)">
+
+<!--      <Project Include="JIT\**\*.csproj" Exclude="@(DisabledProjects)">
+        <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+      </Project>
+      -->
+      <!--
+          <Project Include="*\**\*.csproj" Exclude="@(DisabledProjects)">
         <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
       </Project>
+      <Project Include="*\**\*.ilproj" Exclude="@(DisabledProjects)">
+        <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+        </Project>
+        -->
     </ItemGroup>
   </Target>