-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GTest has been integrated w/o it's sources in source tree
- Loading branch information
Ilya V. Storozhilov
authored and
Ilya V. Storozhilov
committed
Nov 20, 2014
1 parent
37ca760
commit 7802ab0
Showing
5 changed files
with
36 additions
and
0 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 +1,2 @@ | ||
add_subdirectory (functional) | ||
add_subdirectory (unit) |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
if ("${GMOCK_SOURCE_DIR}" STREQUAL "") | ||
message ("GMOCK_SOURCE_DIR variable not set - unit-tests are not available. Use '-DGMOCK_SOURCE_DIR=<path_to_gmock_sources>' param for CMake") | ||
else () | ||
set (gmock_force_shared_crt true CACHE INTERNAL "") | ||
set (BUILD_SHARED_LIBS false CACHE INTERNAL "") | ||
add_subdirectory (${GMOCK_SOURCE_DIR} ${CMAKE_BINARY_DIR}/gmock) | ||
set (GMOCK_LIBRARIES gmock) | ||
set (GMOCK_INCLUDE_DIRS "${GMOCK_SOURCE_DIR}/include" | ||
"${GMOCK_SOURCE_DIR}/gtest/include") | ||
include_directories (${CMAKE_SOURCE_DIR}/src ${GMOCK_INCLUDE_DIRS} ${GMOCK_SOURCE_DIR}) | ||
|
||
add_subdirectory (utils) | ||
endif () |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
set(UTILS_TEST_EXECUTABLE test_utils) | ||
aux_source_directory("." SRC_TEST_LIST) | ||
add_executable(${UTILS_TEST_EXECUTABLE} ${SRC_TEST_LIST}) | ||
target_link_libraries(${UTILS_TEST_EXECUTABLE} ${GMOCK_LIBRARIES}) | ||
add_test(test_utils ${UTILS_TEST_EXECUTABLE}) |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <gtest/gtest.h> | ||
#include <gmock/gmock.h> | ||
#include <utils/filtered_data.h> | ||
|
||
TEST(FilteredData, construct) | ||
{ | ||
EXPECT_NO_THROW(NST::utils::FilteredData()); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <gtest/gtest.h> | ||
#include <gmock/gmock.h> | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
setenv("LANG", "C", 1); | ||
::testing::InitGoogleTest(&argc, argv); | ||
return RUN_ALL_TESTS(); | ||
} |