CMakeLists.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # ArduinoJson - https://arduinojson.org
  2. # Copyright © 2014-2022, Benoit BLANCHON
  3. # MIT License
  4. macro(build_should_fail target)
  5. set_target_properties(${target}
  6. PROPERTIES
  7. EXCLUDE_FROM_ALL TRUE
  8. EXCLUDE_FROM_DEFAULT_BUILD TRUE
  9. )
  10. add_test(
  11. NAME
  12. ${target}
  13. COMMAND
  14. ${CMAKE_COMMAND} --build . --target ${target} --config $<CONFIGURATION>
  15. WORKING_DIRECTORY
  16. ${CMAKE_BINARY_DIR}
  17. )
  18. set_tests_properties(${target}
  19. PROPERTIES
  20. WILL_FAIL TRUE
  21. LABELS "WillFail;Catch"
  22. )
  23. endmacro()
  24. add_executable(Issue978 Issue978.cpp)
  25. build_should_fail(Issue978)
  26. add_executable(Issue1189 Issue1189.cpp)
  27. build_should_fail(Issue1189)
  28. add_executable(read_long_long read_long_long.cpp)
  29. set_property(TARGET read_long_long PROPERTY CXX_STANDARD 11)
  30. build_should_fail(read_long_long)
  31. add_executable(write_long_long write_long_long.cpp)
  32. set_property(TARGET write_long_long PROPERTY CXX_STANDARD 11)
  33. build_should_fail(write_long_long)
  34. add_executable(delete_jsondocument delete_jsondocument.cpp)
  35. build_should_fail(delete_jsondocument)
  36. add_executable(variant_as_char variant_as_char.cpp)
  37. build_should_fail(variant_as_char)
  38. add_executable(assign_char assign_char.cpp)
  39. build_should_fail(assign_char)