summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-11-23 23:25:30 +0200
committerVicent Marti <tanoku@gmail.com>2010-11-24 00:23:15 +0200
commit0ef70b4a8153a4153da78ca4a515d9623322bf89 (patch)
treed779cc843e69f53335d1158cc62fc3eaab0be390 /wscript
parent405ac51182dd4b29cae3c418ed2f3f96035b8225 (diff)
downloadlibgit2-0ef70b4a8153a4153da78ca4a515d9623322bf89.tar.gz
Make the test suite depend on the static library
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'wscript')
-rw-r--r--wscript16
1 files changed, 10 insertions, 6 deletions
diff --git a/wscript b/wscript
index a59b9f7cd..51cef5a97 100644
--- a/wscript
+++ b/wscript
@@ -71,6 +71,7 @@ def build(bld):
# command '[build|clean]-tests'
elif bld.variant == 'tests':
+ build_library(bld, 'cstlib')
build_tests(bld)
# command 'build|clean|install|uninstall': by default, run
@@ -105,7 +106,7 @@ def build_library(bld, lib_str):
target='git2',
includes='src',
install_path='${LIBDIR}',
- use=ALL_LIBS #if lib_str == 'cshlib' else []
+ use=ALL_LIBS
)
# On Unix systems, build the Pkg-config entry file
@@ -151,8 +152,8 @@ def build_tests(bld):
defines=['TEST_TOC="%s.toc"' % test_name],
install_path=None,
stlib=['git2'], # link with the git2 static lib we've just compiled'
- stlibpath=[directory.find_node('build/static/').abspath(), directory.abspath()],
- use=['test_helper'] + ALL_LIBS # link with all the libs we know
+ stlibpath=[directory.find_node('build/tests/').abspath(), directory.abspath()],
+ use=['test_helper', 'git2'] + ALL_LIBS # link with all the libs we know
# libraries which are not enabled won't link
)
@@ -163,7 +164,7 @@ class _test(BuildContext):
def test(bld):
from waflib import Options
- Options.commands = ['build-static', 'build-tests', 'run-tests'] + Options.commands
+ Options.commands = ['build-tests', 'run-tests'] + Options.commands
class _run_tests(Context):
@@ -171,14 +172,17 @@ class _run_tests(Context):
fun = 'run_tests'
def run_tests(ctx):
- import shutil
+ import shutil, sys
failed = False
test_folder = ctx.path.make_node('tests/tmp/')
test_folder.mkdir()
test_glob = 'build/tests/t????-*'
- for test in ctx.path.ant_glob(test_glob, excl='build/tests/*.manifest'):
+ if sys.platform == 'win32':
+ test_glob = 'build/tests/t????-*.exe'
+
+ for test in ctx.path.ant_glob(test_glob):
if ctx.exec_command(test.abspath(), cwd=test_folder.abspath()) != 0:
failed = True
break