mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
test: add build configs for catch2
This commit is contained in:
parent
1f16d7955d
commit
6eba62f060
@ -360,6 +360,15 @@ if scdoc.found()
|
|||||||
endforeach
|
endforeach
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
catch2 = dependency(
|
||||||
|
'catch2',
|
||||||
|
fallback: ['catch2', 'catch2_dep'],
|
||||||
|
required: get_option('tests'),
|
||||||
|
)
|
||||||
|
if catch2.found()
|
||||||
|
subdir('test')
|
||||||
|
endif
|
||||||
|
|
||||||
clangtidy = find_program('clang-tidy', required: false)
|
clangtidy = find_program('clang-tidy', required: false)
|
||||||
|
|
||||||
if clangtidy.found()
|
if clangtidy.found()
|
||||||
|
@ -10,3 +10,4 @@ option('mpd', type: 'feature', value: 'auto', description: 'Enable support for t
|
|||||||
option('gtk-layer-shell', type: 'feature', value: 'auto', description: 'Use gtk-layer-shell library for popups support')
|
option('gtk-layer-shell', type: 'feature', value: 'auto', description: 'Use gtk-layer-shell library for popups support')
|
||||||
option('rfkill', type: 'feature', value: 'auto', description: 'Enable support for RFKILL')
|
option('rfkill', type: 'feature', value: 'auto', description: 'Enable support for RFKILL')
|
||||||
option('sndio', type: 'feature', value: 'auto', description: 'Enable support for sndio')
|
option('sndio', type: 'feature', value: 'auto', description: 'Enable support for sndio')
|
||||||
|
option('tests', type: 'feature', value: 'auto', description: 'Enable tests')
|
||||||
|
12
subprojects/catch2.wrap
Normal file
12
subprojects/catch2.wrap
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[wrap-file]
|
||||||
|
directory = Catch2-2.13.3
|
||||||
|
source_url = https://github.com/catchorg/Catch2/archive/v2.13.3.zip
|
||||||
|
source_filename = Catch2-2.13.3.zip
|
||||||
|
source_hash = 1804feb72bc15c0856b4a43aa586c661af9c3685a75973b6a8fc0b950c7cfd13
|
||||||
|
patch_url = https://github.com/mesonbuild/catch2/releases/download/2.13.3-2/catch2.zip
|
||||||
|
patch_filename = catch2-2.13.3-2-wrap.zip
|
||||||
|
patch_hash = 21b590ab8c65b593ad5ee8f8e5b822bf9877b2c2672f97fbb52459751053eadf
|
||||||
|
|
||||||
|
[provide]
|
||||||
|
catch2 = catch2_dep
|
||||||
|
|
4
test/config.cpp
Normal file
4
test/config.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#define CATCH_CONFIG_MAIN
|
||||||
|
#include "config.hpp"
|
||||||
|
|
||||||
|
#include <catch2/catch.hpp>
|
21
test/meson.build
Normal file
21
test/meson.build
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
test_inc = include_directories('../include')
|
||||||
|
test_dep = [
|
||||||
|
catch2,
|
||||||
|
fmt,
|
||||||
|
jsoncpp,
|
||||||
|
spdlog,
|
||||||
|
]
|
||||||
|
|
||||||
|
config_test = executable(
|
||||||
|
'config_test',
|
||||||
|
'config.cpp',
|
||||||
|
'../src/config.cpp',
|
||||||
|
dependencies: test_dep,
|
||||||
|
include_directories: test_inc,
|
||||||
|
)
|
||||||
|
|
||||||
|
test(
|
||||||
|
'Configuration test',
|
||||||
|
config_test,
|
||||||
|
workdir: meson.source_root(),
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user