ENH: Adding test for source files and header files with the same base name in the same target.
This commit is contained in:
parent
8dda3a2f6e
commit
1973efbab2
@ -1,4 +1,7 @@
|
|||||||
|
// Include code from a header that should not be compiled separately.
|
||||||
|
#include "A.hh"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
return 10;
|
return A();
|
||||||
}
|
}
|
||||||
|
4
Tests/Complex/Executable/A.h
Normal file
4
Tests/Complex/Executable/A.h
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// This header should not be compiled directly but through inclusion
|
||||||
|
// in A.cxx through A.hh.
|
||||||
|
extern int A();
|
||||||
|
int A() { return 10; }
|
2
Tests/Complex/Executable/A.hh
Normal file
2
Tests/Complex/Executable/A.hh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// This header should not be compiled directly but through inclusion in A.cxx
|
||||||
|
#include "A.h"
|
@ -19,7 +19,7 @@ ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
|||||||
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
|
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
|
||||||
LINK_LIBRARIES(${COMPLEX_LIBS})
|
LINK_LIBRARIES(${COMPLEX_LIBS})
|
||||||
|
|
||||||
ADD_EXECUTABLE(A A.cxx)
|
ADD_EXECUTABLE(A A.cxx A.hh A.h)
|
||||||
ADD_EXECUTABLE(complex complex testcflags.c )
|
ADD_EXECUTABLE(complex complex testcflags.c )
|
||||||
# Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
|
# Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
|
||||||
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
|
// Include code from a header that should not be compiled separately.
|
||||||
|
#include "A.hh"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
return 10;
|
return A();
|
||||||
}
|
}
|
||||||
|
4
Tests/ComplexOneConfig/Executable/A.h
Normal file
4
Tests/ComplexOneConfig/Executable/A.h
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// This header should not be compiled directly but through inclusion
|
||||||
|
// in A.cxx through A.hh.
|
||||||
|
extern int A();
|
||||||
|
int A() { return 10; }
|
2
Tests/ComplexOneConfig/Executable/A.hh
Normal file
2
Tests/ComplexOneConfig/Executable/A.hh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// This header should not be compiled directly but through inclusion in A.cxx
|
||||||
|
#include "A.h"
|
@ -19,7 +19,7 @@ ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
|||||||
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
|
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
|
||||||
LINK_LIBRARIES(${COMPLEX_LIBS})
|
LINK_LIBRARIES(${COMPLEX_LIBS})
|
||||||
|
|
||||||
ADD_EXECUTABLE(A A.cxx)
|
ADD_EXECUTABLE(A A.cxx A.hh A.h)
|
||||||
ADD_EXECUTABLE(complex complex testcflags.c )
|
ADD_EXECUTABLE(complex complex testcflags.c )
|
||||||
# Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
|
# Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
|
||||||
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
|
// Include code from a header that should not be compiled separately.
|
||||||
|
#include "A.hh"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
return 10;
|
return A();
|
||||||
}
|
}
|
||||||
|
4
Tests/ComplexRelativePaths/Executable/A.h
Normal file
4
Tests/ComplexRelativePaths/Executable/A.h
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// This header should not be compiled directly but through inclusion
|
||||||
|
// in A.cxx through A.hh.
|
||||||
|
extern int A();
|
||||||
|
int A() { return 10; }
|
2
Tests/ComplexRelativePaths/Executable/A.hh
Normal file
2
Tests/ComplexRelativePaths/Executable/A.hh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// This header should not be compiled directly but through inclusion in A.cxx
|
||||||
|
#include "A.h"
|
@ -19,7 +19,7 @@ ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
|||||||
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
|
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
|
||||||
LINK_LIBRARIES(${COMPLEX_LIBS})
|
LINK_LIBRARIES(${COMPLEX_LIBS})
|
||||||
|
|
||||||
ADD_EXECUTABLE(A A.cxx)
|
ADD_EXECUTABLE(A A.cxx A.hh A.h)
|
||||||
ADD_EXECUTABLE(complex complex testcflags.c )
|
ADD_EXECUTABLE(complex complex testcflags.c )
|
||||||
# Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
|
# Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
|
||||||
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user