Commit fe515c4c authored by Matthias Clasen's avatar Matthias Clasen

testsuite: Link some tests statically

Link tests for private apis statically.
parent 14f0a0ad
Pipeline #249530 passed with stages
in 33 minutes and 37 seconds
......@@ -1274,7 +1274,7 @@ libgtk_dep = declare_dependency(sources: gtk_dep_sources,
libgtk_static_dep = declare_dependency(sources: gtk_dep_sources,
include_directories: [confinc, gtkinc],
dependencies: gtk_deps + [libgtk_css_dep, libgdk_dep, libgsk_dep],
link_with: libgtk_static,
link_with: [libgtk_static, libgtk_css, libgdk, libgsk ],
link_args: common_ldflags,
)
......
#include <locale.h>
#include <gtk/gtk.h>
#include "../../gtk/gtkconstrainttypesprivate.h"
#include "../../gtk/gtkconstraintsolverprivate.h"
#include "../../gtk/gtkconstraintexpressionprivate.h"
......
......@@ -26,11 +26,6 @@ tests = [
{ 'name': 'action' },
{ 'name': 'adjustment' },
{ 'name': 'bitset' },
{
'name': 'bitmask',
'sources': ['../../gtk/gtkallocatedbitmask.c'],
'c_args': ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG'],
},
{
'name': 'builder',
'link_args': gtk_tests_export_dynamic_ldflag,
......@@ -38,20 +33,7 @@ tests = [
{ 'name': 'builderparser' },
{ 'name': 'cellarea' },
{ 'name': 'check-icon-names' },
{
'name': 'constraint-solver',
'sources': [
'../../gtk/gtkconstraintsolver.c',
'../../gtk/gtkconstraintexpression.c',
],
'c_args': ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG'],
},
{ 'name': 'cssprovider' },
{
'name': 'rbtree-crash',
'sources': ['../../gtk/gtkrbtree.c'],
'c_args': ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG'],
},
{ 'name': 'defaultvalue' },
{ 'name': 'entry' },
{ 'name': 'expression' },
......@@ -78,16 +60,6 @@ tests = [
{ 'name': 'objects-finalize' },
{ 'name': 'papersize' },
#{ 'name': 'popover' },
{
'name': 'propertylookuplistmodel',
'sources': ['../../gtk/gtkpropertylookuplistmodel.c'],
'c_args': ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG'],
},
{
'name': 'rbtree',
'sources': ['../../gtk/gtktreerbtree.c'],
'c_args': ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG'],
},
{ 'name': 'recentmanager' },
{ 'name': 'regression-tests' },
{ 'name': 'scrolledwindow' },
......@@ -104,10 +76,6 @@ tests = [
{ 'name': 'textbuffer' },
{ 'name': 'textiter' },
{ 'name': 'theme-validate' },
{
'name': 'timsort',
'sources': ['timsort.c', '../../gtk/timsort/gtktimsort.c'],
},
{ 'name': 'tooltips' },
{ 'name': 'treelistmodel' },
{
......@@ -132,6 +100,16 @@ tests = [
{ 'name': 'widget-refcount' },
]
# Tests that test private apis and therefore are linked against libgtk-4.a
internal_tests = [
{ 'name': 'bitmask' },
{ 'name': 'constraint-solver' },
{ 'name': 'rbtree-crash' },
{ 'name': 'propertylookuplistmodel' },
{ 'name': 'rbtree' },
{ 'name': 'timsort' },
]
# Tests that are expected to fail
xfail = [
# we are still missing some accessors
......@@ -199,6 +177,39 @@ foreach t : tests
)
endforeach
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', [])
test_extra_ldflags = t.get('link_args', [])
test_extra_suites = t.get('suites', [])
test_timeout = 60
test_exe = executable(test_name,
sources: test_srcs,
c_args: test_cargs + test_extra_cargs,
link_args: test_extra_ldflags,
dependencies: libgtk_static_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
)
expect_fail = xfail.contains(test_name)
if test_extra_suites.contains('slow')
test_timeout = 90
endif
test(test_name, test_exe,
args: [ '--tap', '-k' ],
protocol: 'tap',
timeout: test_timeout,
env: test_env,
suite: ['gtk'] + test_extra_suites,
should_fail: expect_fail,
)
endforeach
# FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++
if add_languages('cpp', required: false, native: false)
test_exe = executable('autotestkeywords',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment