mirror of
https://github.com/reactos/CMake.git
synced 2024-11-23 19:49:51 +00:00
ENH: added a tets for newlines in some commands
This commit is contained in:
parent
12b8643fee
commit
820aa6b961
15
Tests/NewlineArgs/CMakeLists.txt
Normal file
15
Tests/NewlineArgs/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
# a simple CXX only test case
|
||||
project (newlineargs CXX)
|
||||
|
||||
add_definitions("-DTEST_FLAG_1
|
||||
-DTEST_FLAG_2")
|
||||
|
||||
include_directories("${newlineargs_BINARY_DIR}
|
||||
${newlineargs_SOURCE_DIR}")
|
||||
|
||||
configure_file("${newlineargs_SOURCE_DIR}/libcxx2.h.in"
|
||||
"${newlineargs_BINARY_DIR}/libcxx2.h")
|
||||
|
||||
add_library(testcxx1 libcxx1.cxx)
|
||||
add_executable (cxxonly cxxonly.cxx)
|
||||
target_link_libraries(cxxonly testcxx1)
|
19
Tests/NewlineArgs/cxxonly.cxx
Normal file
19
Tests/NewlineArgs/cxxonly.cxx
Normal file
@ -0,0 +1,19 @@
|
||||
#include "libcxx1.h"
|
||||
#include "libcxx2.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
if ( LibCxx1Class::Method() != 2.0 )
|
||||
{
|
||||
printf("Problem with libcxx1\n");
|
||||
return 1;
|
||||
}
|
||||
#ifdef TEST_FLAG_3
|
||||
return 0;
|
||||
#else
|
||||
printf("Problem with libcxx2.h include dir probably!\n");
|
||||
return 1;
|
||||
#endif
|
||||
}
|
10
Tests/NewlineArgs/libcxx1.cxx
Normal file
10
Tests/NewlineArgs/libcxx1.cxx
Normal file
@ -0,0 +1,10 @@
|
||||
#include "libcxx1.h"
|
||||
|
||||
#ifdef TEST_FLAG_1
|
||||
#ifdef TEST_FLAG_2
|
||||
float LibCxx1Class::Method()
|
||||
{
|
||||
return 2.0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
9
Tests/NewlineArgs/libcxx1.h
Normal file
9
Tests/NewlineArgs/libcxx1.h
Normal file
@ -0,0 +1,9 @@
|
||||
class LibCxx1Class
|
||||
{
|
||||
public:
|
||||
#ifdef TEST_FLAG_1
|
||||
#ifdef TEST_FLAG_2
|
||||
static float Method();
|
||||
#endif
|
||||
#endif
|
||||
};
|
6
Tests/NewlineArgs/libcxx2.h.in
Normal file
6
Tests/NewlineArgs/libcxx2.h.in
Normal file
@ -0,0 +1,6 @@
|
||||
#ifdef TEST_FLAG_1
|
||||
#ifdef TEST_FLAG_2
|
||||
#define TEST_FLAG_3
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user