Skip to content

Commit 22fd6ce

Browse files
author
Justin Heyes-Jones
committed
add simple test runner
1 parent e750074 commit 22fd6ce

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

‎.travis.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ compiler:
33
- g++
44
- clang
55

6-
script: cd cpp; make
6+
script:
7+
cd cpp
8+
make
9+
make test
10+
711

‎cpp/makefile‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
all : 8puzzle findpath minpathbucharest
1+
all : 8puzzle findpath minpathbucharest tests
22

33
minpathbucharest : min_path_to_Bucharest.cpp stlastar.h
44
g++ -Wall min_path_to_Bucharest.cpp -o minpathbucharest
@@ -9,5 +9,14 @@ minpathbucharest : min_path_to_Bucharest.cpp stlastar.h
99
findpath : findpath.cpp stlastar.h
1010
g++ -Wall findpath.cpp -o findpath
1111

12+
tests : tests.cpp 8puzzle findpath minpathbucharest
13+
g++ -Wall tests.cpp -o tests
14+
15+
test: tests
16+
./tests
17+
18+
19+
20+
1221

1322

‎cpp/tests.cpp‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// A unit test suite
2+
3+
#include <stdio.h>
4+
#include <stdlib.h>
5+
#include <assert.h>
6+
7+
int main(int argc, char *argv[]) {
8+
9+
assert(true && "failed to be true");
10+
11+
printf("Tests succeeded\n");
12+
13+
}

0 commit comments

Comments
 (0)