CPPUTEST + Docker + Verbose

38 views
Skip to first unread message

Matt Hilden

unread,
Nov 11, 2021, 2:17:32 PM11/11/21
to cpputest
Hi all, first of all thank you for a wonderful tool. I first heard about it via James's talk at Embedded Systems Conference this year and I have been dabbling... but I'm still a N00B.

I've got CPPUTEST building into a docker container and running itself against my codebase as a GitHub action. This is working properly and I'm pleased with it. Running it from a container on GitHub allows me to run it from a container on my local machine and helps me debug things locally before asking GitHub actions to do it. So far so good.

My question is about the `-v` flag. I'd like to run the cpputest docker container in verbose mode so I can see results for each individual test in the GitHub action logs. I can see that `-v` is a command-line flag for cpputest, but I can't seem to work out how to inject that command line flag via docker-compose, which is what I am using to build and run the containers.

My command is currently: `docker-compose run --entrypoint "make all" cpputest`

Does anyone here know how I might be able to enable verbose output, or build the tool with this as the default option?

Thank you!

Ryan Hartlage

unread,
Nov 11, 2021, 2:27:58 PM11/11/21
to cpputest
Hey Matt,

Have you tried defining an additional make target that is similar to 'all' but that passes the -v flag to the test binary?

Ryan

--
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/7a7f0f62-fbc3-4f5d-9024-2abfdecc57a3n%40googlegroups.com.

Bas Vodde

unread,
Nov 11, 2021, 2:51:50 PM11/11/21
to 'GuangHui Zhang' via cpputest

Hi Matt,

You want to run the “make all” from CppUTest and then let it execute with -v?

I’m not completely clear on the question yet.

Thanks!

Bas

Matt Hilden

unread,
Nov 11, 2021, 3:00:23 PM11/11/21
to cpputest
Hi Bas - yes, that is what I want to do.

@Ryan - A brilliant suggestion! But I want to do this from my local files without needing to modify the code as it's pulled from GitHub, and the makefile targets are defined in cpputest/build/MakefileWorker.mk . Poking around in the CPPUTEST source I noticed that the MakefileWorker.mkfile has a definition in it called CPPUTEST_EXE_FLAGS and this sounded a lot like what I was trying to do...

Knowing this, I was able to add `CPPUTEST_EXE_FLAGS += -v` to my local Makefile (where the .cpp files to test are defined) and this worked!

Thanks for the help, everyone.

~Matt

James Grenning

unread,
Nov 11, 2021, 10:50:44 PM11/11/21
to cpputest

Hi Matt

If you are using MakefileWorker you can use the vtest target.

HTH, Cheers, James


James Grenning -- Author of TDD for Embedded C - wingman-sw.com/tddec
Join my live-via-the-web TDD Training
wingman software
wingman-sw.com -- blog -- @jwgrenning -- facebook

--
Reply all
Reply to author
Forward
0 new messages