Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@@ -19,28 +19,20 @@ usage()
echo "usage: run-test [options]"
echo
echo "Input sources:"
echo " --coreclr-bins <location> Location of root of the binaries directory"
echo " containing the FreeBSD, Linux, NetBSD or OSX coreclr build"
echo " default: <repo_root>/bin/Product/<OS>.x64.<ConfigurationGroup>"
echo " --mscorlib-bins <location> Location of the root binaries directory containing"
echo " the FreeBSD, Linux, NetBSD or OSX mscorlib.dll"
echo " default: <repo_root>/bin/Product/<OS>.x64.<ConfigurationGroup>"
echo " --runtime <location> Location of root of the binaries directory"
echo " containing the FreeBSD, Linux, NetBSD or OSX runtime"
echo " default: <repo_root>/bin/testhost/netcoreapp-<OS>-<ConfigurationGroup>-<Arch>"
echo " --corefx-tests <location> Location of the root binaries location containing"
echo " the tests to run"
echo " default: <repo_root>/bin/tests"
echo " --corefx-native-bins <location> Location of the FreeBSD, Linux, NetBSD or OSX native corefx binaries"
echo " default: <repo_root>/bin/<OS>.x64.<ConfigurationGroup>"
echo " --corefx-packages <location> Location of the packages restored from NuGet."
echo " default: <repo_root>/packages"
echo " --testRelPath <path> Relative path to test script"
echo " Path is relative from the directory specified by project name"
echo " default: default.netcoreapp1.1"
echo " default: <repo_root>/bin"
echo
echo "Flavor/OS options:"
echo "Flavor/OS/Architecture options:"
echo " --configurationGroup <config> ConfigurationGroup to run (Debug/Release)"
echo " default: Debug"
echo " --os <os> OS to run (FreeBSD, Linux, NetBSD or OSX)"
echo " default: detect current OS"
echo " --arch <Architecture> Architecture to run (x64, arm, x86, arm64)"
echo " default: detect current architecture"
echo
echo "Execution options:"
echo " --sequential Run tests sequentially (default is to run in parallel)."
@@ -102,64 +94,49 @@ case $OSName in
OS=Linux
;;
esac
# Use uname to determine what the CPU is.
CPUName=$(uname -p)
# Some Linux platforms report unknown for platform, but the arch for machine.
if [ "$CPUName" == "unknown" ]; then
CPUName=$(uname -m)
fi
case $CPUName in
i686)
echo "Unsupported CPU $CPUName detected, test might not succeed!"
__Arch=x86
;;
x86_64)
__Arch=x64
;;
armv7l)
__Arch=arm
;;
aarch64)
__Arch=arm64
;;
*)
echo "Unknown CPU $CPUName detected, configuring as if for x64"
__Arch=x64
;;
esac
# Misc defaults
TestSelection=".*"
TestsFailed=0
# TestRelPath default
TestRelPath="default.netcoreapp1.1"
ensure_binaries_are_present()
{
local LowerConfigurationGroup="$(echo $ConfigurationGroup | awk '{print tolower($0)}')"
# Copy the CoreCLR native binaries
if [ ! -d $CoreClrBins ]
if [ ! -d $Runtime ]
then
echo "error: Coreclr $OS binaries not found at $CoreClrBins"
echo "error: Coreclr $OS binaries not found at $Runtime"
exit 1
fi
# Then the mscorlib from the upstream build.
# TODO When the mscorlib flavors get properly changed then
if [ ! -f $MscorlibBins/mscorlib.dll ]
then
echo "error: Mscorlib not found at $MscorlibBins"
exit 1
fi
# Then the native CoreFX binaries
if [ ! -d $CoreFxNativeBins ]
then
echo "error: Corefx native binaries should be built (use build.sh native in root)"
exit 1
fi
}
copy_test_overlay()
{
testDir=$1
link_files_in_directory "$CoreClrBins" "$testDir"
link_files_in_directory "$CoreFxNativeBins" "$testDir"
ln -f $MscorlibBins/mscorlib.dll $testDir/mscorlib.dll
# If we have a native image for mscorlib, copy it as well.
if [ -f $MscorlibBins/mscorlib.ni.dll ]
then
ln -f $MscorlibBins/mscorlib.ni.dll $testDir/mscorlib.ni.dll
fi
}
# $1 is the source directory
# $2 is the destination directory
link_files_in_directory()
{
for path in `find $1 -maxdepth 1 -type f`; do
fileName=`basename $path`
ln -f $path "$2/$fileName"
done
}
# $1 is the path of list file
@@ -220,25 +197,28 @@ run_test()
exit 0
fi
dirName="$1/$TestRelPath"
dirName="$1/netcoreapp"
if [ ! -d "$dirName" ]; then
echo "Nothing to test in $testProject"
exit 0
dirName="$1/netstandard"
if [ ! -d "$dirName" ]; then
echo "Nothing to test in $testProject"
return
fi
fi
copy_test_overlay $dirName
if [ ! -e "$dirName/RunTests.sh" ]; then
echo "Cannot find $dirName/RunTests.sh"
return
fi
pushd $dirName > /dev/null
chmod +x ./RunTests.sh
chmod +x ./corerun
echo
echo "Running tests in $dirName"
echo "./RunTests.sh $CoreFxPackages"
echo "./RunTests.sh $Runtime"
echo
./RunTests.sh "$CoreFxPackages"
./RunTests.sh "$Runtime"
exitCode=$?
if [ $exitCode -ne 0 ]
@@ -313,21 +293,12 @@ do
-h|--help)
usage
;;
--coreclr-bins)
CoreClrBins=$2
;;
--mscorlib-bins)
MscorlibBins=$2
--runtime)
Runtime=$2
;;
--corefx-tests)
CoreFxTests=$2
;;
--corefx-native-bins)
CoreFxNativeBins=$2
;;
--corefx-packages)
CoreFxPackages=$2
;;
--restrict-proj)
TestSelection=$2
;;
@@ -358,9 +329,6 @@ do
--test-dir-file)
TestDirFile=$2
;;
--testRelPath)
TestRelPath=$2
;;
--outerloop)
OuterLoop=""
;;
@@ -375,29 +343,14 @@ done
# Compute paths to the binaries if they haven't already been computed
if [ "$CoreClrBins" == "" ]
if [ "$Runtime" == "" ]
then
CoreClrBins="$ProjectRoot/bin/Product/$OS.x64.$ConfigurationGroup"
fi
if [ "$MscorlibBins" == "" ]
then
MscorlibBins="$ProjectRoot/bin/Product/$OS.x64.$ConfigurationGroup"
Runtime="$ProjectRoot/bin/testhost/netcoreapp-$OS-$ConfigurationGroup-$__Arch"
fi
if [ "$CoreFxTests" == "" ]
then
CoreFxTests="$ProjectRoot/bin/tests"
fi
if [ "$CoreFxNativeBins" == "" ]
then
CoreFxNativeBins="$ProjectRoot/bin/$OS.x64.$ConfigurationGroup/native"
fi
if [ "$CoreFxPackages" == "" ]
then
CoreFxPackages="$ProjectRoot/packages"
CoreFxTests="$ProjectRoot/bin"
fi
# Check parameters up front for valid values:
@@ -414,25 +367,6 @@ then
exit 1
fi
if [ "$CoreClrObjs" == "" ]
then
CoreClrObjs="$ProjectRoot/bin/obj/$OS.x64.$ConfigurationGroup"
fi
# The CI system shares PR build job definitions between RC2 and master. In RC2, we expected
# that CoreFxTests was the path to the root folder containing the tests for a specific platform
# (since all tests were rooted under a path like tests/Linux.AnyCPU.$ConfigurationGroup). In
# master, we instead want CoreFxTests to point at the root of the tests folder, since tests
# are now split across tests/AnyOS.AnyCPU.$ConfigruationGroup,
# tests/Unix.AnyCPU.$ConfigruationGroup and tests/$OS.AnyCPU.$ConfigurationGroup.
#
# Until we can split the CI definitions up, we need them to pass a platform specific folder (so
# the jobs work on RC2), so here we detect that case and use the parent folder instead.
if [[ `basename $CoreFxTests` =~ ^(Linux|OSX|FreeBSD|NetBSD) ]]
then
CoreFxTests=`dirname $CoreFxTests`
fi
export CORECLR_SERVER_GC="$serverGC"
export PAL_OUTPUTDEBUGSTRING="1"
@@ -463,9 +397,9 @@ if [ -n "$TestDirFile" ] || [ -n "$TestDir" ]
then
run_selected_tests
else
run_all_tests "$CoreFxTests/AnyOS.AnyCPU.$ConfigurationGroup/"*
run_all_tests "$CoreFxTests/Unix.AnyCPU.$ConfigurationGroup/"*
run_all_tests "$CoreFxTests/$OS.AnyCPU.$ConfigurationGroup/"*
run_all_tests "$CoreFxTests/AnyOS.AnyCPU.$ConfigurationGroup/"*.Tests
run_all_tests "$CoreFxTests/Unix.AnyCPU.$ConfigurationGroup/"*.Tests
run_all_tests "$CoreFxTests/$OS.AnyCPU.$ConfigurationGroup/"*.Tests
fi
if [ "$CoreClrCoverage" == "ON" ]