mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-11 10:18:21 +09:00
Move runtests to eng and fix invocation (dotnet/corefx#37754)
Commit migrated from 26195605c3
This commit is contained in:
parent
4606120376
commit
eea18e398c
1 changed files with 14 additions and 96 deletions
110
src/libraries/run-test.sh → eng/run-test.sh
Executable file → Normal file
110
src/libraries/run-test.sh → eng/run-test.sh
Executable file → Normal file
|
@ -15,21 +15,21 @@ wait_on_pids()
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
echo "Runs .NET CoreFX tests on FreeBSD, Linux, NetBSD or OSX"
|
echo "Runs .NET CoreFX tests on FreeBSD, NetBSD or Linux"
|
||||||
echo "usage: run-test [options]"
|
echo "usage: run-test [options]"
|
||||||
echo
|
echo
|
||||||
echo "Input sources:"
|
echo "Input sources:"
|
||||||
echo " --runtime <location> Location of root of the binaries directory"
|
echo " --runtime <location> Location of root of the binaries directory"
|
||||||
echo " containing the FreeBSD, Linux, NetBSD or OSX runtime"
|
echo " containing the FreeBSD, NetBSD or Linux runtime"
|
||||||
echo " default: <repo_root>/bin/testhost/netcoreapp-<OS>-<ConfigurationGroup>-<Arch>"
|
echo " default: <repo_root>/bin/testhost/netcoreapp-<OS>-<ConfigurationGroup>-<Arch>"
|
||||||
echo " --corefx-tests <location> Location of the root binaries location containing"
|
echo " --corefx-tests <location> Location of the root binaries location containing"
|
||||||
echo " the tests to run"
|
echo " the tests to run"
|
||||||
echo " default: <repo_root>/bin"
|
echo " default: <repo_root>/artifacts/bin"
|
||||||
echo
|
echo
|
||||||
echo "Flavor/OS/Architecture options:"
|
echo "Flavor/OS/Architecture options:"
|
||||||
echo " --configurationGroup <config> ConfigurationGroup to run (Debug/Release)"
|
echo " --configurationGroup <config> ConfigurationGroup to run (Debug/Release)"
|
||||||
echo " default: Debug"
|
echo " default: Debug"
|
||||||
echo " --os <os> OS to run (FreeBSD, Linux, NetBSD or OSX)"
|
echo " --os <os> OS to run (FreeBSD, NetBSD or Linux)"
|
||||||
echo " default: detect current OS"
|
echo " default: detect current OS"
|
||||||
echo " --arch <Architecture> Architecture to run (x64, arm, armel, x86, arm64)"
|
echo " --arch <Architecture> Architecture to run (x64, arm, armel, x86, arm64)"
|
||||||
echo " default: detect current architecture"
|
echo " default: detect current architecture"
|
||||||
|
@ -47,14 +47,6 @@ usage()
|
||||||
echo " listed one line, relative to the directory specified by --corefx-tests"
|
echo " listed one line, relative to the directory specified by --corefx-tests"
|
||||||
echo " --timeout <time> Specify a per-test timeout value (using 'timeout' tool syntax; default is 10 minutes (10m))"
|
echo " --timeout <time> Specify a per-test timeout value (using 'timeout' tool syntax; default is 10 minutes (10m))"
|
||||||
echo
|
echo
|
||||||
echo "Runtime Code Coverage options:"
|
|
||||||
echo " --coreclr-coverage Optional argument to get coreclr code coverage reports"
|
|
||||||
echo " --coreclr-objs <location> Location of root of the object directory"
|
|
||||||
echo " containing the FreeBSD, Linux, NetBSD or OSX coreclr build"
|
|
||||||
echo " default: <repo_root>/bin/obj/<OS>.x64.<ConfigurationGroup"
|
|
||||||
echo " --coreclr-src <location> Location of root of the directory"
|
|
||||||
echo " containing the coreclr source files"
|
|
||||||
echo
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,28 +62,25 @@ function handle_ctrl_c {
|
||||||
# Register the Ctrl-C handler
|
# Register the Ctrl-C handler
|
||||||
trap handle_ctrl_c INT
|
trap handle_ctrl_c INT
|
||||||
|
|
||||||
ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
ProjectRoot="$(dirname "$(dirname "$(realpath ${BASH_SOURCE[0]})")")"
|
||||||
|
|
||||||
# Location parameters
|
# Location parameters
|
||||||
# OS/ConfigurationGroup defaults
|
# OS/ConfigurationGroup defaults
|
||||||
ConfigurationGroup="Debug"
|
ConfigurationGroup="Debug"
|
||||||
OSName=$(uname -s)
|
OSName=$(uname -s)
|
||||||
case $OSName in
|
case $OSName in
|
||||||
Darwin)
|
|
||||||
OS=OSX
|
|
||||||
;;
|
|
||||||
|
|
||||||
FreeBSD)
|
FreeBSD)
|
||||||
OS=FreeBSD
|
OS=FreeBSD
|
||||||
;;
|
;;
|
||||||
|
|
||||||
Linux)
|
|
||||||
OS=Linux
|
|
||||||
;;
|
|
||||||
|
|
||||||
NetBSD)
|
NetBSD)
|
||||||
OS=NetBSD
|
OS=NetBSD
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
Linux)
|
||||||
|
OS=Linux
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Unsupported OS $OSName detected, configuring as if for Linux"
|
echo "Unsupported OS $OSName detected, configuring as if for Linux"
|
||||||
OS=Linux
|
OS=Linux
|
||||||
|
@ -224,9 +213,9 @@ run_test()
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Running tests in $dirName"
|
echo "Running tests in $dirName"
|
||||||
echo "${TimeoutTool}./RunTests.sh $Runtime"
|
echo "${TimeoutTool}./RunTests.sh --runtime-path $Runtime"
|
||||||
echo
|
echo
|
||||||
${TimeoutTool}./RunTests.sh "$Runtime"
|
${TimeoutTool}./RunTests.sh --runtime-path "$Runtime"
|
||||||
exitCode=$?
|
exitCode=$?
|
||||||
|
|
||||||
if [ $exitCode -ne 0 ]
|
if [ $exitCode -ne 0 ]
|
||||||
|
@ -238,57 +227,6 @@ run_test()
|
||||||
exit $exitCode
|
exit $exitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
coreclr_code_coverage()
|
|
||||||
{
|
|
||||||
if [ ! "$OS" == "FreeBSD" ] && [ ! "$OS" == "Linux" ] && [ ! "$OS" == "NetBSD" ] && [ ! "$OS" == "OSX" ]
|
|
||||||
then
|
|
||||||
echo "error: Code Coverage not supported on $OS"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$CoreClrSrc" == "" ]
|
|
||||||
then
|
|
||||||
echo "error: Coreclr source files are required to generate code coverage reports"
|
|
||||||
echo "Coreclr source files root path can be passed using '--coreclr-src' argument"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local coverageDir="$ProjectRoot/artifacts/bin/Coverage"
|
|
||||||
local toolsDir="$coverageDir/tools"
|
|
||||||
local reportsDir="$coverageDir/reports"
|
|
||||||
local packageName="unix-code-coverage-tools.1.0.0.nupkg"
|
|
||||||
rm -rf $coverageDir
|
|
||||||
mkdir -p $coverageDir
|
|
||||||
mkdir -p $toolsDir
|
|
||||||
mkdir -p $reportsDir
|
|
||||||
pushd $toolsDir > /dev/null
|
|
||||||
|
|
||||||
echo "Pulling down code coverage tools"
|
|
||||||
|
|
||||||
which curl > /dev/null 2> /dev/null
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
wget -q -O $packageName https://www.myget.org/F/dotnet-buildtools/api/v2/package/unix-code-coverage-tools/1.0.0
|
|
||||||
else
|
|
||||||
curl -sSL -o $packageName https://www.myget.org/F/dotnet-buildtools/api/v2/package/unix-code-coverage-tools/1.0.0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Unzipping to $toolsDir"
|
|
||||||
unzip -q -o $packageName
|
|
||||||
|
|
||||||
# Invoke gcovr
|
|
||||||
chmod a+rwx ./gcovr
|
|
||||||
chmod a+rwx ./$OS/llvm-cov
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "Generating coreclr code coverage reports at $reportsDir/coreclr.html"
|
|
||||||
echo "./gcovr $CoreClrObjs --gcov-executable=$toolsDir/$OS/llvm-cov -r $CoreClrSrc --html --html-details -o $reportsDir/coreclr.html"
|
|
||||||
echo
|
|
||||||
./gcovr $CoreClrObjs --gcov-executable=$toolsDir/$OS/llvm-cov -r $CoreClrSrc --html --html-details -o $reportsDir/coreclr.html
|
|
||||||
exitCode=$?
|
|
||||||
popd > /dev/null
|
|
||||||
exit $exitCode
|
|
||||||
}
|
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
|
|
||||||
RunTestSequential=0
|
RunTestSequential=0
|
||||||
|
@ -320,15 +258,6 @@ do
|
||||||
--arch)
|
--arch)
|
||||||
__Arch=$2
|
__Arch=$2
|
||||||
;;
|
;;
|
||||||
--coreclr-coverage)
|
|
||||||
CoreClrCoverage=ON
|
|
||||||
;;
|
|
||||||
--coreclr-objs)
|
|
||||||
CoreClrObjs=$2
|
|
||||||
;;
|
|
||||||
--coreclr-src)
|
|
||||||
CoreClrSrc=$2
|
|
||||||
;;
|
|
||||||
--sequential)
|
--sequential)
|
||||||
RunTestSequential=1
|
RunTestSequential=1
|
||||||
;;
|
;;
|
||||||
|
@ -347,12 +276,6 @@ do
|
||||||
--timeout)
|
--timeout)
|
||||||
TimeoutTime=$2
|
TimeoutTime=$2
|
||||||
;;
|
;;
|
||||||
--outerloop)
|
|
||||||
OuterLoop=""
|
|
||||||
;;
|
|
||||||
--IgnoreForCI)
|
|
||||||
IgnoreForCI="-notrait category=IgnoreForCI"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -379,9 +302,9 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! "$OS" == "FreeBSD" ] && [ ! "$OS" == "Linux" ] && [ ! "$OS" == "NetBSD" ] && [ ! "$OS" == "OSX" ]
|
if [ ! "$OS" == "FreeBSD" ] && [ ! "$OS" == "NetBSD" ] && [ ! "$OS" == "Linux" ]
|
||||||
then
|
then
|
||||||
echo "error: OS should be FreeBSD, Linux, NetBSD or OSX"
|
echo "error: OS should be FreeBSD, NetBSD or Linux"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -424,11 +347,6 @@ else
|
||||||
run_all_tests "$CoreFxTests/tests/"*.Tests
|
run_all_tests "$CoreFxTests/tests/"*.Tests
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CoreClrCoverage" == "ON" ]
|
|
||||||
then
|
|
||||||
coreclr_code_coverage
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$TestsFailed" -gt 0 ]
|
if [ "$TestsFailed" -gt 0 ]
|
||||||
then
|
then
|
||||||
echo "$TestsFailed test(s) failed"
|
echo "$TestsFailed test(s) failed"
|
Loading…
Add table
Add a link
Reference in a new issue