diff --git a/scripts/common.sh b/scripts/common.sh index 2edd0eddf..edd5fa5f5 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -315,3 +315,10 @@ le() { cmp_versions "$1" "<=" "$2"; } ge() { cmp_versions "$1" ">=" "$2"; } eq() { cmp_versions "$1" "==" "$2"; } neq() { ! eq "$1" "$2"; } + +if [[ -e "$CONFIG_WPDK_DIR/bin/wpdk_common.sh" ]]; then + # Adjust uname to report the operating system as WSL, Msys or Cygwin + # and the kernel name as Windows. Define kill() to invoke the SIGTERM + # handler before causing a hard stop with TerminateProcess. + source "$CONFIG_WPDK_DIR/bin/wpdk_common.sh" +fi diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 1e666cc39..937597c93 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -28,8 +28,6 @@ xtrace_disable set -e shopt -s expand_aliases -source "$rootdir/test/common/applications.sh" -source "$rootdir/scripts/common.sh" if [[ -e $rootdir/test/common/build_config.sh ]]; then source "$rootdir/test/common/build_config.sh" elif [[ -e $rootdir/mk/config.mk ]]; then @@ -39,6 +37,10 @@ else source "$rootdir/CONFIG" fi +# Source scripts after the config so that the definitions are available. +source "$rootdir/test/common/applications.sh" +source "$rootdir/scripts/common.sh" + # Dummy function to be called after restoring xtrace just so that it appears in the # xtrace log. This way we can consistently track when xtrace is enabled/disabled. function xtrace_enable() { @@ -233,6 +235,11 @@ elif [ "$(uname -s)" = "FreeBSD" ]; then MAKEFLAGS=${MAKEFLAGS:--j$(sysctl -a | grep -E -i 'hw.ncpu' | awk '{print $2}')} # FreeBSD runs a much more limited set of tests, so keep the default 2GB. export HUGEMEM=2048 +elif [ "$(uname -s)" = "Windows" ]; then + MAKE="make" + MAKEFLAGS=${MAKEFLAGS:--j$(nproc)} + # Keep the default 2GB for Windows. + export HUGEMEM=2048 else echo "Unknown OS \"$(uname -s)\"" exit 1