[gtk/static-lib-for-tests: 2/2] testsuite: Link some tests statically
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/static-lib-for-tests: 2/2] testsuite: Link some tests statically
- Date: Sat, 23 Jan 2021 15:41:45 +0000 (UTC)
commit fe515c4c1ca247d75c80881bb97aecfebfde9198
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 22 22:50:42 2021 -0500
testsuite: Link some tests statically
Link tests for private apis statically.
gtk/meson.build | 2 +-
testsuite/gtk/constraint-solver.c | 1 +
testsuite/gtk/meson.build | 75 ++++++++++++++++++++++-----------------
3 files changed, 45 insertions(+), 33 deletions(-)
---
diff --git a/gtk/meson.build b/gtk/meson.build
index dfbc36709d..ad9e8be72d 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -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,
)
diff --git a/testsuite/gtk/constraint-solver.c b/testsuite/gtk/constraint-solver.c
index a4597c70ba..970cf8df54 100644
--- a/testsuite/gtk/constraint-solver.c
+++ b/testsuite/gtk/constraint-solver.c
@@ -1,5 +1,6 @@
#include <locale.h>
+#include <gtk/gtk.h>
#include "../../gtk/gtkconstrainttypesprivate.h"
#include "../../gtk/gtkconstraintsolverprivate.h"
#include "../../gtk/gtkconstraintexpressionprivate.h"
diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build
index 382e6369e9..1ba0bfd9d8 100644
--- a/testsuite/gtk/meson.build
+++ b/testsuite/gtk/meson.build
@@ -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',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]