We have a requirement that the unit testing file need to be separate with the source file in project building.
It means we must not do this for testing the source file.
unit_testing_file.c
#include <source_file.c>
//testcases for testing source_file.c
...
The problem I can see here is just about linking (the test file and source file become 1 object file after compiling instead of 2) and the scope of variables in two file now become same.
Do you think there is any another reason behind that we need to do it ?
Aucun commentaire:
Enregistrer un commentaire