midori/tests/wscript_build
2012-09-11 00:44:09 +02:00

44 lines
1.5 KiB
Python

#! /usr/bin/env python
# WAF build script for midori
# This file is licensed under the terms of the expat license, see the file EXPAT.
import os
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
elif file[-5:] == '.vala':
source += ' ' + test + os.sep + fila
if not source:
Utils.pprint ('RED', folder + ': No source files found')
continue
else:
if test[-2:] == '.c':
target = test[:-2]
elif test[-5:] == '.vala':
target = test[:-5]
else:
continue
source = test
obj = bld.new_task_gen ('cc', 'program')
obj.target = 'test-' + target
obj.includes = '.. ../midori ../panels'
obj.cflags = ['-DEXTENSION_PATH="' + os.path.abspath ('_build/default/extensions') + '"']
obj.source = source
obj.vapi_dirs = '../midori ../katze'
obj.packages = 'glib-2.0 gio-2.0 libsoup-2.4 katze midori midori-core'
if bld.env['HAVE_GTK3']:
obj.packages += ' gtk+-3.0 webkitgtk-3.0'
else:
obj.packages += ' gtk+-2.0 webkit-1.0'
obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML GRANITE ZEITGEIST'
obj.uselib_local = 'midori-core'
obj.unit_test = 1