summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-01-25 21:16:54 (GMT)
committerBrad King <brad.king@kitware.com>2016-01-26 14:00:17 (GMT)
commit7c1171ce66c9fb256bac6dfc5ec3e62b1a22bc81 (patch)
tree7a3b97f90772e2e8dda7c227cb8ccff7c026fbd0 /test
parentc2391fb415ccd1f3a2cfeca40493ac190dd614bd (diff)
downloadCastXML-7c1171ce66c9fb256bac6dfc5ec3e62b1a22bc81.zip
CastXML-7c1171ce66c9fb256bac6dfc5ec3e62b1a22bc81.tar.gz
CastXML-7c1171ce66c9fb256bac6dfc5ec3e62b1a22bc81.tar.bz2
test: Run GNU-float128 test without an external compiler
Use our own `cc-gnu` test tool to activate the detection logic for `__float128` support.
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt83
1 files changed, 16 insertions, 67 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 97651f4..62a0535 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -340,71 +340,20 @@ castxml_test_gccxml_c(invalid)
castxml_test_gccxml_broken(ReferenceType-to-Class-template)
-#-----------------------------------------------------------------------------
-# Find a real GNU compiler to test with --castxml-cc-gnu.
-
-set(_gnu_C gcc)
-set(_gnu_CXX g++)
-
-foreach(lang C CXX)
- find_program(TEST_GNU_${lang} NAMES ${_gnu_${lang}} DOC "Path to GNU ${_gnu_${lang}} compiler for testing")
- # Exclude the Apple LLVM tool that is not really a GNU compiler.
- if(TEST_GNU_${lang})
- execute_process(
- COMMAND ${TEST_GNU_${lang}} --version
- OUTPUT_VARIABLE version
- ERROR_VARIABLE version
- RESULT_VARIABLE failed
- )
- if(failed OR version MATCHES "Apple LLVM")
- set(TEST_GNU_${lang} TEST_GNU_${lang}-NOTFOUND)
- endif()
- endif()
- if(TEST_GNU_${lang})
- message(STATUS "Found GNU ${lang} compiler '${TEST_GNU_${lang}}' to drive tests")
- endif()
-endforeach()
-
-if(TEST_GNU_C)
- set(castxml_test_gccxml_extra_arguments --castxml-cc-gnu-c ${TEST_GNU_C})
-
- # Check if the GNU compiler supports __float128 to enable test.
- execute_process(
- COMMAND ${TEST_GNU_C} -c ${CMAKE_CURRENT_SOURCE_DIR}/input/GNU-float128.c
- OUTPUT_VARIABLE out
- ERROR_VARIABLE out
- RESULT_VARIABLE failed_float128_c
- )
- if(NOT failed_float128_c)
- castxml_test_gccxml_c(GNU-float128)
- set(castxml_test_gccxml_custom_input GNU-float128)
- set(castxml_test_gccxml_custom_start "")
- castxml_test_gccxml_c(GNU-float128-nostart)
- unset(castxml_test_gccxml_custom_start)
- unset(castxml_test_gccxml_custom_input)
- endif()
-
- unset(castxml_test_gccxml_extra_arguments)
-endif()
-
-if(TEST_GNU_CXX)
- set(castxml_test_gccxml_extra_arguments --castxml-cc-gnu ${TEST_GNU_CXX})
-
- # Check if the GNU compiler supports __float128 to enable test.
- execute_process(
- COMMAND ${TEST_GNU_CXX} -c ${CMAKE_CURRENT_SOURCE_DIR}/input/GNU-float128.cxx
- OUTPUT_VARIABLE out
- ERROR_VARIABLE out
- RESULT_VARIABLE failed_float128_cxx
- )
- if(NOT failed_float128_cxx)
- castxml_test_gccxml(GNU-float128)
- set(castxml_test_gccxml_custom_input GNU-float128)
- set(castxml_test_gccxml_custom_start "")
- castxml_test_gccxml(GNU-float128-nostart)
- unset(castxml_test_gccxml_custom_start)
- unset(castxml_test_gccxml_custom_input)
- endif()
+set(castxml_test_gccxml_extra_arguments --castxml-cc-gnu-c "(" $<TARGET_FILE:cc-gnu> --cc-define=__x86_64__ ")")
+castxml_test_gccxml_c(GNU-float128)
+set(castxml_test_gccxml_custom_input GNU-float128)
+set(castxml_test_gccxml_custom_start "")
+castxml_test_gccxml_c(GNU-float128-nostart)
+unset(castxml_test_gccxml_custom_start)
+unset(castxml_test_gccxml_custom_input)
+unset(castxml_test_gccxml_extra_arguments)
- unset(castxml_test_gccxml_extra_arguments)
-endif()
+set(castxml_test_gccxml_extra_arguments --castxml-cc-gnu "(" $<TARGET_FILE:cc-gnu> --cc-define=__x86_64__ ")")
+castxml_test_gccxml(GNU-float128)
+set(castxml_test_gccxml_custom_input GNU-float128)
+set(castxml_test_gccxml_custom_start "")
+castxml_test_gccxml(GNU-float128-nostart)
+unset(castxml_test_gccxml_custom_start)
+unset(castxml_test_gccxml_custom_input)
+unset(castxml_test_gccxml_extra_arguments)