Preparation for using SetPointerPlugin

24 views
Skip to first unread message

Keith Hill

unread,
Jan 26, 2021, 3:01:09 PM1/26/21
to cpputest
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
```
So I'm wondering whether the setup code for SetPointerPlugin is really needed, or if something has recently gone wrong with a merge request.  I'm using git to pull the code from the latest-passing-build tag with the following line first:

#!/bin/sh
cd ../CppUTest
# ensure we've checked out the "latest-passing-build" tag
git checkout tags/latest-passing-build
...

Does anybody know whether or not this code needs to be added to get the support for UT_PTR_SET?

P.S. $ gcc --version shows gcc GCC) 10.20.0 ...
I'm running these things in Windows 10 under an updated Msys2 shell.

thanks,
Keith


Keith Hill

unread,
Jan 27, 2021, 10:00:34 AM1/27/21
to cpputest
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. Where should that work request be logged?

best regards,
Keith

Bas Vodde

unread,
Jan 28, 2021, 7:11:44 AM1/28/21
to cppu...@googlegroups.com

Hi,

The site is at:

So issues and pull requests can be done there!

Sorry for the confusion caused.

Thanks,

Bas


--
You received this message because you are subscribed to the Google Groups "cpputest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cpputest+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cpputest/9f5c3aad-ce45-4b34-8d81-fca91f9c63fdn%40googlegroups.com.

Keith Hill

unread,
Jan 28, 2021, 9:49:44 AM1/28/21
to cpputest

Bas Vodde

unread,
Jan 29, 2021, 11:54:33 AM1/29/21
to cppu...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages