Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b6a72b
commit c76c71d
Showing
5 changed files
with
55 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
exampleTest |
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,14 @@ | ||
exampleTest: picotest.o exampleTest.o | ||
gcc -o exampleTest picotest.o exampleTest.o | ||
|
||
picotest.o: picotest.c picotest.h | ||
gcc -c picotest.c | ||
|
||
exampleTest.o: exampleTest.c | ||
gcc -c exampleTest.c | ||
|
||
clean: | ||
rm *.o | ||
rm exampleTest | ||
|
||
all: exampleTest |
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,28 @@ | ||
#ifndef PICOTEST_H | ||
#define PICOTEST_H | ||
|
||
#include <stdio.h> | ||
|
||
void addTest(void* test); | ||
int executeTestSuite(); | ||
void initializePicotest(); | ||
|
||
#define RUN_TEST(test) do { char *output = test(); tests_run++; \ | ||
if (output) return output; } while (0) | ||
#define TEST_ASSERT(message, test) do { tests_run++; if (!(test)) { tests_failed++; printf("FAIL \t %s\n",message);} else { tests_passed++; printf("PASS \t %s\n",message);} } while (0) | ||
|
||
#define MAX_TESTS 99 | ||
|
||
extern int tests_run; | ||
extern int tests_passed; | ||
extern int tests_failed; | ||
|
||
void* tests[MAX_TESTS]; | ||
|
||
int tests_run; | ||
int tests_passed; | ||
int tests_failed; | ||
|
||
int numTests; | ||
|
||
#endif |