Bläddra i källkod

Features: Test an expectation of whether OVERRIDE_CONTROL is expected

The tests below test the presence of both cxx_final and cxx_override,
only one of which is supported by MSVC.  The test is in part intended
to verify that the COMPILE_FEATURES genex supports multiple arguments
and allows users to define names for groups of features (Clang already
calls cxx_final and cxx_override 'override control' as a group).  Keep
the test, and allow the expectation to be set as appropriate.
Stephen Kelly 11 år sedan
förälder
incheckning
b3e86f4e97
2 ändrade filer med 4 tillägg och 0 borttagningar
  1. 2 0
      Tests/CompileFeatures/CMakeLists.txt
  2. 2 0
      Tests/CompileFeatures/genex_test.cpp

+ 2 - 0
Tests/CompileFeatures/CMakeLists.txt

@@ -120,6 +120,8 @@ if (CMAKE_CXX_COMPILE_FEATURES)
   add_executable(IfaceCompileFeatures main.cpp)
   add_executable(IfaceCompileFeatures main.cpp)
   target_link_libraries(IfaceCompileFeatures iface)
   target_link_libraries(IfaceCompileFeatures iface)
 
 
+  add_definitions(-DEXPECT_OVERRIDE_CONTROL=1)
+
   add_executable(CompileFeaturesGenex genex_test.cpp)
   add_executable(CompileFeaturesGenex genex_test.cpp)
   set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11)
   set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11)
   target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
   target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)

+ 2 - 0
Tests/CompileFeatures/genex_test.cpp

@@ -1,6 +1,8 @@
 
 
 #if !HAVE_OVERRIDE_CONTROL
 #if !HAVE_OVERRIDE_CONTROL
+#if EXPECT_OVERRIDE_CONTROL
 #error "Expect override control feature"
 #error "Expect override control feature"
+#endif
 #else
 #else
 
 
 struct A
 struct A