mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-25 19:50:05 +00:00
Simplify compile tests.
This commit is contained in:
parent
ec7006fb99
commit
be17d14544
@ -28,12 +28,6 @@ add_subdirectory(doc)
|
|||||||
|
|
||||||
enable_testing()
|
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}
|
add_test(compile-test ${CMAKE_CTEST_COMMAND}
|
||||||
--build-and-test
|
--build-and-test
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/test"
|
"${CMAKE_CURRENT_SOURCE_DIR}/test"
|
||||||
|
@ -10,10 +10,13 @@ function (expect_compile_error code)
|
|||||||
${code}
|
${code}
|
||||||
}
|
}
|
||||||
" compiles)
|
" compiles)
|
||||||
if (compiles)
|
set (does_compile ${compiles})
|
||||||
|
# Unset the CMake cache variable compiles. Otherwise the compile test will
|
||||||
|
# just used cached information next time it runs.
|
||||||
|
unset(compiles CACHE)
|
||||||
|
if (does_compile)
|
||||||
error("No compile error for: ${code}")
|
error("No compile error for: ${code}")
|
||||||
endif ()
|
endif ()
|
||||||
unset(compiles CACHE)
|
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
# Writing a wide character to a character stream Writer is forbidden.
|
# Writing a wide character to a character stream Writer is forbidden.
|
||||||
|
Loading…
Reference in New Issue
Block a user