Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
a715fc7d
Commit
a715fc7d
authored
Dec 03, 2015
by
Richard van der Hoff
Browse files
Run the tests against the shared library
It would be nice if the tests tested what we'd built, not something different.
parent
25953b35
Changes
1
Hide whitespace changes
Inline
Side-by-side
test.py
View file @
a715fc7d
...
...
@@ -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'
}
)
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