Skip to content

Commit a7fb611

Browse files
committed
make the unit tests work in meson
1 parent defa0e1 commit a7fb611

3 files changed

Lines changed: 20 additions & 30 deletions

File tree

meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ if not meson.is_subproject()
1616
subdir('example/api2-samples')
1717
endif
1818

19-
# if get_option('build_tests')
20-
# subdir('tests')
21-
# endif
19+
if get_option('build_tests')
20+
subdir('tests')
21+
endif
2222
endif
2323

2424
meson.override_dependency('avcpp', avcpp_dep)

subprojects/catch2.wrap

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[wrap-file]
2-
directory = Catch2-2.11.3
2+
directory = Catch2-3.13.0
3+
source_url = https://github.com/catchorg/Catch2/archive/v3.13.0.tar.gz
4+
source_filename = Catch2-3.13.0.tar.gz
5+
source_hash = 650795f6501af514f806e78c554729847b98db6935e69076f36bb03ed2e985ef
6+
source_fallback_url = https://wrapdb.mesonbuild.com/v2/catch2_3.13.0-1/get_source/Catch2-3.13.0.tar.gz
7+
wrapdb_version = 3.13.0-1
38

4-
source_url = https://github.com/catchorg/Catch2/archive/v2.11.3.zip
5-
source_filename = Catch2-2.11.3.zip
6-
source_hash = c5a0a7510379c6f37f70b329986a335a7b8489d67ac417ce8f4262d0cae4cc5d
7-
8-
patch_url = https://wrapdb.mesonbuild.com/v1/projects/catch2/2.11.3/1/get_zip
9-
patch_filename = catch2-2.11.3-1-wrap.zip
10-
patch_hash = 63c09cb68280435040ad304b3dd87ecfe69dbc216608991d0a82569a63119e57
9+
[provide]
10+
catch2 = catch2_dep
11+
catch2-with-main = catch2_with_main_dep

tests/meson.build

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11
#get catch2
2-
catch2 = dependency('catch2', required: true, fallback:['catch2','catch2_dep'])
2+
catch2 = dependency('catch2-with-main', required: true)
33

4-
#create main_test as library and export the dependency
5-
main_test = static_library(
6-
'main_test',
7-
'test-main.cpp',
8-
dependencies: [catch2, avcpp_dep]
9-
)
10-
11-
main_test_dep = declare_dependency(
12-
link_with : main_test,
13-
dependencies : catch2,
14-
version: meson.project_version()
15-
)
16-
17-
#make both dependencies into one array
18-
deps = [avcpp_dep]
19-
deps += main_test_dep
4+
deps = [avcpp_dep, catch2]
205

216
tests = [
22-
'Frame',
237
'AvDeleter',
24-
'Packet',
8+
'Buffer',
9+
'Codec',
2510
'Format',
11+
'Frame',
12+
'Packet',
13+
'PixelSampleFormat',
2614
'Rational',
15+
'TimeStamp'
2716
]
2817

2918
#create all the tests

0 commit comments

Comments
 (0)