Add test that CMake errors with empty libs
When the library language cannot be determined, make sure CMake errors, not segfaults (bug #11230)
This commit is contained in:
parent
4e137de7b1
commit
220c5dc45a
|
@ -153,6 +153,9 @@ IF(BUILD_TESTING)
|
||||||
ADD_TEST_MACRO(ExportImport ExportImport)
|
ADD_TEST_MACRO(ExportImport ExportImport)
|
||||||
ADD_TEST_MACRO(Unset Unset)
|
ADD_TEST_MACRO(Unset Unset)
|
||||||
ADD_TEST_MACRO(PolicyScope PolicyScope)
|
ADD_TEST_MACRO(PolicyScope PolicyScope)
|
||||||
|
ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
|
||||||
|
SET_TESTS_PROPERTIES(EmptyLibrary PROPERTIES
|
||||||
|
PASS_REGULAR_EXPRESSION "CMake Error: Cannot determine link language for target \"test\"")
|
||||||
ADD_TEST_MACRO(CrossCompile CrossCompile)
|
ADD_TEST_MACRO(CrossCompile CrossCompile)
|
||||||
SET_TESTS_PROPERTIES(CrossCompile PROPERTIES
|
SET_TESTS_PROPERTIES(CrossCompile PROPERTIES
|
||||||
PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode")
|
PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode")
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
cmake_minimum_required(VERSION 2.6)
|
||||||
|
project(TestEmptyLibrary)
|
||||||
|
|
||||||
|
add_subdirectory(subdir)
|
|
@ -0,0 +1 @@
|
||||||
|
add_library(test test.h)
|
|
@ -0,0 +1 @@
|
||||||
|
extern int dummy;
|
Loading…
Reference in New Issue