Skip to content

Commit

Permalink
Fix script errors in mainv1, mainv2 tests (dotnet#1997)
Browse files Browse the repository at this point in the history
* Add additional error checking for mainv1, mainv2 tests

These have been silently failing due to mainv1.exe and mainv2.exe
changing to be built at mainv1.dll and mainv2.dll without
corresponding changes in the project files, due to insufficient
testing in the script.

Add this additional testing.

* Add more error checking

* Fix script errors in mainv1, mainv2 tests

A while back, tests were changed from building .exe to building .dll files
but these were not updated. Fix that.
  • Loading branch information
BruceForstall authored Jan 22, 2020
1 parent e686c07 commit 0dcdbac
Show file tree
Hide file tree
Showing 2 changed files with 178 additions and 5 deletions.
82 changes: 80 additions & 2 deletions src/coreclr/tests/src/readytorun/tests/mainv1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,96 @@
<CLRTestBatchPreCommands><![CDATA[
$(CLRTestBatchPreCommands)
DEL test.dll
if exist test.dll (
echo FAILED to delete test.dll
exit /b 1
)
COPY /Y ..\testv1\test\test.dll test.dll
if not exist test.dll (
echo FAILED to copy test.dll
exit /b 1
)
%Core_Root%\crossgen /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out test.ni.dll test.dll
set CrossGenStatus=!ERRORLEVEL!
IF NOT !CrossGenStatus!==0 (
ECHO Crossgen failed with exitcode - !CrossGenStatus!
Exit /b 1
)
if not exist test.ni.dll (
echo FAILED to build test.ni.dll
exit /b 1
)
%Core_Root%\crossgen /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out fieldgetter.ni.dll fieldgetter.dll
%Core_Root%\crossgen /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out mainv1.ni.exe mainv1.exe
set CrossGenStatus=!ERRORLEVEL!
IF NOT !CrossGenStatus!==0 (
ECHO Crossgen failed with exitcode - !CrossGenStatus!
Exit /b 1
)
if not exist fieldgetter.ni.dll (
echo FAILED to build fieldgetter.ni.dll
exit /b 1
)
%Core_Root%\crossgen /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out mainv1.ni.dll mainv1.dll
set CrossGenStatus=!ERRORLEVEL!
IF NOT !CrossGenStatus!==0 (
ECHO Crossgen failed with exitcode - !CrossGenStatus!
Exit /b 1
)
if not exist mainv1.ni.dll (
echo FAILED to build mainv1.ni.dll
exit /b 1
)
]]></CLRTestBatchPreCommands>
<BashCLRTestPreCommands><![CDATA[
$(BashCLRTestPreCommands)
rm -f test.dll
if [ -f test.dll ]
then
echo Failed to delete test.dll
exit 1
fi
cp ../testv1/test/test.dll test.dll
if [ ! -f test.dll ]
then
echo Failed to copy test.dll
exit 1
fi
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out test.ni.dll test.dll
__cgExitCode=$?
if [ $__cgExitCode -ne 0 ]
then
echo Crossgen failed with exitcode: $__cgExitCode
exit 1
fi
if [ ! -f test.ni.dll ]
then
echo Failed to build test.ni.dll
exit 1
fi
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out fieldgetter.ni.dll fieldgetter.dll
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out mainv1.ni.exe mainv1.exe
__cgExitCode=$?
if [ $__cgExitCode -ne 0 ]
then
echo Crossgen failed with exitcode: $__cgExitCode
exit 1
fi
if [ ! -f fieldgetter.ni.dll ]
then
echo Failed to build fieldgetter.ni.dll
exit 1
fi
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out mainv1.ni.dll mainv1.dll
__cgExitCode=$?
if [ $__cgExitCode -ne 0 ]
then
echo Crossgen failed with exitcode: $__cgExitCode
exit 1
fi
if [ ! -f mainv1.ni.dll ]
then
echo Failed to build mainv1.ni.dll
exit 1
fi
]]></BashCLRTestPreCommands>
</PropertyGroup>
</Project>
101 changes: 98 additions & 3 deletions src/coreclr/tests/src/readytorun/tests/mainv2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,118 @@
<CLRTestBatchPreCommands><![CDATA[
$(CLRTestBatchPreCommands)
DEL test.dll
if exist test.dll (
echo FAILED to delete test.dll
exit /b 1
)
COPY /Y ..\testv1\test\test.dll test.dll
%Core_Root%\crossgen /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out mainv2.ni.exe mainv2.exe
if not exist test.dll (
echo FAILED to copy test.dll
exit /b 1
)
%Core_Root%\crossgen /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out mainv2.ni.dll mainv2.dll
set CrossGenStatus=!ERRORLEVEL!
IF NOT !CrossGenStatus!==0 (
ECHO Crossgen failed with exitcode - !CrossGenStatus!
Exit /b 1
)
if not exist mainv2.ni.dll (
echo FAILED to build mainv2.ni.dll
exit /b 1
)
%Core_Root%\crossgen /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out fieldgetter.ni.dll fieldgetter.dll
set CrossGenStatus=!ERRORLEVEL!
IF NOT !CrossGenStatus!==0 (
ECHO Crossgen failed with exitcode - !CrossGenStatus!
Exit /b 1
)
if not exist fieldgetter.ni.dll (
echo FAILED to build fieldgetter.ni.dll
exit /b 1
)
DEL test.dll
if exist test.dll (
echo FAILED to delete test.dll
exit /b 1
)
COPY /Y ..\testv2\test\test.dll test.dll
if not exist test.dll (
echo FAILED to copy test.dll
exit /b 1
)
%Core_Root%\crossgen /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out test.ni.dll test.dll
set CrossGenStatus=!ERRORLEVEL!
IF NOT !CrossGenStatus!==0 (
ECHO Crossgen failed with exitcode - !CrossGenStatus!
Exit /b 1
)
if not exist test.ni.dll (
echo FAILED to build test.ni.dll
exit /b 1
)
]]></CLRTestBatchPreCommands>
<BashCLRTestPreCommands><![CDATA[
$(BashCLRTestPreCommands)
rm -f test.dll
if [ -f test.dll ]
then
echo Failed to delete test.dll
exit 1
fi
cp ../testv1/test/test.dll test.dll
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out mainv2.ni.exe mainv2.exe
if [ ! -f test.dll ]
then
echo Failed to copy test.dll
exit 1
fi
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out mainv2.ni.dll mainv2.dll
__cgExitCode=$?
if [ $__cgExitCode -ne 0 ]
then
echo Crossgen failed with exitcode: $__cgExitCode
exit 1
fi
if [ ! -f mainv2.ni.dll ]
then
echo Failed to build mainv2.ni.dll
exit 1
fi
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out fieldgetter.ni.dll fieldgetter.dll
__cgExitCode=$?
if [ $__cgExitCode -ne 0 ]
then
echo Crossgen failed with exitcode: $__cgExitCode
exit 1
fi
if [ ! -f fieldgetter.ni.dll ]
then
echo Failed to build fieldgetter.ni.dll
exit 1
fi
rm -f test.dll
if [ -f test.dll ]
then
echo Failed to delete test.dll
exit 1
fi
cp ../testv2/test/test.dll test.dll
if [ ! -f test.dll ]
then
echo Failed to copy test.dll
exit 1
fi
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out test.ni.dll test.dll
__cgExitCode=$?
if [ $__cgExitCode -ne 0 ]
then
echo Crossgen failed with exitcode: $__cgExitCode
exit 1
fi
if [ ! -f test.ni.dll ]
then
echo Failed to build test.ni.dll
exit 1
fi
]]></BashCLRTestPreCommands>
</PropertyGroup>
</Project>

0 comments on commit 0dcdbac

Please sign in to comment.