diff --git a/README.md b/README.md index ea21aac..1046057 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is a project template. Feel free to use it. It contains all pre-configured CMakeLists.txt, so to use it, just replace project name with your in [main CmakeLists.txt](CMakeLists.txt), and all target and executable names in -[CI/CD script](./.github/workflows/ci_tests.yml). +[CI/CD script](./.github/workflows/ci_tests.yml). Sample program prints first argument. ## How to run @@ -32,13 +32,13 @@ cmake --build cmake-build --target cpp_tests_tests * On Windows: ```shell -.\cmake-build\bin\cpp_tests.exe || .\cmake-build\bin\Debug\cpp_tests.exe +.\cmake-build\bin\cpp_tests.exe "Hello, World" || .\cmake-build\bin\Debug\cpp_tests.exe "Hello, World" ``` * On POSIX: ```shell -./cmake-build/bin/cpp_tests +./cmake-build/bin/cpp_tests "Hello, World" ``` 5. Run tests diff --git a/lib/ui/ui_functions.cpp b/lib/ui/ui_functions.cpp index 46b0d9d..0458cc3 100644 --- a/lib/ui/ui_functions.cpp +++ b/lib/ui/ui_functions.cpp @@ -8,6 +8,6 @@ int32_t StartConsoleUI(const std::vector& args, std::ostream& out) } MyClass printer(out); - printer.Print("Hello, World!\n"); + printer.Print(args[1] + "\n"); return 0; } diff --git a/tests/main_test.cpp b/tests/main_test.cpp index 3f5ee6a..8ad7124 100644 --- a/tests/main_test.cpp +++ b/tests/main_test.cpp @@ -2,8 +2,8 @@ #include #include "ProjectIntegrationTestSuite.hpp" -#include "test_functions.hpp" // include your library here -#include "lib/ui/ui_functions.hpp" +#include "test_functions.hpp" +#include "lib/ui/ui_functions.hpp" // include your library here TEST_F(ProjectIntegrationTestSuite, InitTest) { ASSERT_TRUE(std::filesystem::is_directory(kTemporaryDirectoryName)); @@ -11,13 +11,13 @@ TEST_F(ProjectIntegrationTestSuite, InitTest) { TEST_F(ProjectIntegrationTestSuite, PositiveTest1) { std::ostringstream out; - ASSERT_EQ(StartConsoleUI(SplitString("test -h"), out), 0); + ASSERT_EQ(StartConsoleUI(SplitString("test Hello!"), out), 0); } TEST_F(ProjectIntegrationTestSuite, PositiveOutputTest1) { std::ostringstream out; - StartConsoleUI(SplitString("test -h"), out); - ASSERT_EQ(out.str(), "Hello, World!\n"); + StartConsoleUI(SplitString("test Hello!"), out); + ASSERT_EQ(out.str(), "Hello!\n"); } TEST_F(ProjectIntegrationTestSuite, NegativeTest1) {