File: meson.build

package info (click to toggle)
gtksourceview4 4.8.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,384 kB
  • sloc: ansic: 50,318; xml: 1,432; javascript: 856; perl: 212; sh: 150; php: 48; yacc: 45; ruby: 38; sql: 30; cobol: 20; lisp: 19; objc: 19; makefile: 18; fortran: 14; python: 13; cpp: 8; ml: 3
file content (87 lines) | stat: -rw-r--r-- 2,488 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
test_env = [
  'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
  'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
  'G_DEBUG=gc-friendly',
  'GSETTINGS_BACKEND=memory',
  'MALLOC_CHECK_=2',
  'NO_AT_BRIDGE=1',
]

testsuite_c_args = [
  '-DG_LOG_DOMAIN="GtkSourceView"',
  '-DTOP_SRCDIR="@0@"'.format(srcdir),
  '-UG_DISABLE_ASSERT',
  '-UG_DISABLE_CAST_CHECKS',
]

testsuite_sources = [
  ['test-buffer'],
  ['test-buffer-input-stream'],
  ['test-buffer-output-stream'],
  ['test-completion-model'],
  ['test-completion-words'],
  ['test-encoding'],
  ['test-file-loader'],
  ['test-file-saver'],
  ['test-iter'],
  ['test-language'],
  ['test-languagemanager'],
  ['test-language-specs', false],
  ['test-mark'],
  ['test-printcompositor'],
  ['test-regex'],
  ['test-region'],
  ['test-search-context'],
  ['test-space-drawer'],
  ['test-stylescheme'],
  ['test-styleschememanager'],
  ['test-undo-manager'],
  ['test-utils'],
  ['test-view'],
]

foreach test: testsuite_sources
  test_name = test.get(0)
  install_test = test.get(1, true) and get_option('install_tests')
  test_sources = gtksource_res   [
    '@[email protected]'.format(test_name),
  ]

  # To allow our installed libraries to have some optimizations like
  # -Wl,Bsymbolic we cannot link against them here. It would cause
  # duplicate type registration which is an error for GObject.
  #
  # Furthermore, for MSVC we need to link to the main GtkSourceView .lib
  # except for test-stylescheme.c, where we must link only to the static core
  # lib.
  #
  # So instead we just always link the static libraries. Since these don't
  # get installed in the vast majority of cases, that is worth the extra
  # link and size bloat to make the common case better.
  test_exe = executable(test_name, test_sources,
          c_args: testsuite_c_args,
    dependencies: [core_dep, completionwords_dep],
         install: install_test,
     install_dir: testexecdir
  )

  test(test_name, test_exe, suite: package_string, env: test_env)

  if install_test
    test_t = configuration_data()
    test_t.set('testexecdir', testexecdir)
    test_t.set('test', test_name)

    configure_file(
              input: 'gtksourceview.test.in',
             output: '@[email protected]'.format(test_name),
      configuration: test_t,
        install_dir: testdatadir
    )
  endif
endforeach

if get_option('install_tests')
  install_subdir('language-specs', install_dir: testexecdir)
  install_subdir('styles', install_dir: testexecdir)
endif