infra: clean cmake build tree directories before test run
@@ -5,6 +5,7 @@ import os
import sys
import re
import time
+import shutil
JNI_TESTS = "jni_tests"
CPP_TESTS = "c++_tests"
@@ -101,7 +102,10 @@ def build_cpp_code_with_cmake(test_cfg, cmake_build_dir, addon_params):
cmake_generator = "Unix Makefiles"
cmake_args = ["cmake", "-G", cmake_generator] + addon_params
if sys.platform == 'win32' or sys.platform == 'win64':
- if not os.path.exists(cmake_build_dir):
+ if os.path.exists(cmake_build_dir):
+ #at there is problem with multiply build directories for one source tree
+ #TODO: move generated header from source tree to build tree
+ shutil.rmtree(cmake_build_dir)
os.makedirs(cmake_build_dir)
subprocess.check_call(cmake_args + [".."], cwd = str(cmake_build_dir))
os.environ["CTEST_OUTPUT_ON_FAILURE"] = "1"
