-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathdo_test.py
More file actions
50 lines (41 loc) · 1.46 KB
/
do_test.py
File metadata and controls
50 lines (41 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# ====------ do_test.py---------- *- Python -* ----===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#
# ===----------------------------------------------------------------------===#
import subprocess
import platform
import os
import sys
from test_config import CT_TOOL
from test_utils import *
def setup_test():
change_dir(test_config.current_test)
return True
def migrate_test():
# clean previous migration output
if (os.path.exists("build")):
shutil.rmtree("build")
ret = call_subprocess("mkdir build")
if not ret:
print("Error to create build folder:", test_config.command_output)
ret = change_dir("build")
if not ret:
print("Error to go to build folder:", test_config.command_output)
if(sys.platform.startswith('win')):
ret = call_subprocess("cmake -G \"Unix Makefiles\" -DCMAKE_CXX_COMPILER=icx ../")
else:
ret = call_subprocess("cmake -G \"Unix Makefiles\" -DCMAKE_CXX_COMPILER=icpx ../")
if not ret:
print("Error to run cmake configure:", test_config.command_output)
ret = call_subprocess("make")
if not ret:
print("Error to run build process:", test_config.command_output)
return os.path.exists("foo-bar")
def build_test():
return True
def run_test():
return call_subprocess("./foo-bar")