Bug 427486

Summary: tests imported from CMake do not respect ENVIRONMENT properties
Product: [Applications] kdevelop Reporter: Rolf Eike Beer <kde>
Component: Build tools: CMakeAssignee: kdevelop-bugs-null
Status: CONFIRMED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Rolf Eike Beer 2020-10-09 14:13:56 UTC
Brute-force example code to give some hints is here: https://invent.kde.org/dakon/kdevelop/-/tree/ctest-env

If one does this:

add_test(NAME test_six COMMAND four_test 3 WORKING_DIRECTORY "/foo")
set_property(TEST test_six PROPERTY ENVIRONMENT "foo=bar")

then running the code via ctest will result in getenv("foo") == "bar", which when I run the same test using the "Unit test" pane it will be getenv("foo") == NULL.