From 8531ea3e41cfbca647a3f3b9dc422d9f4be332de Mon Sep 17 00:00:00 2001 From: Mohideen Imran Khan Date: Thu, 22 Aug 2019 19:12:19 +0800 Subject: [PATCH] Remove compilation limitation in test script --- tutorials/textUiTestingTutorial.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tutorials/textUiTestingTutorial.md b/tutorials/textUiTestingTutorial.md index f397d76a..87b2113f 100644 --- a/tutorials/textUiTestingTutorial.md +++ b/tutorials/textUiTestingTutorial.md @@ -5,54 +5,54 @@ `runtest.bat`: ``` @ECHO OFF - + REM create bin directory if it doesn't exist if not exist ..\bin mkdir ..\bin - + REM delete output from previous run del ACTUAL.TXT - + REM compile the code into the bin folder - javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\Duke.java + javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\*.java IF ERRORLEVEL 1 ( echo ********** BUILD FAILURE ********** exit /b 1 ) REM no error here, errorlevel == 0 - + REM run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT java -classpath ..\bin Duke < input.txt > ACTUAL.TXT - + REM compare the output to the expected output FC ACTUAL.TXT EXPECTED.TXT ``` - + `runtest.sh`: ```shell #!/usr/bin/env bash - + # create bin directory if it doesn't exist if [ ! -d "../bin" ] then mkdir ../bin fi - + # delete output from previous run if [ -e "./ACTUAL.TXT" ] then rm ACTUAL.TXT fi - + # compile the code into the bin folder, terminates if error occurred - if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/Duke.java + if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/*.java then echo "********** BUILD FAILURE **********" exit 1 fi - + # run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT java -classpath ../bin Duke < input.txt > ACTUAL.TXT - + # compare the output to the expected output diff ACTUAL.TXT EXPECTED.TXT if [ $? -eq 0 ]