1# We cannot use gnome.genmarshal() here 2testmarshal_h = custom_target('testmarshal_h', 3 output : 'testmarshal.h', 4 input : 'testmarshal.list', 5 command : [ 6 python, glib_genmarshal, 7 '--prefix=test_marshal', 8 '--output=@OUTPUT@', 9 '--quiet', 10 '--header', 11 '@INPUT@', 12 ], 13) 14 15testmarshal_c = custom_target('testmarshal_c', 16 output : 'testmarshal.c', 17 input : 'testmarshal.list', 18 command : [ 19 python, glib_genmarshal, 20 '--prefix=test_marshal', 21 '--include-header=testmarshal.h', 22 '--output=@OUTPUT@', 23 '--quiet', 24 '--body', 25 '@INPUT@', 26 ], 27) 28 29gobject_tests = { 30 'gvalue-test' : {'tap' : true}, 31 'paramspec-test' : {'tap' : true}, 32 'deftype' : {}, 33 'defaultiface' : { 34 'extra_sources' : ['testmodule.c'], 35 }, 36 'dynamictype' : { 37 'extra_sources' : ['testmodule.c'], 38 }, 39 'override' : {}, 40 'signals' : {}, 41 'singleton' : {}, 42 'references' : {}, 43 'testgobject' : {}, 44 'accumulator' : { 45 'extra_sources' : [testmarshal_c, testmarshal_h], 46 }, 47} 48 49if host_system != 'windows' 50 gobject_tests += { 51 'timeloop-closure' : {}, 52 } 53endif 54 55common_c_args = test_cargs + ['-DGLIB_DISABLE_DEPRECATION_WARNINGS'] 56common_deps = [libm, thread_dep, libglib_dep, libgobject_dep] 57 58foreach test_name, extra_args : gobject_tests 59 source = extra_args.get('source', test_name + '.c') 60 extra_sources = extra_args.get('extra_sources', []) 61 install = installed_tests_enabled and extra_args.get('install', true) 62 template = extra_args.get('tap', false) ? installed_tests_template_tap : installed_tests_template 63 64 if install 65 test_conf = configuration_data() 66 test_conf.set('installed_tests_dir', installed_tests_execdir) 67 test_conf.set('program', test_name) 68 test_conf.set('env', '') 69 configure_file( 70 input: template, 71 output: test_name + '.test', 72 install_dir: installed_tests_metadir, 73 configuration: test_conf 74 ) 75 endif 76 77 # FIXME? $(GLIB_DEBUG_FLAGS) 78 exe = executable(test_name, [source, extra_sources], 79 c_args : common_c_args + extra_args.get('c_args', []), 80 dependencies : common_deps + extra_args.get('dependencies', []), 81 install_dir: installed_tests_execdir, 82 install: install, 83 ) 84 85 suite = ['gobject'] + extra_args.get('suite', []) 86 timeout = suite.contains('slow') ? test_timeout_slow : test_timeout 87 # FIXME? TESTS_ENVIRONMENT = LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset 88 test(test_name, exe, env : test_env, timeout : timeout, suite : suite) 89endforeach 90 91# Don't install these ones, and keep them out of 'make check' because they take too long... 92executable('performance', 'performance.c', 93 c_args : common_c_args, 94 dependencies : common_deps, 95 install : false) 96 97executable('performance-threaded', 'performance-threaded.c', 98 c_args : common_c_args, 99 dependencies : common_deps, 100 install : false) 101