Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
9bf11d05
Commit
9bf11d05
authored
Jan 02, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add compile error tests.
parent
6038c852
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
6 deletions
+34
-6
CMakeLists.txt
CMakeLists.txt
+22
-6
test/CMakeLists.txt
test/CMakeLists.txt
+12
-0
No files found.
CMakeLists.txt
View file @
9bf11d05
...
...
@@ -26,6 +26,21 @@ endif ()
add_subdirectory
(
doc
)
enable_testing
()
# Remove the CMake cache in the test directory so that CMake
# performed full configuration. Otherwise compile-test will
# just used cached information.
add_test
(
prepare-test
${
CMAKE_COMMAND
}
-E remove
${
CMAKE_CURRENT_BINARY_DIR
}
/test/CMakeCache.txt
)
add_test
(
compile-test
${
CMAKE_CTEST_COMMAND
}
--build-and-test
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/test"
--build-generator
${
CMAKE_GENERATOR
}
--build-makeprogram
${
CMAKE_MAKE_PROGRAM
}
)
# We compile Google Test ourselves instead of using pre-compiled libraries.
# See the Google Test FAQ "Why is it not recommended to install a
# pre-compiled copy of Google Test (for example, into /usr/local)?"
...
...
@@ -38,19 +53,20 @@ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Clang"
)
add_definitions
(
-DGTEST_USE_OWN_TR1_TUPLE=1
)
endif
()
add_subdirectory
(
gtest
)
include_directories
(
gtest/include
)
link_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
/gtest
)
enable_testing
()
add_executable
(
format
_test format_
test.cc
)
target_link_libraries
(
format
_
test format gtest
)
add_executable
(
format
-test format-
test.cc
)
target_link_libraries
(
format
-
test format gtest
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
set_target_properties
(
format
_
test PROPERTIES COMPILE_FLAGS
set_target_properties
(
format
-
test PROPERTIES COMPILE_FLAGS
"-Wall -Wextra -pedantic -Wno-long-long -Wno-variadic-macros"
)
endif
()
add_test
(
format
_test format_
test
)
add_test
(
format
-test format-
test
)
if
(
HAVE_STD_CPP11_FLAG
)
set_target_properties
(
format
_
test PROPERTIES COMPILE_FLAGS
"-std=c++11"
)
set_target_properties
(
format
-
test PROPERTIES COMPILE_FLAGS
"-std=c++11"
)
endif
()
endif
()
...
...
test/CMakeLists.txt
0 → 100644
View file @
9bf11d05
# Test if compile errors are produced where necessary.
include
(
CheckCXXSourceCompiles
)
set
(
CMAKE_REQUIRED_INCLUDES
${
CMAKE_CURRENT_SOURCE_DIR
}
/..
)
check_cxx_source_compiles
(
"
#include
\"
format.cc
\"
int main() { fmt::Writer() << L'a'; }
"
WRITE_WCHAR_COMPILES
)
if
(
WRITE_WCHAR_COMPILES
)
error
(
"No compile error for: fmt::Writer() << L'a'"
)
endif
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment