Closed jnz86 closed 10 months ago
This is a feature that has been started but never really finished as it wasn't really in any demand (hence it's not in the documentation yet). We've found that when people want flexibility it what they're running, they tend to prefer it to happen in the test build manager (Ceedling, make, or whatnot) rather than built into the unity framework itself. So it's waiting for a decision.
Ah ok. Well, it's been 7 years so I'm going to bet you don't need it ;) But thanks for answering that. I thought I was missing something obvious.
Actually, I'm wrong. I was just looking at this a few moments ago, and this feature is actually complete and running. It requires that you use the test runner generator to build your main
for you. Ceedling actually is now taking advantage of this feature to do backtracing and finding which tests cause segfaults. :)
So, I saw someone using this with Ceedling. And I built with what the generator does... But I think the only way to get verbosity variable out would be to extern it in to another program? So... It's strange because you have a build command that tells Unity to build with x verbosity, but then you need to bring that in someone and make use of it. It seems more directly that Ceedling or some other program would just define and use it's own verbosity.
IDK. Either way, it's not for me! (I about bashed my head into the wall using Ceedling two weeks ago, so now I'm bashing my head into the wall with CMake and Gtest)
:) Your answer tells me that we have a long way to go on explaining how things work together. Sorry to hear that you spent so much time heading down the wrong path. In either case, we appreciate the feedback! Best of luck! :)
I mean... I could go on for days how programmers are terrible at taking a single step back and explaining INTENT.
"We intended this to be used like this" is almost forbidden because "well you could use this lots of ways"... Yea, cool but tell me what you had in mind.
I like Unity, and hope I can make it work with CTest and integrated into VS Code. The only Unity extension for VS Code's native testing API is not well maintained. And Ceedling wasn't working inside a container for me. I'll come back around most likely.
At https://github.com/ThrowTheSwitch/Unity/blame/bf560290f6020737eafaa8b5cbd2177c3956c03f/src/unity.c#L2275 I see there are options to bring in command line arguments to the test main. Also there are also mentions of verbosity that modify a global variable, but it goes no where.
There are
#ifdef
ed away until you#define UNITY_USE_COMMAND_LINE_ARGS
.I don't really get it. The only way to use any of this is to add the call manually to your main. And then verbosity at least does nothing anyhow. You need something like: