Skip to content

Commit

Permalink
Merge pull request iovisor#4165 from chantra/fix_module_search_test
Browse files Browse the repository at this point in the history
[test] fix module search test
  • Loading branch information
davemarchevsky committed Aug 12, 2022
2 parents b7e5638 + fd473d7 commit 3130f0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/cc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ else()
endif()

add_test(NAME c_test_static COMMAND ${TEST_WRAPPER} c_test_static sudo ${CMAKE_CURRENT_BINARY_DIR}/test_static)
add_compile_options(-DCMAKE_CURRENT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result -fPIC")
Expand Down
4 changes: 3 additions & 1 deletion tests/cc/test_c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#include "catch.hpp"


using namespace std;

static pid_t spawn_child(void *, bool, bool, int (*)(void *));
Expand Down Expand Up @@ -495,7 +496,8 @@ struct mod_search {
};

TEST_CASE("searching for modules in /proc/[pid]/maps", "[c_api][!mayfail]") {
FILE *dummy_maps = fopen("dummy_proc_map.txt", "r");
std::string dummy_maps_path = CMAKE_CURRENT_BINARY_DIR + std::string("/dummy_proc_map.txt");
FILE *dummy_maps = fopen(dummy_maps_path.c_str(), "r");
REQUIRE(dummy_maps != NULL);

SECTION("name match") {
Expand Down

0 comments on commit 3130f0f

Please sign in to comment.