mirror of
https://github.com/meekrosoft/fff
synced 2026-01-23 00:15:59 +01:00
Refactor test/ directory to match the rest of the project.
The prior PR didn't touch this directory because it was getting too big and I wanted the diff to be smaller for the test directory. Now addressing that. Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef GLOBAL_FAKES_H_
|
||||
#define GLOBAL_FAKES_H_
|
||||
|
||||
#include "fff.h"
|
||||
#include "string.h"
|
||||
#include <fff.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
//// Imaginary production code header file ///
|
||||
@@ -13,7 +13,7 @@
|
||||
#define FFF_CALL_HISTORY_LEN OVERRIDE_CALL_HIST_LEN
|
||||
|
||||
#include "fff.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
DEFINE_FFF_GLOBALS
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
extern "C"{
|
||||
#include "global_fakes.h"
|
||||
}
|
||||
#include <gtest/gtest.h>
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
DEFINE_FFF_GLOBALS;
|
||||
|
||||
Reference in New Issue
Block a user