Skip to content

Commit

Permalink
[se-edu#107] runtests.bat: Allow user to run script outside test fold…
Browse files Browse the repository at this point in the history
…er (se-edu#108)

runtests.bat script does not work outside the test folder.

Developers working on the project often have their working directory
set to the root of the project. It is inconvenient to switch in and out
of the test folder repeatedly in an edit-debug cycle.

To reduce the hassle, let's add the commands in bat script to perform
the switching of directory automatically and hence increase our
productivity.
  • Loading branch information
rongjiecomputer authored and yamgent committed Aug 25, 2018
1 parent ca2ab8c commit 1827da8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/runtests.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
@ECHO OFF

REM change current directory to the location of this script
pushd %~dp0

REM create bin directory if it doesn't exist
if not exist ..\bin mkdir ..\bin

REM compile the code into the bin folder
javac ..\src\seedu\addressbook\Addressbook.java -d ..\bin
IF ERRORLEVEL 1 (
echo ********** BUILD FAILURE **********
REM return to previous directory
popd
exit /b 1
)
REM no error here, errorlevel == 0
Expand All @@ -28,3 +33,6 @@ java -classpath ..\bin seedu.addressbook.AddressBook < input.txt >> actual.txt

REM compare the output to the expected output
FC actual.txt expected.txt

REM return to previous directory
popd

0 comments on commit 1827da8

Please sign in to comment.