aboutsummaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2015-12-03 12:20:58 +0000
committerRichard van der Hoff <richard@matrix.org>2015-12-03 17:08:04 +0000
commita715fc7d8446d4f64df4e6f043f5c7b9822911e5 (patch)
tree09942df4dca54ae310ede3c13e717a3f6ce310ec /test.py
parent25953b350b157744dd32dd364c5eb276c3172dc6 (diff)
Run the tests against the shared library
It would be nice if the tests tested what we'd built, not something different.
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/test.py b/test.py
index ef9f942..307f307 100755
--- a/test.py
+++ b/test.py
@@ -21,16 +21,15 @@ if not os.path.exists("build"):
os.mkdir("build")
test_files = glob.glob("tests/test_*.cpp")
-source_files = glob.glob("src/*.cpp")
-compile_args = "g++ -g -O0 -Itests/include -Iinclude -Ilib --std=c++11".split()
-compile_args += source_files
+compile_args = ("g++ -g -O0 -Itests/include -Iinclude -Ilib --std=c++11 "+
+ "-L build").split()
-def run(args):
+def run(args, *xargs, **kwargs):
print " ".join(args)
- subprocess.check_call(args)
+ subprocess.check_call(args, *xargs, **kwargs)
for test_file in test_files:
- exe_file = "build/" + test_file[5:-4]
- run(compile_args + [test_file, "-o", exe_file])
- run([exe_file])
+ exe_file = "build/" + test_file[6:-4]
+ run(compile_args + [test_file, "-lolm", "-o", exe_file])
+ run([exe_file], env={'LD_LIBRARY_PATH':'./build'})