Skip to content

Commit 149819b

Browse files
authored
Merge pull request #27 from rileyberton/master
compile a shared object, make test_runner depend on it, allow in tree…
2 parents 18258d2 + 174f412 commit 149819b

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ before_install:
1010
- sudo ldconfig
1111
- popd
1212
- scons
13-
script: CK_TIMEOUT_MULTIPLIER=3 ./test_runner
13+
script: CK_TIMEOUT_MULTIPLIER=3 LD_LIBRARY_PATH=`pwd` ./test_runner

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ To build the test code successfully, do the following::
3232
$ scons
3333
$ ./test_runner
3434

35+
Or, if you prefer, you can skip the installation of libcheck and the test
36+
will adapt to it being in the tree (leave out `make install`):
37+
38+
$ LD_LIBRARY_PATH=deps/check-0.9.8/src/.libs:. ./test_runner
39+
40+
This build will produce a test_runner executable for testing and a shared_object
41+
(libart.so on *NIX systems) for linking with.
42+
3543

3644
References
3745
----------

SConstruct

+9-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ import os
33
# assume check was installed into /usr/local/
44
env_with_err = Environment(
55
ENV = os.environ,
6-
CPPPATH = ['#/src', '/usr/local/include'])
6+
CPPPATH = ['#/src', '#/deps/check-0.9.8/src', '/usr/local/include'])
7+
78
if "CC" in os.environ:
89
env_with_err["CC"] = os.environ["CC"]
910
if "CCFLAGS" not in os.environ:
1011
env_with_err["CCFLAGS"] = '-g -std=c99 -D_GNU_SOURCE -Wall -Werror -O3'
12+
if "SHLINKFLAGS" not in os.environ:
13+
env_with_err['SHLINKFLAGS'] = '-shared'
1114
#print "CCCOM is:", env_with_err.subst('$CCCOM')
1215

13-
objs = env_with_err.Object('src/art', 'src/art.c')
16+
shared_object = env_with_err.SharedLibrary('art', ['src/art.c'])
1417
test_runner = env_with_err.Program('test_runner',
15-
objs + ["tests/runner.c"],
16-
LIBS=["check"],
17-
LIBPATH = ['/usr/lib', '/usr/local/lib'])
18-
Default(test_runner)
18+
["tests/runner.c"],
19+
LIBS=["check", "art"],
20+
LIBPATH = ['#', '#/deps/check-0.9.8/src/.libs', '/usr/lib', '/usr/local/lib'])
21+
Default(shared_object, test_runner)

0 commit comments

Comments
 (0)