@@ -15,12 +15,12 @@ wait_on_pids()
1515
1616usage ()
1717{
18- echo " Runs .NET CoreFX tests on FreeBSD, NetBSD or Linux "
18+ echo " Runs .NET CoreFX tests on FreeBSD, Linux, NetBSD or SunOS "
1919 echo " usage: run-test [options]"
2020 echo
2121 echo " Input sources:"
2222 echo " --runtime <location> Location of root of the binaries directory"
23- echo " containing the FreeBSD, NetBSD or Linux runtime"
23+ echo " containing the FreeBSD, Linux, NetBSD or SunOS runtime"
2424 echo " default: <repo_root>/bin/testhost/netcoreapp-<OS>-<Configuration>-<Arch>"
2525 echo " --corefx-tests <location> Location of the root binaries location containing"
2626 echo " the tests to run"
@@ -29,7 +29,7 @@ usage()
2929 echo " Flavor/OS/Architecture options:"
3030 echo " --configuration <config> Configuration to run (Debug/Release)"
3131 echo " default: Debug"
32- echo " --os <os> OS to run (FreeBSD, NetBSD or Linux )"
32+ echo " --os <os> OS to run (FreeBSD, Linux, NetBSD or SunOS )"
3333 echo " default: detect current OS"
3434 echo " --arch <Architecture> Architecture to run (x64, arm, armel, x86, arm64)"
3535 echo " default: detect current architecture"
@@ -236,34 +236,34 @@ done
236236
237237# Compute paths to the binaries if they haven't already been computed
238238
239- if [ " $Runtime " == " " ]
239+ if [ -z " $Runtime " ]
240240then
241241 Runtime=" $ProjectRoot /artifacts/bin/testhost/netcoreapp-$OS -$Configuration -$__Arch "
242242fi
243243
244- if [ " $CoreFxTests " == " " ]
244+ if [ -z " $CoreFxTests " ]
245245then
246246 CoreFxTests=" $ProjectRoot /artifacts/bin"
247247fi
248248
249249# Check parameters up front for valid values:
250250
251- if [ ! " $Configuration " == " Debug" ] && [ ! " $Configuration " = = " Release" ]
251+ if [ " $Configuration " != " Debug" ] && [ " $Configuration " ! = " Release" ]
252252then
253253 echo " error: Configuration should be Debug or Release"
254254 exit 1
255255fi
256256
257- if [ ! " $OS " == " FreeBSD" ] && [ ! " $OS " == " NetBSD" ] && [ ! " $OS " == " Linux " ]
257+ if [ " $OS " != " FreeBSD" ] && [ " $OS " != " Linux " ] && [ " $OS " != " NetBSD" ] && [ " $OS " != " SunOS " ]
258258then
259- echo " error: OS should be FreeBSD, NetBSD or Linux"
259+ echo " error: OS should be FreeBSD, Linux, NetBSD or Linux"
260260 exit 1
261261fi
262262
263263export CORECLR_SERVER_GC=" $serverGC "
264264export PAL_OUTPUTDEBUGSTRING=" 1"
265265
266- if [ " $LANG " == " " ]
266+ if [ -z " $LANG " ]
267267then
268268 export LANG=" en_US.UTF-8"
269269fi
@@ -285,7 +285,10 @@ if [ $RunTestSequential -eq 1 ]
285285then
286286 maxProcesses=1;
287287else
288- if [ ` uname` = " NetBSD" ] || [ ` uname` = " FreeBSD" ]; then
288+ platform=" $( uname) "
289+ if [ " $platform " = " FreeBSD" ]; then
290+ maxProcesses=$( sysctl hw.ncpu | awk ' { print $2+1 }' )
291+ if [ " $platform " = " NetBSD" ] || [ " $platform " = " SunOS" ] ; then
289292 maxProcesses=$(( $(getconf NPROCESSORS_ONLN)+ 1 ))
290293 else
291294 maxProcesses=$(( $(getconf _NPROCESSORS_ONLN)+ 1 ))
0 commit comments