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
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 cases
  23. FILE( COPY "${CMAKE_CURRENT_LIST_DIR}/test.xml"
  24. DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
  25. )
  26. FILE( COPY "${CMAKE_CURRENT_LIST_DIR}/test-attributes.xml"
  27. DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
  28. )
  29. # Test (C)
  30. add_executable(
  31. "${PROJECT_NAME}-test-c"
  32. "${CMAKE_CURRENT_LIST_DIR}/test-xml-c.c"
  33. )
  34. target_compile_options(
  35. "${PROJECT_NAME}-test-c"
  36. PRIVATE
  37. -std=c11
  38. )
  39. target_link_libraries(
  40. "${PROJECT_NAME}-test-c"
  41. PRIVATE
  42. xml
  43. )
  44. add_test(
  45. NAME "${PROJECT_NAME}-test-c"
  46. COMMAND "${PROJECT_NAME}-test-c"
  47. )
  48. add_test(
  49. NAME "${PROJECT_NAME}-test-c-valgrind"
  50. COMMAND valgrind --tool=memcheck --leak-check=full --track-origins=yes -v "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-test-c"
  51. )
  52. # Test (C++)
  53. add_executable(
  54. "${PROJECT_NAME}-test-cpp"
  55. "${CMAKE_CURRENT_LIST_DIR}/test-xml-cpp.cpp"
  56. )
  57. target_compile_options(
  58. "${PROJECT_NAME}-test-cpp"
  59. PRIVATE
  60. -std=c++11
  61. )
  62. target_link_libraries(
  63. "${PROJECT_NAME}-test-cpp"
  64. PRIVATE
  65. xml
  66. )
  67. add_test(
  68. NAME "${PROJECT_NAME}-test-cpp"
  69. COMMAND "${PROJECT_NAME}-test-cpp"
  70. )
  71. add_test(
  72. NAME "${PROJECT_NAME}-test-cpp-valgrind"
  73. COMMAND valgrind --tool=memcheck --leak-check=full --track-origins=yes -v "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-test-cpp"
  74. )
  75. # Test huitre39
  76. add_executable(
  77. "${PROJECT_NAME}-test-huitre39"
  78. "${CMAKE_CURRENT_LIST_DIR}/test-huitre39.c"
  79. )
  80. target_compile_options(
  81. "${PROJECT_NAME}-test-huitre39"
  82. PRIVATE
  83. -std=c11
  84. )
  85. target_link_libraries(
  86. "${PROJECT_NAME}-test-huitre39"
  87. PRIVATE
  88. xml
  89. )
  90. add_test(
  91. NAME "${PROJECT_NAME}-test-huitre39"
  92. COMMAND "${PROJECT_NAME}-test-huitre39"
  93. )