-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add google test as dependency with example test
- Loading branch information
Showing
3 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
"name": "wazuh-agent-mvp", | ||
"version": "5.0.0", | ||
"dependencies": [ | ||
"gtest" | ||
] | ||
} |