aboutsummaryrefslogtreecommitdiff
path: root/tests/meson.build
blob: 5c60d484eeb8a02e1a1edf304d398c5079168116 (plain)
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
# CrystFEL unit tests

# Test wrapper scripts for process_hkl
process_hkl_tests = ['process_hkl_check_1',
                     'process_hkl_check_2',
                     'process_hkl_check_3',
                     'process_hkl_check_4']

foreach name : process_hkl_tests
  exe = find_program(name)
  test(name, exe, args : [process_hkl.full_path()])
endforeach


# Test wrapper scripts for partialator
partialator_tests = ['partialator_merge_check_1',
                     'partialator_merge_check_2',
                     'partialator_merge_check_3']

foreach name : partialator_tests
  exe = find_program(name)
  test(name, exe, args : [partialator.full_path()])
endforeach


# Easy unit tests of libcrystfel functions
simple_tests = ['ambi_check',
                'cell_check',
                'centering_check',
                'list_check',
                'prediction_gradient_check',
                'ring_check',
                'symmetry_check',
                'transformation_check',
                'rational_check',
                'spectrum_check',
                'cellcompare_check',
                'evparse1',
                'evparse2',
                'evparse3',
                'evparse4',
                'evparse5',
                'evparse6',
                'evparse7']

foreach name : simple_tests
  exe = executable(name, ''.join([name, '.c']),
                   dependencies : [libcrystfeldep, mdep, gsldep, hdf5dep],
		   include_directories: conf_inc)

  test(name, exe, timeout : 60)
endforeach


# Less easy unit tests for libcrystfel functions
exe = executable('integration_check',
                 ['integration_check.c',
                  'histogram.c'],
                 dependencies : [libcrystfeldep, mdep, gsldep])
test('integration_check', exe)

exe = executable('prof2d_check',
                 ['prof2d_check.c',
                  'histogram.c'],
                 dependencies : [libcrystfeldep, mdep, gsldep])
test('prof2d_check', exe)

exe = executable('gpu_sim_check',
                 ['gpu_sim_check.c',
                  simulation_bits],
                 dependencies : [libcrystfeldep, mdep, gsldep, opencldep],
		 include_directories: conf_inc)
geom = files('gpu_sim_check.geom')
test('gpu_sim_check', exe, args: [geom])

exe = executable('polarisation_check',
                 ['polarisation_check.c'],
                 dependencies : [libcrystfeldep, mdep, gsldep])
geom = files('polarisation_check.geom')
test('polarisation_check', exe, args: [geom],
     timeout: 60)


# Event enumeration tests
ev_enum_tests = ['ev_enum1',
                 'ev_enum2',
                 'ev_enum3']

foreach name : ev_enum_tests
  exe = executable(name, ''.join([name, '.c']),
                   dependencies : [libcrystfeldep, hdf5dep])
  h5 = files(''.join([name, '.h5']))
  geom = files(''.join([name, '.geom']))
  test(name, exe, args : [h5, geom])
endforeach


# Wavelength tests
wavelength_tests = [['wavelength_geom1', '1e-10'],
                    ['wavelength_geom2', '1.3776e-10'],
                    ['wavelength_geom3', '1.3776e-10'],
                    ['wavelength_geom4', '1.9687e-12'],
                    ['wavelength_geom5', '1.9687e-12'],
                    ['wavelength_geom6', '1.3776e-10'],
                    ['wavelength_geom7', '1.3776e-10'],
                    ['wavelength_geom8', '1.9687e-12'],
                    ['wavelength_geom9', '1.3776e-10'],
                    ['wavelength_geom10', '1.3776e-10'],
                    ['wavelength_geom11', '1.125e-10'],
                    ['wavelength_geom12', '1.125e-10']]

exe = executable('wavelength_geom', 'wavelength_geom.c',
                 dependencies : [libcrystfeldep, hdf5dep])

h5 = files('wavelength_geom.h5')

foreach p : wavelength_tests
  geom = files(''.join([p[0], '.geom']))
  expected_wl = p[1]
  test(p[0], exe, args : [h5, geom, expected_wl])
endforeach