diff options
author | Nao Pross <naopross@thearcway.org> | 2019-01-27 00:03:08 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2019-01-27 00:03:08 +0100 |
commit | ecf6c28db624c5e1e5968c7ae90244eac0996e14 (patch) | |
tree | 6031e2919b6f28c15fb459420211cb12687be14a | |
parent | Merge remote-tracking branch 'raffa/master' (diff) | |
download | flatland-ecf6c28db624c5e1e5968c7ae90244eac0996e14.tar.gz flatland-ecf6c28db624c5e1e5968c7ae90244eac0996e14.zip |
Fix configure.py to build signal_test
-rw-r--r-- | .gitignore | 3 | ||||
-rwxr-xr-x | configure.py | 32 |
2 files changed, 32 insertions, 3 deletions
@@ -8,6 +8,9 @@ build .ninja_log build.ninja +# ctag files +tags + # vim editor **/*.swp diff --git a/configure.py b/configure.py index d313554..14c45cd 100755 --- a/configure.py +++ b/configure.py @@ -30,8 +30,27 @@ def find_sources(path): return sources, objects -def add_test(bf, test_source, tested_sources): - print("adding test {}".format(test_source) + " to test {}".format(tested_sources)) + +def add_test(bf, test_source, library): + print("adding test {}".format(test_source)) + + # replace extension + test_object = re.sub(".cpp$", ".o", test_source) + test_binary = re.sub(".o$", "", test_object) + + # add path prefix + test_source = "test/" + test_source + test_object = "build/test/" + test_object + test_binary = "build/test/" + test_binary + + print("build {}: cpp {}".format(test_object, test_source), file=bf) + print("build {}: link {}".format(test_binary, test_object), file=bf) + print(" lflags = $lflags {}".format(library), file=bf) + print("\n", file=bf) + + +def add_specific_test(bf, test_source, tested_sources): + print("adding specific test {}".format(test_source) + " to test {}".format(tested_sources)) # replace extension test_object = re.sub(".cpp$", ".o", test_source) @@ -87,4 +106,11 @@ with open("build.ninja", "w") as bf: print("\n", file=bf) # add tests - add_test(bf, "task_test.cpp", ["engine/task.cpp"]) + add_specific_test(bf, "task_test.cpp", ["engine/task.cpp"]) + add_test(bf, "signal_test.cpp", "build/libflatland.so") + + print("default build/test/signal_test", file=bf) + +# run ctags for vim :) +os.system("if type ctags; then ctags -R . ; fi") + |