From 6001e2eb859ce70a5b8ffad77d18410d28c9a9e5 Mon Sep 17 00:00:00 2001 From: damithc <> Date: Tue, 25 Aug 2020 17:23:26 +0800 Subject: [PATCH] Improve runtest.* scripts * Improve the javac command to work for multiple java files. * In runtest.bat, delete ACTUAL.TXT only if it exists. --- text-ui-test/runtest.bat | 4 ++-- text-ui-test/runtest.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/text-ui-test/runtest.bat b/text-ui-test/runtest.bat index d0facc6310..0873744649 100644 --- a/text-ui-test/runtest.bat +++ b/text-ui-test/runtest.bat @@ -4,10 +4,10 @@ REM create bin directory if it doesn't exist if not exist ..\bin mkdir ..\bin REM delete output from previous run -del ACTUAL.TXT +if exist ACTUAL.TXT 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\main\java -Xlint:none -d ..\bin ..\src\main\java\*.java IF ERRORLEVEL 1 ( echo ********** BUILD FAILURE ********** exit /b 1 diff --git a/text-ui-test/runtest.sh b/text-ui-test/runtest.sh index e169618a34..c9ec870033 100644 --- a/text-ui-test/runtest.sh +++ b/text-ui-test/runtest.sh @@ -13,7 +13,7 @@ then 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/main/java -Xlint:none -d ../bin ../src/main/java/*.java then echo "********** BUILD FAILURE **********" exit 1