Open
Description
I'm having a problem compiling AllTests.cpp after adding the setup code which seems to be recommended in Plugin Manual re: SetPointerPlugin . My AllTests.cpp looks like this:
#include "CppUTest/CommandLineTestRunner.h"
int main(int ac, char** av)
{
TestRegistry* r = TestRegistry::getCurrentRegistry();
SetPointerPlugin ps("PointerStore");
r->installPlugin(&ps);
return CommandLineTestRunner::RunAllTests(ac, av);
}
but when I compile it (gcc:10), I get an error:
$ make ./test-obj/1/2/tests/AllTests.o
compiling AllTests.cpp
tests/AllTests.cpp: In function ‘int main(int, char**)’:
tests/AllTests.cpp:11:34: error: incomplete type ‘TestRegistry’ used in nested name specifier
11 | TestRegistry* r = TestRegistry::getCurrentRegistry();
| ^~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
make: *** [/home/keith/e2_studio/Ranger/CppUTest/build/MakefileWorker.mk:511: test-obj/1/2/tests/AllTests.o] Error 1
After searching for SetPointerPlugin in the CppUTest source files, in function int CommandLineTestRunner::runAllTestsMain()
the SetPointerPlugin is installed in the registry by default, with no extra setup code being needed in main(). So it seems that the setup code shown for installing it should be removed from Plugin Manual re: SetPointerPlugin.
Metadata
Metadata
Assignees
Labels
No labels