Add compile error tests.

This commit is contained in:
Victor Zverovich
2014-01-02 11:31:53 -08:00
parent 6038c85231
commit 9bf11d057c
2 changed files with 34 additions and 6 deletions

12
test/CMakeLists.txt Normal file
View File

@@ -0,0 +1,12 @@
# 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 ()