Skip to content

Commit

Permalink
perf, cmake BUGFIX create env vars via cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Humblesaw authored and michalvasko committed Jul 26, 2024
1 parent 18d15ad commit 2769946
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 4 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ if(ENABLE_PERF_TESTS)
target_link_libraries(sr_perf sysrepo srobj)

add_test(NAME sr_perf_1000_10 COMMAND sr_perf 1000 10)
set_property(TEST sr_perf_1000_10 APPEND PROPERTY ENVIRONMENT
"SYSREPO_REPOSITORY_PATH=${PROJECT_BINARY_DIR}/test_repositories/sr_perf"
"SYSREPO_SHM_PREFIX=_tests_sr_sr_perf"
)

if(${CMAKE_VERSION} VERSION_GREATER "3.7")
set_tests_properties(sr_perf_1000_10 PROPERTIES FIXTURES_REQUIRED tests_cleanup)
Expand Down
8 changes: 0 additions & 8 deletions tests/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,14 +839,6 @@ sysrepo_init(const char *plg_name, struct test_state *state, uint32_t count)
}
mod_ds.plugin_name[5] = "JSON notif";

/* setup env */
if ((ret = setenv("SYSREPO_REPOSITORY_PATH", TESTS_REPO_DIR "/test_repositories/sr_perf", 1))) {
return ret;
}
if ((ret = setenv("SYSREPO_SHM_PREFIX", "_tests_sr_sr_perf", 1))) {
return ret;
}

/* turn on logging */
sr_log_stderr(SR_LL_WRN);

Expand Down

0 comments on commit 2769946

Please sign in to comment.