diff --git a/Makefile b/Makefile index e778e86..05ccd1f 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,6 @@ project5: project5.cc province.cc province.h # test the code against an expected output file # this test should grow into a spaceship and end with blinkers -test-nowhere: - ./project5 < test-files/t01-nowhere.in > tests/project4.out - diff test-files/project4.out test-files/t01-nowhere.out > test.diff - wc -l test.diff +test-requirement1: + ./project5 < test-data/requirement1.in > test-data/project4.out + diff test-data/project4.out test-data/requirement1.out diff --git a/project5 b/project5 new file mode 100755 index 0000000..cf35b8d Binary files /dev/null and b/project5 differ diff --git a/test-data/README.md b/test-data/README.md index 3bd8083..4e03e6d 100644 --- a/test-data/README.md +++ b/test-data/README.md @@ -8,3 +8,7 @@ code works. Remember: **if you haven't tested it, it doesn't work.** * .out: expected output for matching input. Please match the format of each line exactly, by comparing your output to this with the "diff" command. Try to make the output line order match, too. But if you are confident your code is producing correct output in a different valid order, that is acceptable. There is also a .jpg image of a diagram of some input. + +Elijah: + +To run a test from the make file, execute `make ` where test name is the target name of the test. At the moment you read this, the only availible test target in the makefile is a test named "test-requirement1". To run this test target, execute `make test-requirement1` in the terminal. This will run the code with an imput file and compares the output of the test with the expected output using the diff unix command. \ No newline at end of file diff --git a/test-data/project4.out b/test-data/project4.out new file mode 100644 index 0000000..1673102 --- /dev/null +++ b/test-data/project4.out @@ -0,0 +1,18 @@ +This is the name: 0x600000610008 +This is the name: 0x600000610038 +This is the name: 0x600000610068 +This is the name: 0x600000610098 +This is the name: 0x6000006100c8 +The input data is: + + Salem +This is the name: 0x600001110008 +This is the name: 0x600001110038 +The input data is: + + Wenham +This is the name: 0x600001110078 +This is the name: 0x6000011100a8 +The input data is: + + diff --git a/test-data/requirement1.in b/test-data/requirement1.in new file mode 100644 index 0000000..11b27a0 --- /dev/null +++ b/test-data/requirement1.in @@ -0,0 +1,16 @@ +5 6 +Salem +Wenham +Beverly +Danvers +Lynn +Beverly Danvers N 2.9 +Beverly Salem B 2.4 +Beverly Wenham N 5.2 +Danvers Wenham N 4.2 +Danvers Salem B 3.7 +Lynn Salem N 4.9 +2 1 +Wenham +Hamilton +Wenham Hamilton N 1 diff --git a/test-data/requirement1.out b/test-data/requirement1.out new file mode 100644 index 0000000..0dce589 --- /dev/null +++ b/test-data/requirement1.out @@ -0,0 +1,19 @@ +The input data is: + +Salem + Beverly 2.4 mi via bridge + Danvers 3.7 mi via bridge + Lynn 4.9 mi +Beverly + Danvers 2.9 mi + Salem 2.4 mi via bridge + Wenham 5.2 mi +Danvers + Beverly 2.9 mi + Wenham 4.2 mi + Salem 3.7 mi via bridge +Lynn + Salem 4.9 mi +Wenham + Beverly 5.2 mi + Danvers 4.2 mi