Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Test: Fixes for FreeBSD in run-test script #3306

Merged
merged 1 commit into from Sep 18, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 35 additions & 17 deletions run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ wait_on_pids()

usage()
{
echo "Runs tests on linux/mac that don't have native build support"
echo "Runs .NET CoreFX tests on FreeBSD, Linux or OSX"
echo "usage: run-test [options]"
echo
echo "Input sources:"
echo " --coreclr-bins <location> Location of root of the binaries directory"
echo " containing the linux/mac coreclr build"
echo " containing the FreeBSD, Linux or OSX coreclr build"
echo " default: <repo_root>/bin/Product/<OS>.x64.<Configuration>"
echo " --mscorlib-bins <location> Location of the root binaries directory containing"
echo " the linux/mac mscorlib.dll"
echo " the FreeBSD, Linux or OSX mscorlib.dll"
echo " default: <repo_root>/bin/Product/<OS>.x64.<Configuration>"
echo " --corefx-tests <location> Location of the root binaries location containing"
echo " the windows tests"
echo " default: <repo_root>/bin/tests/Windows_NT.AnyCPU.<Configuration>"
echo " --corefx-bins <location> Location of the linux/mac corefx binaries"
echo " --corefx-bins <location> Location of the FreeBSD, Linux or OSX corefx binaries"
echo " default: <repo_root>/bin/<OS>.AnyCPU.<Configuration>"
echo " --corefx-native-bins <location> Location of the linux/mac native corefx binaries"
echo " --corefx-native-bins <location> Location of the FreeBSD, Linux or OSX native corefx binaries"
echo " default: <repo_root>/bin/<OS>.x64.<Configuration>"
echo
echo "Flavor/OS options:"
echo " --configuration <config> Configuration to run (Debug/Release)"
echo " default: Debug"
echo " --os <os> OS to run (OSX/Linux)"
echo " --os <os> OS to run (FreeBSD, Linux or OSX)"
echo " default: detect current OS"
echo
echo "Execution options:"
Expand All @@ -46,7 +46,7 @@ usage()
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 linux/mac coreclr build"
echo " containing the FreeBSD, Linux or OSX coreclr build"
echo " default: <repo_root>/bin/obj/<OS>.x64.<Configuration>"
echo " --coreclr-src <location> Location of root of the directory"
echo " containing the coreclr source files"
Expand All @@ -60,14 +60,18 @@ ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Configuration="Debug"
OSName=$(uname -s)
case $OSName in
Linux)
OS=Linux
;;

Darwin)
OS=OSX
;;

FreeBSD)
OS=FreeBSD
;;

Linux)
OS=Linux
;;

*)
echo "Unsupported OS $OSName detected, configuring as if for Linux"
OS=Linux
Expand All @@ -91,7 +95,14 @@ create_test_overlay()
pushd $packageDir > /dev/null
# Pull down the testhost package and unzip it.
echo "Pulling down $packageName"
wget -q https://www.myget.org/F/dotnet-buildtools/api/v2/package/Microsoft.DotNet.CoreFx.$OS.TemporaryTestHost/$TestHostVersion -O $packageName

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/Microsoft.DotNet.CoreFx.$OS.TemporaryTestHost/$TestHostVersion
else
curl -sSL -o $packageName https://www.myget.org/F/dotnet-buildtools/api/v2/package/Microsoft.DotNet.CoreFx.$OS.TemporaryTestHost/$TestHostVersion
fi

echo "Unzipping to $packageDir"
unzip -q -o $packageName
popd > /dev/null
Expand Down Expand Up @@ -131,7 +142,7 @@ create_test_overlay()
fi
cp -r $mscorlibLocation $OverlayDir

# Then the binaries from the linux build of corefx
# Then the binaries from the Linux build of corefx
if [ ! -d $CoreFxBins ]
then
echo "Corefx binaries not found at $CoreFxBins"
Expand Down Expand Up @@ -218,7 +229,7 @@ runtest()

coreclr_code_coverage()
{
if [ ! "$OS" == "OSX" ] && [ ! "$OS" == "Linux" ]
if [ ! "$OS" == "FreeBSD" ] && [ ! "$OS" == "Linux" ] && [ ! "$OS" == "OSX" ]
then
echo "Code Coverage not supported on $OS"
exit 1
Expand All @@ -242,7 +253,14 @@ coreclr_code_coverage()
pushd $toolsDir > /dev/null

echo "Pulling down code coverage tools"
wget -q https://www.myget.org/F/dotnet-buildtools/api/v2/package/unix-code-coverage-tools/1.0.0 -O $packageName

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

Expand Down Expand Up @@ -343,9 +361,9 @@ then
exit 1
fi

if [ ! "$OS" == "OSX" ] && [ ! "$OS" == "Linux" ]
if [ ! "$OS" == "FreeBSD" ] && [ ! "$OS" == "Linux" ] && [ ! "$OS" == "OSX" ]
then
echo "OS should be Linux or OSX"
echo "OS should be FreeBSD, Linux or OSX"
exit 1
fi

Expand Down