File: meson.build

package info (click to toggle)
flatpak-builder 1.4.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,436 kB
  • sloc: ansic: 29,646; sh: 6,649; xml: 1,955; makefile: 170; python: 6
file content (121 lines) | stat: -rw-r--r-- 3,239 bytes parent folder | download
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
installed_testdir = get_option('prefix') / get_option('libexecdir') / 'installed-tests' / 'flatpak-builder'
installed_tests_metadir = get_option('prefix') / get_option('datadir') / 'installed-tests' / 'flatpak-builder'

test_env = environment()
test_env.set('FLATPAK_TESTS_DEBUG', '1')
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
test_env.prepend('PATH', meson.current_build_dir() / '..' / 'src', separator: ':')

test_names = [
  'test-builder',
  'test-builder-deprecated',
  'test-builder-python',
]

tap_test = find_program(
  files(meson.project_source_root() / 'buildutil/tap-test'),
)

foreach test_name : test_names
  filename = test_name + '.sh'

  test(
    test_name,
    tap_test,
    args: [files(filename)],
    env: test_env,
    depends: flatpak_builder,
    protocol: 'tap',
    workdir: meson.current_build_dir(),
  )

  if get_option('installed_tests')
    install_data(
      filename,
      install_dir : installed_testdir,
      install_mode : 'rwxr-xr-x',
    )
    configure_file(
      input: 'tap.test.in',
      output: filename + '.test',
      configuration: {
        # After dropping Autotools we could use test_name here (avoiding the
        # redudant .sh), but for now include the .sh to keep the installed
        # files easier to compare with Autotools
        'basename': filename,
        'installed_testdir': installed_testdir,
        'wrapper': '',
      },
      install_dir: installed_tests_metadir,
    )
  endif
endforeach

if get_option('installed_tests')
  install_data(
    'empty-configure',
    'make-test-app.sh',
    'make-test-bundles.sh',
    'make-test-runtime.sh',
    'test-configure',
    'testpython.py',

    install_dir: installed_testdir,
    install_mode: 'rwxr-xr-x',
  )
  install_data(
    '0001-Add-test-logo.patch',
    'data1',
    'data1.patch',
    'data2',
    'data2.patch',
    'hello.sh',
    'hello.tar.xz',
    'importme.py',
    'importme2.py',
    'libtest.sh',
    'module1.json',
    'module1.yaml',
    'module2.json',
    'module2.yaml',
    'org.test.Deprecated.MD5.archive.json',
    'org.test.Deprecated.MD5.archive.yaml',
    'org.test.Deprecated.MD5.file.json',
    'org.test.Deprecated.MD5.file.yaml',
    'org.test.Deprecated.SHA1.archive.json',
    'org.test.Deprecated.SHA1.archive.yaml',
    'org.test.Deprecated.SHA1.file.json',
    'org.test.Deprecated.SHA1.file.yaml',
    'org.test.Hello.png',
    'org.test.Hello.desktop',
    'org.test.Hello.appdata.xml',
    'Hello.desktop',
    'org.test.Hello.xml',
    'Hello.xml',
    'Hello.appdata.xml',
    'Hello-desktop.appdata.xml',
    'org.test.Python.json',
    'org.test.Python2.json',
    'session.conf.in',
    'source1.json',
    'source2.json',
    'test-rename.json',
    'test-rename-appdata.json',
    'test-runtime.json',
    'test.json',
    'test.yaml',
    'org.flatpak_builder.gui.desktop',
    'org.flatpak_builder.gui.json',
    'org.flatpak_builder.gui.metainfo.xml',
    'org.flatpak.appstream_media.json',
    'org.test.Hello-256.png',
    'org.flatpak.install_test.json',

    install_dir: installed_testdir,
    install_mode: 'rw-r--r--',
  )
endif

subdir('test-keyring')
subdir('test-keyring2')