Skip to content

Commit

Permalink
feat: add google test as dependency with example test
Browse files Browse the repository at this point in the history
  • Loading branch information
jr0me committed Jul 17, 2024
1 parent 6348c8e commit da15031
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/agent/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Wazuh Agent tests

find_package(GTest CONFIG REQUIRED)

set(TEST_SOURCES
agent_test.cpp
)

add_executable(agent_test agent_test.cpp)
target_link_libraries(agent_test PRIVATE agent)
target_link_libraries(agent_test PRIVATE agent GTest::gtest)
add_test(NAME AgentTest COMMAND agent_test)
11 changes: 9 additions & 2 deletions src/agent/tests/agent_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#include <agent.hpp>

#include <gtest/gtest.h>

TEST(AgentTests, AgentConstruction)
{
EXPECT_NO_THROW(Agent {});
}

int main(int argc, char** argv)
{
Agent agent;
return 0;
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
1 change: 1 addition & 0 deletions src/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"name": "wazuh-agent-mvp",
"version": "5.0.0",
"dependencies": [
"gtest"
]
}

0 comments on commit da15031

Please sign in to comment.