forked from se-edu/addressbook-level1
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[6] Add a runtests.sh
- Loading branch information
Showing
4 changed files
with
51 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,5 @@ hs_err_pid* | |
|
||
# Temp files used for testing | ||
test/actual.txt | ||
test/localrun.bat | ||
test/localrun.bat | ||
/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
# create ../bin directory if not exists | ||
if [ ! -d "../bin" ] | ||
then | ||
mkdir ../bin | ||
fi | ||
|
||
# compile the code into the bin folder | ||
javac ../src/seedu/addressbook/Addressbook.java -d ../bin | ||
|
||
# run the program, feed commands from input.txt file and redirect the output to the actual.txt | ||
java -classpath ../bin seedu.addressbook.AddressBook < input.txt > actual.txt | ||
|
||
# compare the output to the expected output | ||
diff actual.txt expected.txt | ||
if [ $? -eq 0 ] | ||
then | ||
echo "Test result: PASSED" | ||
else | ||
echo "Test result: FAILED" | ||
fi |