ENH: allow multiple files with the same name in different sub dirs test
This commit is contained in:
parent
69488e5bd2
commit
0f8603acc2
|
@ -20,7 +20,8 @@ SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared
|
||||||
LINK_LIBRARIES(${COMPLEX_LIBS})
|
LINK_LIBRARIES(${COMPLEX_LIBS})
|
||||||
|
|
||||||
ADD_EXECUTABLE(A A.cxx)
|
ADD_EXECUTABLE(A A.cxx)
|
||||||
ADD_EXECUTABLE(complex complex testcflags.c)
|
ADD_EXECUTABLE(complex complex testcflags.c
|
||||||
|
Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
|
||||||
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
||||||
IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
||||||
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar)
|
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar)
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
int NameConflictTest1()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
int NameConflictTest2()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -290,6 +290,11 @@ void ForceStringUse()
|
||||||
extern "C" int TestCFlags(char* m);
|
extern "C" int TestCFlags(char* m);
|
||||||
extern "C" int TestTargetCompileFlags(char* m);
|
extern "C" int TestTargetCompileFlags(char* m);
|
||||||
|
|
||||||
|
// defined in Sub1/NameConflictTest.c
|
||||||
|
extern "C" int NameConflictTest1();
|
||||||
|
// defined in Sub2/NameConflictTest.c
|
||||||
|
extern "C" int NameConflictTest2();
|
||||||
|
|
||||||
// ======================================================================
|
// ======================================================================
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -395,7 +400,14 @@ int main()
|
||||||
cmFailed("cmSystemTools::UpperCase is working");
|
cmFailed("cmSystemTools::UpperCase is working");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if(NameConflictTest1() == 0 && NameConflictTest2() == 0)
|
||||||
|
{
|
||||||
|
cmPassed("Sub dir with same named source works");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmFailed("Sub dir with same named source fails");
|
||||||
|
}
|
||||||
if(file1() != 1)
|
if(file1() != 1)
|
||||||
{
|
{
|
||||||
cmFailed("Call to file1 function from library failed.");
|
cmFailed("Call to file1 function from library failed.");
|
||||||
|
|
|
@ -20,7 +20,8 @@ SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared
|
||||||
LINK_LIBRARIES(${COMPLEX_LIBS})
|
LINK_LIBRARIES(${COMPLEX_LIBS})
|
||||||
|
|
||||||
ADD_EXECUTABLE(A A.cxx)
|
ADD_EXECUTABLE(A A.cxx)
|
||||||
ADD_EXECUTABLE(complex complex testcflags.c)
|
ADD_EXECUTABLE(complex complex testcflags.c
|
||||||
|
Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
|
||||||
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
||||||
IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
||||||
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar)
|
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar)
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
int NameConflictTest1()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
int NameConflictTest2()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -290,6 +290,11 @@ void ForceStringUse()
|
||||||
extern "C" int TestCFlags(char* m);
|
extern "C" int TestCFlags(char* m);
|
||||||
extern "C" int TestTargetCompileFlags(char* m);
|
extern "C" int TestTargetCompileFlags(char* m);
|
||||||
|
|
||||||
|
// defined in Sub1/NameConflictTest.c
|
||||||
|
extern "C" int NameConflictTest1();
|
||||||
|
// defined in Sub2/NameConflictTest.c
|
||||||
|
extern "C" int NameConflictTest2();
|
||||||
|
|
||||||
// ======================================================================
|
// ======================================================================
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -395,7 +400,14 @@ int main()
|
||||||
cmFailed("cmSystemTools::UpperCase is working");
|
cmFailed("cmSystemTools::UpperCase is working");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if(NameConflictTest1() == 0 && NameConflictTest2() == 0)
|
||||||
|
{
|
||||||
|
cmPassed("Sub dir with same named source works");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmFailed("Sub dir with same named source fails");
|
||||||
|
}
|
||||||
if(file1() != 1)
|
if(file1() != 1)
|
||||||
{
|
{
|
||||||
cmFailed("Call to file1 function from library failed.");
|
cmFailed("Call to file1 function from library failed.");
|
||||||
|
|
|
@ -20,7 +20,8 @@ SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared
|
||||||
LINK_LIBRARIES(${COMPLEX_LIBS})
|
LINK_LIBRARIES(${COMPLEX_LIBS})
|
||||||
|
|
||||||
ADD_EXECUTABLE(A A.cxx)
|
ADD_EXECUTABLE(A A.cxx)
|
||||||
ADD_EXECUTABLE(complex complex testcflags.c)
|
ADD_EXECUTABLE(complex complex testcflags.c
|
||||||
|
Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
|
||||||
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
ADD_EXECUTABLE(complex.file complex.file.cxx)
|
||||||
IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
||||||
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar)
|
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar)
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
int NameConflictTest1()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
int NameConflictTest2()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -290,6 +290,11 @@ void ForceStringUse()
|
||||||
extern "C" int TestCFlags(char* m);
|
extern "C" int TestCFlags(char* m);
|
||||||
extern "C" int TestTargetCompileFlags(char* m);
|
extern "C" int TestTargetCompileFlags(char* m);
|
||||||
|
|
||||||
|
// defined in Sub1/NameConflictTest.c
|
||||||
|
extern "C" int NameConflictTest1();
|
||||||
|
// defined in Sub2/NameConflictTest.c
|
||||||
|
extern "C" int NameConflictTest2();
|
||||||
|
|
||||||
// ======================================================================
|
// ======================================================================
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -395,7 +400,14 @@ int main()
|
||||||
cmFailed("cmSystemTools::UpperCase is working");
|
cmFailed("cmSystemTools::UpperCase is working");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if(NameConflictTest1() == 0 && NameConflictTest2() == 0)
|
||||||
|
{
|
||||||
|
cmPassed("Sub dir with same named source works");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmFailed("Sub dir with same named source fails");
|
||||||
|
}
|
||||||
if(file1() != 1)
|
if(file1() != 1)
|
||||||
{
|
{
|
||||||
cmFailed("Call to file1 function from library failed.");
|
cmFailed("Call to file1 function from library failed.");
|
||||||
|
|
Loading…
Reference in New Issue