These changes allow for projects that were created and built using the
same Makefile to be placed under the submodules directory. This Makefile
will recursively build the submodules and link to the top project.
The submodules will be built as a static library using ar rcs.
A child process is created which runs the test operation. It then
returns the exit status if exited properly and termination signal if
not.
A Termination signal of (11) corresponds to a segfault so keep that in
mind.
The framework, completely contained in x_tfw4c.c, uses pre-compiler
MACROS to create an environment where it is easy to create unit tests
and run regression tests.
It iterates through a linked list of test structs that contain the test
function that should be executed and the name of the test to be
displayed.
This is a simple rework of a prior test framework that did not
dynamically add new tests at compile time.
Next steps would be to have it display more metadata and have some
resilience to crashes in the tests.
This Makefile will be used as a way to start new projects with the same
hierarchy. It will also be tightly coupled with the x testing framework
for c (x_tfw4c).
It has targets to setup the source, include, object, and tests
directories using the `make dirs` command.
There is some fun interesting things that I used to get the target to
recompile when the header files are updated using the -MMD and -MP flags
in gcc.
These flags basically allow for the generation of dependencies from each
source file that are exported and then included using the -include
$(DEPENDENCIES) line at the bottem of the Makefile.