aboutsummaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rw-r--r--test.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test.py b/test.py
new file mode 100644
index 0000000..250f43e
--- /dev/null
+++ b/test.py
@@ -0,0 +1,17 @@
+import subprocess
+import glob
+import os
+
+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++ -Itests/include -Iinclude -Ilib --std=c++11".split()
+compile_args += source_files
+
+for test_file in test_files:
+ exe_file = "build/" + test_file[:4]
+ subprocess.check_call(compile_args + [test_file, "-o", exe_file])
+ subprocess.check_call([exe_file])