diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0aa6679..995ba7d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,34 +4,38 @@ # Create a list of common files needed for tests set( COMMON_FILE_LIST - c_test_framework.h - test_cases.include + include/c_test_framework.h + src/test_cases.include ) # Create the C test executable -add_executable(c_test fff_test_c.c ${COMMON_FILE_LIST}) +add_executable(c_test src/fff_test_c.c ${COMMON_FILE_LIST}) +target_include_directories(c_test PRIVATE include) target_link_libraries(c_test PRIVATE fff) # Create the C++ test executable -add_executable(cpp_test fff_test_cpp.cpp ${COMMON_FILE_LIST}) +add_executable(cpp_test src/fff_test_cpp.cpp ${COMMON_FILE_LIST}) +target_include_directories(cpp_test PRIVATE include) target_link_libraries(cpp_test PRIVATE gtest fff) # Create the C global test executable add_executable(c_global_test - fff_test_global_c.c - global_fakes.c - global_fakes.h + src/fff_test_global_c.c + src/global_fakes.c + include/global_fakes.h ${COMMON_FILE_LIST} ) +target_include_directories(c_global_test PRIVATE include) target_link_libraries(c_global_test PRIVATE fff) # Create the C++ global test executable add_executable(cpp_global_test - fff_test_global_cpp.cpp - global_fakes.c - global_fakes.h + src/fff_test_global_cpp.cpp + src/global_fakes.c + include/global_fakes.h ${COMMON_FILE_LIST} ) +target_include_directories(cpp_global_test PRIVATE include) target_link_libraries(cpp_global_test PRIVATE gtest fff) # Add the tests for ctest diff --git a/test/c_test_framework.h b/test/include/c_test_framework.h similarity index 100% rename from test/c_test_framework.h rename to test/include/c_test_framework.h diff --git a/test/global_fakes.h b/test/include/global_fakes.h similarity index 98% rename from test/global_fakes.h rename to test/include/global_fakes.h index 0530dd2..b76a9aa 100644 --- a/test/global_fakes.h +++ b/test/include/global_fakes.h @@ -1,8 +1,8 @@ #ifndef GLOBAL_FAKES_H_ #define GLOBAL_FAKES_H_ -#include "fff.h" -#include "string.h" +#include +#include //// Imaginary production code header file /// diff --git a/test/fff_test_c.c b/test/src/fff_test_c.c similarity index 100% rename from test/fff_test_c.c rename to test/src/fff_test_c.c diff --git a/test/fff_test_cpp.cpp b/test/src/fff_test_cpp.cpp similarity index 99% rename from test/fff_test_cpp.cpp rename to test/src/fff_test_cpp.cpp index b387ae2..153daef 100644 --- a/test/fff_test_cpp.cpp +++ b/test/src/fff_test_cpp.cpp @@ -13,7 +13,7 @@ #define FFF_CALL_HISTORY_LEN OVERRIDE_CALL_HIST_LEN #include "fff.h" -#include +#include "gtest/gtest.h" DEFINE_FFF_GLOBALS diff --git a/test/fff_test_global_c.c b/test/src/fff_test_global_c.c similarity index 100% rename from test/fff_test_global_c.c rename to test/src/fff_test_global_c.c diff --git a/test/fff_test_global_cpp.cpp b/test/src/fff_test_global_cpp.cpp similarity index 94% rename from test/fff_test_global_cpp.cpp rename to test/src/fff_test_global_cpp.cpp index f2cf79e..bb4993d 100644 --- a/test/fff_test_global_cpp.cpp +++ b/test/src/fff_test_global_cpp.cpp @@ -2,7 +2,7 @@ extern "C"{ #include "global_fakes.h" } -#include +#include "gtest/gtest.h" DEFINE_FFF_GLOBALS; diff --git a/test/global_fakes.c b/test/src/global_fakes.c similarity index 100% rename from test/global_fakes.c rename to test/src/global_fakes.c diff --git a/test/test_cases.include b/test/src/test_cases.include similarity index 100% rename from test/test_cases.include rename to test/src/test_cases.include