diff --git a/posix.h b/posix.h index 70a0db1a..068f6638 100644 --- a/posix.h +++ b/posix.h @@ -41,10 +41,6 @@ #include "format.h" -#ifdef FMT_INCLUDE_POSIX_TEST -# include "test/posix-test.h" -#endif - #ifndef FMT_POSIX # if defined(_WIN32) && !defined(__MINGW32__) // Fix warnings about deprecated symbols. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6eaddb80..73ac11d2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -62,9 +62,7 @@ add_executable(macro-test macro-test.cc ${FMT_TEST_SOURCES} ${TEST_MAIN_SRC}) target_link_libraries(macro-test gmock) if (HAVE_OPEN) - add_executable(posix-test posix-test.cc ${FMT_TEST_SOURCES} ${TEST_MAIN_SRC}) - set_target_properties(posix-test - PROPERTIES COMPILE_DEFINITIONS "FMT_INCLUDE_POSIX_TEST=1") + add_executable(posix-test posix-mock-test.cc ../format.cc ${TEST_MAIN_SRC}) target_link_libraries(posix-test gmock) add_test(NAME posix-test COMMAND posix-test) endif () diff --git a/test/posix-test.cc b/test/posix-mock-test.cc similarity index 98% rename from test/posix-test.cc rename to test/posix-mock-test.cc index a914ae7b..efd47e21 100644 --- a/test/posix-test.cc +++ b/test/posix-mock-test.cc @@ -1,7 +1,7 @@ /* - Test wrappers around POSIX functions. + Tests of the C++ interface to POSIX functions that require mocks - Copyright (c) 2012-2014, Victor Zverovich + Copyright (c) 2012-2015, Victor Zverovich All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,7 +28,8 @@ // Disable bogus MSVC warnings. #define _CRT_SECURE_NO_WARNINGS -#include "posix-test.h" +#include "posix-mock.h" +#include "posix.cc" #include #include diff --git a/test/posix-test.h b/test/posix-mock.h similarity index 96% rename from test/posix-test.h rename to test/posix-mock.h index 19b3e76f..32dd6639 100644 --- a/test/posix-test.h +++ b/test/posix-mock.h @@ -1,7 +1,7 @@ /* - Test wrappers around POSIX functions. + Mocks of POSIX functions - Copyright (c) 2012-2014, Victor Zverovich + Copyright (c) 2012-2015, Victor Zverovich All rights reserved. Redistribution and use in source and binary forms, with or without