Skip to content

Commit 56ce00e

Browse files
ICT-KayneSkris-jusiak
authored andcommitted
Added Test Name environemnt variable
Added path input to cucubberjson feature report
1 parent 7633eef commit 56ce00e

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if (ENABLE_MEMCHECK AND MEMORYCHECK_COMMAND)
7979
add_test(${out} ${MEMORYCHECK_COMMAND} --leak-check=full --error-exitcode=1 ./${out})
8080
set_tests_properties(${out}
8181
PROPERTIES
82-
ENVIRONMENT ${scenario}
82+
ENVIRONMENT "${scenario};TEST_NAME=${out}"
8383
)
8484
target_link_libraries(${out} gunit)
8585
endfunction()
@@ -90,7 +90,7 @@ else()
9090
add_test(${out} ./${out})
9191
set_tests_properties(${out}
9292
PROPERTIES
93-
ENVIRONMENT ${scenario}
93+
ENVIRONMENT "${scenario};TEST_NAME=${out}"
9494
)
9595
target_link_libraries(${out} gunit)
9696
endfunction()

include/GUnit/GSteps.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,15 @@ class Steps : public ::testing::EmptyTestEventListener {
301301
public:
302302
Steps() {
303303
const auto scenario = std::getenv("SCENARIO");
304-
const auto output = std::getenv("OUTPUT");
304+
305305
if (scenario) {
306306
::testing::UnitTest::GetInstance()->listeners().Append(this);
307307
// If the output is set, then add a report to the features holder
308+
const auto output = std::getenv("OUTPUT");
309+
std::string path = std::string(output) + std::string(std::getenv("TEST_NAME"));
310+
std::cout << path << std::endl;
308311
if (output) {
309-
Features::getInstance()->addReport("gunit_result");
312+
Features::getInstance()->addReport(path);
310313
}
311314
for (const auto& feature : detail::split(scenario, ':')) {
312315
info_.file = feature;

0 commit comments

Comments
 (0)