From 9310a3049603b4a8b3f6290d8268e126fc9aa6cd Mon Sep 17 00:00:00 2001 From: justin taft Date: Sun, 18 Oct 2015 00:11:24 -0700 Subject: [PATCH] Creates winodws test runner --- script/light-test.bat | 3 ++- script/run-tests.sh | 37 +++++++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/script/light-test.bat b/script/light-test.bat index 4f7ee7321..b068b103e 100644 --- a/script/light-test.bat +++ b/script/light-test.bat @@ -1,2 +1,3 @@ set LTPATH=%~dp0\.. -c:\cygwin\bin\bash.exe -lc "cd '`cygpath -u $LTPATH`; ./script/light-test.sh" +echo %LTPATH +c:\cygwin\bin\bash.exe -lc "cd `cygpath -u $LTPATH`; ./script/light-test.sh" diff --git a/script/run-tests.sh b/script/run-tests.sh index bf64e6be8..8176cf6bd 100755 --- a/script/run-tests.sh +++ b/script/run-tests.sh @@ -1,17 +1,26 @@ #!/bin/bash echo "Checking for chromedrive" -if [ ! -f /tmp/chromedriver ]; then +ISWINDOWS=0 +if [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then + CHROMEDRIVER_PATH=/tmp/chromedriver.exe + ISWINDOWS=1 +else CHROMEDRIVER_PATH=/tmp/chromedriver +fi + + + +if [ ! -f "$CHROMEDRIVER_PATH" ]; then + # from: http://stackoverflow.com/a/17072017/142317 if [ "$(uname)" == "Darwin" ]; then URL="http://chromedriver.storage.googleapis.com/2.19/chromedriver_mac32.zip" elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then URL="http://chromedriver.storage.googleapis.com/2.19/chromedriver_linux64.zip" - elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then + elif [ "$ISWINDOWS" == "CYGWIN_NT" ]; then URL="http://chromedriver.storage.googleapis.com/2.19/chromedriver_win32.zip" - CHROMEDRIVER_PATH=/tmp/chromedriver.exe else echo "Cannot detect a supported OS." exit 1 @@ -22,10 +31,12 @@ if [ ! -f /tmp/chromedriver ]; then unzip /tmp/chromedriver.zip -d /tmp fi -ls -la /tmp/chromedriver - echo "Killing all chromedrivers & starting new instance". + + killall "chromedriver" +killall "chromedriver.exe" + chmod u+x $CHROMEDRIVER_PATH $CHROMEDRIVER_PATH& CHROME_PID = $! @@ -42,12 +53,10 @@ echo "Killing chrome" kill $CHROME_PID -echo "Killing java" -taskkill /F /IM java.exe -echo "Killing bash.exe" -killall bash.exe -echo "Killing bash" -killall -9 bash -echo "Bash killed" - - +#echo "Killing java" +#taskkill /F /IM java.exe +#echo "Killing bash.exe" +#killall bash.exe +#echo "Killing bash" +#killall -9 bash +#echo "Bash killed"