meson.build 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Included from top-level meson.build
  2. ## Includes
  3. for_tests_incdir = include_directories(
  4. 'includes/',
  5. '../../dasynq/include/'
  6. )
  7. for_tests_dinit_sources = [
  8. '../service.cc',
  9. '../proc-service.cc',
  10. '../dinit-log.cc',
  11. '../load-service.cc',
  12. '../baseproc-service.cc',
  13. '../dinit-env.cc'
  14. ]
  15. for_tests_general_sources = [
  16. 'test-dinit.cc',
  17. 'test-bpsys.cc',
  18. 'test-run-child-proc.cc'
  19. ]
  20. ## Write mconfig.h from top-level meson.build
  21. configure_file(
  22. output : 'mconfig.h',
  23. configuration : mconfig_data
  24. )
  25. ## Prepare loadtests
  26. run_command([
  27. 'cp',
  28. '-r',
  29. meson.current_source_dir() + '/test-services',
  30. meson.current_build_dir()
  31. ],
  32. check : true
  33. )
  34. ## Outputs
  35. # Unit tests
  36. tests_exec = executable(
  37. 'tests',
  38. 'tests.cc',
  39. for_tests_general_sources,
  40. for_tests_dinit_sources,
  41. include_directories : for_tests_incdir
  42. )
  43. proctests_exec = executable(
  44. 'proctests',
  45. 'proctests.cc',
  46. for_tests_general_sources,
  47. for_tests_dinit_sources,
  48. include_directories : for_tests_incdir
  49. )
  50. loadtests_exec = executable(
  51. 'loadtests',
  52. 'loadtests.cc',
  53. for_tests_general_sources,
  54. for_tests_dinit_sources,
  55. include_directories : for_tests_incdir
  56. )
  57. envtests_exec = executable(
  58. 'envtests',
  59. 'envtests.cc',
  60. for_tests_general_sources,
  61. for_tests_dinit_sources,
  62. include_directories : for_tests_incdir
  63. )
  64. test('tests', tests_exec, suite : 'unit_tests')
  65. test('proctests', proctests_exec, suite : 'unit_tests')
  66. test('loadtests', loadtests_exec, workdir : meson.current_build_dir(), suite : 'unit_tests')
  67. test('envtests', envtests_exec, suite : 'unit_tests')
  68. subdir('cptests/')