Github user kevdoran commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/95
@apiri @phrocker - update on this:
The approach of setting a hardcoded working directory when adding tests to
ctest in the CMakeLists.txt file proved to be too brittle. If you invoke the
test executable directly, it fails. After some exploration, I could not find a
way to pass the resource location to the Catch unit tests in a manner that I
was satisfied with. Two alternatives I explored included passing the location
as an environment variable and passing it as a command line argument. The
environment variable approach was a no-go as it it would require us to setup
the "test" target in CMake using something other than enable_testing() and
instead creating our own target, which seemed undesirable at this time. The
argument approach would require us to define our own main for Catch unit tests,
rather than using the `#define CATCH_CONFIG_MAIN`, and because `#define
CATCH_CONFIG_MAIN` does more than just inline a main function, I didn't want to
do that either in case assumptions made today break with other versions of
Catch.hpp in the future.
The benefits here seemed minor, and could not justify the extra complexity
introduced by the workarounds I explored (IMO), so I reverted the yaml config
to being hardcoded inline strings. For now, I recommend closing MINIFI-290 as
"won't do" and merge this PR which has a few other changes that I cam across
while investigating this. Alternatively, we could move MINIFI-290 back to
"open" if we want to revisit this in the future... but I'm sure if the need
arises we would reopen it or make a new ticket.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---