From f014c2a10dd8088f1278ea88775b31153f6253ab Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Sat, 7 Nov 2020 19:25:55 +0000 Subject: [PATCH] Fix helper shell scripts to work on Windows. --- .gitignore | 2 ++ build/InstallMono.sh | 2 +- build/InstallNugets.sh | 2 +- build/RunTests.sh | 20 +++++++++++++++++--- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index eb40862b..2c2cc291 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,8 @@ src/generator/generator /build/scripts/llvm** /build/scripts/*.tar.gz /build/scripts/.vagrant +/build/*.zip +/build/*.pkg /build/vs20* /build/gmake /build/headers diff --git a/build/InstallMono.sh b/build/InstallMono.sh index 9eb19789..c513111e 100755 --- a/build/InstallMono.sh +++ b/build/InstallMono.sh @@ -1,6 +1,6 @@ OS=$(uname -s) if [ "$OS" == "Darwin" ]; then - wget -O mono.pkg https://download.mono-project.com/archive/6.10.0/macos-10-universal/MonoFramework-MDK-6.10.0.macos10.xamarin.universal.pkg + curl -o mono.pkg https://download.mono-project.com/archive/6.10.0/macos-10-universal/MonoFramework-MDK-6.10.0.macos10.xamarin.universal.pkg sudo installer -pkg mono.pkg -target / export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/Current/bin elif [ "$OS" == "Linux" ]; then diff --git a/build/InstallNugets.sh b/build/InstallNugets.sh index 47eb7b29..9bafb50d 100755 --- a/build/InstallNugets.sh +++ b/build/InstallNugets.sh @@ -1,3 +1,3 @@ -wget https://github.com/nunit/nunit-console/releases/download/v3.9/NUnit.Console-3.9.0.zip +curl -O -L https://github.com/nunit/nunit-console/releases/download/v3.9/NUnit.Console-3.9.0.zip BUILD_DIR=$(dirname -- $0) unzip NUnit.Console-3.9.0.zip -d $BUILD_DIR/../deps/NUnit.Console-3.9.0 \ No newline at end of file diff --git a/build/RunTests.sh b/build/RunTests.sh index d2c52d5c..2c8f3152 100755 --- a/build/RunTests.sh +++ b/build/RunTests.sh @@ -1,5 +1,19 @@ +#!/bin/sh set -e + BUILD_DIR=$(dirname -- $0) -MONO_PATH=$BUILD_DIR/../deps/NUnit.ConsoleRunner.3.6.1/tools \ -cp $BUILD_DIR/../deps/NUnit/nunit.framework.* $BUILD_DIR/gmake/lib/Release_*/ -mono $BUILD_DIR/../deps/NUnit.Console-3.9.0/nunit3-console.exe -noresult $BUILD_DIR/gmake/lib/Release_*/*Tests*.dll + +case "$(uname -s)" in + Darwin|Linux) + ACTION=gmake + MONO=mono + export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/Current/bin + ;; + + CYGWIN*|MINGW32*|MSYS*|MINGW*) + ACTION=vs2019 + ;; +esac + +cp $BUILD_DIR/../deps/NUnit/nunit.framework.* $BUILD_DIR/$ACTION/lib/Release_*/ +$MONO $BUILD_DIR/../deps/NUnit.Console-3.9.0/nunit3-console.exe -noresult $BUILD_DIR/$ACTION/lib/Release_*/*Tests*.dll