From 1829780e62a9f4b8ff41ec29baed06a5f6c47863 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Fri, 23 Jan 2009 21:36:04 +0100 Subject: [PATCH] Adapt extension and test build scripts, test files are picked up dynamically now --- extensions/wscript_build | 13 +++++++------ tests/wscript_build | 33 ++++++++++++++++++++++++++------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/extensions/wscript_build b/extensions/wscript_build index aa93727a..8ce7027f 100644 --- a/extensions/wscript_build +++ b/extensions/wscript_build @@ -4,25 +4,26 @@ extensions = os.listdir ('extensions') for extension in extensions: - try: - folder = 'extensions' + os.sep + extension + folder = 'extensions' + os.sep + extension + if os.path.isdir (folder): files = os.listdir (folder) target = extension source = '' for fila in files: if fila[-2:] == '.c': source += ' ' + extension + os.sep + fila - includes = '.' + os.sep + '..' - except: + if not source: + Utils.pprint ('RED', folder + ': No source files found') + continue + else: if extension[-2:] != '.c': continue target = extension[:-2] source = extension - includes = '..' obj = bld.new_task_gen ('cc', 'shlib') obj.target = target - obj.includes = includes + obj.includes = '..' obj.source = source obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML' obj.uselib_local = 'katze' diff --git a/tests/wscript_build b/tests/wscript_build index 1a9ebc81..e167569b 100644 --- a/tests/wscript_build +++ b/tests/wscript_build @@ -2,10 +2,29 @@ # WAF build script for midori # This file is licensed under the terms of the expat license, see the file EXPAT. -obj = bld.new_task_gen ('cc', 'program') -obj.target = 'magic-uri' -obj.includes = '.. ../midori' -obj.source = 'magic-uri.c' -obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML' -obj.uselib_local = 'midori' -obj.unit_test = 1 +tests = os.listdir ('tests') +for test in tests: + folder = 'tests' + os.sep + test + if os.path.isdir (folder): + files = os.listdir (folder) + target = test + source = '' + for fila in files: + if fila[-2:] == '.c': + source += ' ' + test + os.sep + fila + if not source: + Utils.pprint ('RED', folder + ': No source files found') + continue + else: + if test[-2:] != '.c': + continue + target = test[:-2] + source = test + + obj = bld.new_task_gen ('cc', 'program') + obj.target = 'test-' + target + obj.includes = '.. ../midori' + obj.source = source + obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML' + obj.uselib_local = 'midori' + obj.unit_test = 1 -- 2.39.5