Adapt extension and test build scripts, test files are picked up dynamically now

This commit is contained in:
Christian Dywan 2009-01-23 21:36:04 +01:00
parent 2b463946a8
commit 1829780e62
2 changed files with 33 additions and 13 deletions

View file

@ -4,25 +4,26 @@
extensions = os.listdir ('extensions') extensions = os.listdir ('extensions')
for extension in 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) files = os.listdir (folder)
target = extension target = extension
source = '' source = ''
for fila in files: for fila in files:
if fila[-2:] == '.c': if fila[-2:] == '.c':
source += ' ' + extension + os.sep + fila source += ' ' + extension + os.sep + fila
includes = '.' + os.sep + '..' if not source:
except: Utils.pprint ('RED', folder + ': No source files found')
continue
else:
if extension[-2:] != '.c': if extension[-2:] != '.c':
continue continue
target = extension[:-2] target = extension[:-2]
source = extension source = extension
includes = '..'
obj = bld.new_task_gen ('cc', 'shlib') obj = bld.new_task_gen ('cc', 'shlib')
obj.target = target obj.target = target
obj.includes = includes obj.includes = '..'
obj.source = source obj.source = source
obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML' obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML'
obj.uselib_local = 'katze' obj.uselib_local = 'katze'

View file

@ -2,10 +2,29 @@
# WAF build script for midori # WAF build script for midori
# This file is licensed under the terms of the expat license, see the file EXPAT. # This file is licensed under the terms of the expat license, see the file EXPAT.
obj = bld.new_task_gen ('cc', 'program') tests = os.listdir ('tests')
obj.target = 'magic-uri' for test in tests:
obj.includes = '.. ../midori' folder = 'tests' + os.sep + test
obj.source = 'magic-uri.c' if os.path.isdir (folder):
obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML' files = os.listdir (folder)
obj.uselib_local = 'midori' target = test
obj.unit_test = 1 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