Docs
Cloneing
This project uses submodules for some external dependencies, while they are not required for the the main game, it is recomened that you clone the aswell.
# or
git clone --recurse-submodules https://github.com/Kapocsi/machineryII.git
Compiling
To compile and run the main game:
Testing
All tests can be built and run using the provided Makefile:
To build an individual test suite:
To run the compiled test suite:
Adding a Test Suite
- Add a file with the same name as the module in
test ie tests for raster.c will live in test/raster.c
- Use the following template to add a entry to the Makefile
test\mod.prg: test\mod.o src\unit.o
$(CC) $(CFLAGS) $^ -o $@
$@ # Run the test
- Register the test in Makefile, by adding the test both as a dep and as build step for
test
test: $(objs) test\mod.prg # other tests ...
test\mod.prg
# other tests...
Adding Test Cases
In test\<module>.c add function to test the given function:
void test_<function_name>() {
}
Then register this test in the suiteās main function:
int main() {
UNITY_BEGIN();
RUN_TEST(test_<function_name>);
UNITY_END();
}