midori/tests/wscript_build

41 lines
1.3 KiB
Text
Raw Normal View History

2009-05-15 04:14:10 +00:00
#! /usr/bin/env python
# WAF build script for midori
# This file is licensed under the terms of the expat license, see the file EXPAT.
2009-07-30 21:00:35 +00:00
import os
2009-05-15 04:14:10 +00:00
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
2010-05-30 17:53:33 +00:00
elif 'VALAC' in bld.env and file[-5:] == '.vala':
source += ' ' + test + os.sep + fila
2009-05-15 04:14:10 +00:00
if not source:
Utils.pprint ('RED', folder + ': No source files found')
continue
else:
2010-05-30 17:53:33 +00:00
if test[-2:] == '.c':
target = test[:-2]
elif 'VALAC' in bld.env and test[-5:] == '.vala':
target = test[:-5]
else:
2009-05-15 04:14:10 +00:00
continue
source = test
obj = bld.new_task_gen ('cc', 'program')
obj.target = 'test-' + target
obj.includes = '.. ../midori ../panels'
2009-07-30 21:00:35 +00:00
obj.cflags = ['-DEXTENSION_PATH="' + os.path.abspath ('_build_/default/extensions') + '"']
2009-05-15 04:14:10 +00:00
obj.source = source
2010-05-30 17:53:33 +00:00
obj.vapi_dirs = '../midori'
obj.packages = 'glib-2.0 gio-2.0 gtk+-2.0 libsoup-2.4 webkit-1.0 midori'
2009-05-15 04:14:10 +00:00
obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML'
2010-03-08 05:41:57 +00:00
obj.uselib_local = 'midori-core'
2009-05-15 04:14:10 +00:00
obj.unit_test = 1