Simple XML subset parser comparable to glib's Markup parser, but without any dependencies in one self contained file. Forked from https://github.com/ooxi/xml.c
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

99 lignes
1.5 KiB

  1. # xml.c / test
  2. cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
  3. # Example
  4. add_executable(
  5. "${PROJECT_NAME}-example"
  6. "${CMAKE_CURRENT_LIST_DIR}/example.c"
  7. )
  8. target_compile_options(
  9. "${PROJECT_NAME}-example"
  10. PRIVATE
  11. -std=c11
  12. )
  13. target_link_libraries(
  14. "${PROJECT_NAME}-example"
  15. PRIVATE
  16. xml
  17. )
  18. add_test(
  19. NAME "${PROJECT_NAME}-example"
  20. COMMAND "${PROJECT_NAME}-example"
  21. )
  22. # Test case
  23. FILE( COPY "${CMAKE_CURRENT_LIST_DIR}/test.xml"
  24. DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
  25. )
  26. # Test (C)
  27. add_executable(
  28. "${PROJECT_NAME}-test-c"
  29. "${CMAKE_CURRENT_LIST_DIR}/test-xml-c.c"
  30. )
  31. target_compile_options(
  32. "${PROJECT_NAME}-test-c"
  33. PRIVATE
  34. -std=c11
  35. )
  36. target_link_libraries(
  37. "${PROJECT_NAME}-test-c"
  38. PRIVATE
  39. xml
  40. )
  41. add_test(
  42. NAME "${PROJECT_NAME}-test-c"
  43. COMMAND "${PROJECT_NAME}-test-c"
  44. )
  45. add_test(
  46. NAME "${PROJECT_NAME}-test-c-valgrind"
  47. COMMAND valgrind --tool=memcheck --leak-check=full --track-origins=yes -v "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-test-c"
  48. )
  49. # Test (C++)
  50. add_executable(
  51. "${PROJECT_NAME}-test-cpp"
  52. "${CMAKE_CURRENT_LIST_DIR}/test-xml-cpp.cpp"
  53. )
  54. target_compile_options(
  55. "${PROJECT_NAME}-test-cpp"
  56. PRIVATE
  57. -std=c++11
  58. )
  59. target_link_libraries(
  60. "${PROJECT_NAME}-test-cpp"
  61. PRIVATE
  62. xml
  63. )
  64. add_test(
  65. NAME "${PROJECT_NAME}-test-cpp"
  66. COMMAND "${PROJECT_NAME}-test-cpp"
  67. )
  68. add_test(
  69. NAME "${PROJECT_NAME}-test-cpp-valgrind"
  70. COMMAND valgrind --tool=memcheck --leak-check=full --track-origins=yes -v "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-test-cpp"
  71. )