Compare commits

...

1 Commits

Author SHA1 Message Date
Matthias Clasen
4847666a12 build: Add a build-internal-tests option
Internal tests link against the static library,
which takes a *long* time. Making it possible
to run only the public api tests is good for
faster turnaround times.
2021-09-14 11:36:02 -04:00
4 changed files with 88 additions and 79 deletions

View File

@@ -119,6 +119,11 @@ option('build-tests',
value: 'true',
description : 'Build tests')
option('build-internal-tests',
type: 'boolean',
value: 'true',
description : 'Build tests for internal apis')
option('install-tests',
type: 'boolean',
value: 'false',

View File

@@ -30,34 +30,36 @@ test('api', test_api,
suite: 'css',
)
test_data = executable('data', 'data.c',
if get_option('build-internal-tests')
test_data = executable('data', 'data.c',
c_args: common_cflags,
include_directories: [confinc, ],
dependencies: libgtk_static_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
)
)
test('data', test_data,
test('data', test_data,
args: ['--tap', '-k' ],
protocol: 'tap',
env: csstest_env,
suite: 'css',
)
)
transition = executable('transition', 'transition.c',
transition = executable('transition', 'transition.c',
c_args: common_cflags,
dependencies: libgtk_static_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
)
)
test('transition', transition,
test('transition', transition,
args: [ '--tap', '-k' ],
protocol: 'tap',
env: csstest_env,
suite: 'css'
)
)
endif
if get_option('install-tests')
conf = configuration_data()

View File

@@ -239,7 +239,8 @@ internal_tests = [
[ 'half-float' ],
]
foreach t : internal_tests
if get_option('build-internal-tests')
foreach t : internal_tests
test_name = t.get(0)
test_srcs = ['@0@.c'.format(test_name)] + t.get(1, [])
test_extra_cargs = t.get(2, [])
@@ -264,6 +265,5 @@ foreach t : internal_tests
],
suite: 'gsk',
)
endforeach
endforeach
endif

View File

@@ -190,7 +190,8 @@ foreach t : tests
)
endforeach
foreach t : internal_tests
if get_option('build-internal-tests')
foreach t : internal_tests
test_name = t.get('name')
test_srcs = ['@0@.c'.format(test_name)] + t.get('sources', [])
test_extra_cargs = t.get('c_args', [])
@@ -221,7 +222,8 @@ foreach t : internal_tests
suite: ['gtk'] + test_extra_suites,
should_fail: expect_fail,
)
endforeach
endforeach
endif
# FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++
if add_languages('cpp', required: false, native: false)