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', value: 'true',
description : 'Build tests') description : 'Build tests')
option('build-internal-tests',
type: 'boolean',
value: 'true',
description : 'Build tests for internal apis')
option('install-tests', option('install-tests',
type: 'boolean', type: 'boolean',
value: 'false', value: 'false',

View File

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

View File

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

View File

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