From 2fb85397366c58accbb77e5a7bd898877facc44d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 9 Mar 2020 21:49:55 +0100 Subject: Add test for basic view creation, exposure, and destruction --- wscript | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'wscript') diff --git a/wscript b/wscript index 8a6b158..109ae3e 100644 --- a/wscript +++ b/wscript @@ -37,6 +37,9 @@ def options(ctx): 'log': 'print GL information to console', 'grab-focus': 'work around keyboard issues by grabbing focus'}) + ctx.get_option_group('Test options').add_option( + '--gui-tests', action='store_true', help='Run GUI tests') + def configure(conf): conf.load('compiler_c', cache=True) @@ -174,6 +177,9 @@ def _build_pc_file(bld, name, desc, target, libname, deps={}, requires=[]): LIBS=' '.join(link_flags)) +tests = ['show_hide'] + + def build(bld): # C Headers includedir = '${INCLUDEDIR}/pugl-%s/pugl' % PUGL_MAJOR_VERSION @@ -334,12 +340,24 @@ def build(bld): platform, 'cairo', uselib=['M', 'CAIRO']) + for test in tests: + bld(features = 'c cprogram', + source = 'test/test_%s.c' % test, + target = 'test/test_%s' % test, + install_path = '', + use = ['pugl_%s_static' % platform, + 'pugl_%s_stub_static' % platform], + uselib = deps[platform]['uselib'] + ['CAIRO']) + if bld.env.DOCS: autowaf.build_dox(bld, 'PUGL', PUGL_VERSION, top, out) def test(tst): - pass + if tst.options.gui_tests: + with tst.group('gui') as check: + for test in tests: + check(['test/test_%s' % test]) def lint(ctx): -- cgit v1.2.1