Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
f70cbbc5
Commit
f70cbbc5
authored
Dec 18, 2010
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link tests with shared library, not static
Signed-off-by: Vicent Marti <tanoku@gmail.com>
parent
b5ced41e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
wscript
+15
-5
No files found.
wscript
View file @
f70cbbc5
...
...
@@ -82,7 +82,7 @@ def build(bld):
# command '[build|clean]-tests'
elif bld.variant == 'tests':
build_library(bld, 'cs
t
lib')
build_library(bld, 'cs
h
lib')
build_tests(bld)
# command 'build|clean|install|uninstall': by default, run
...
...
@@ -167,8 +167,7 @@ def build_tests(bld):
includes=['src', 'tests'],
defines=['TEST_TOC="%s.toc"' % test_name, 'TEST_RESOURCES="%s"' % resources_path],
install_path=None,
stlib=['git2'], # link with the git2 static lib we've just compiled'
stlibpath=[directory.find_node('build/tests/').abspath(), directory.abspath()],
shlibpath=[directory.find_node('build/tests/').abspath()],
use=['test_helper', 'git2'] + ALL_LIBS # link with all the libs we know
# libraries which are not enabled won't link
)
...
...
@@ -201,17 +200,28 @@ class _run_tests(Context):
fun = 'run_tests'
def run_tests(ctx):
import shutil, tempfile, sys
import shutil, tempfile, sys
, os
failed = False
test_folder = tempfile.mkdtemp()
build_folder = ctx.path.find_node('build/tests/')
test_glob = 'build/tests/t????-*'
environ = os.environ.copy()
environ_tail = ""
if sys.platform == 'win32':
test_glob += '.exe'
environ_var, environ_separator = 'PATH', ';'
else:
environ_var, environ_separator = 'LD_LIBRARY_PATH', ':'
if environ_var in environ:
environ_tail = environ_separator + environ[environ_var]
environ[environ_var] = build_folder.abspath() + environ_tail
for test in ctx.path.ant_glob(test_glob):
if ctx.exec_command(test.abspath(), cwd=test_folder) != 0:
if ctx.exec_command(test.abspath(), cwd=test_folder
, env=environ
) != 0:
failed = True
break
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment