more progress on the testing infrastructure

This commit is contained in:
Yan Da
2022-06-12 15:14:45 +08:00
parent 22c65a53d9
commit 35736aa44e
5 changed files with 20 additions and 9 deletions

View File

@@ -79,6 +79,8 @@ class CMakeBuild(build_ext):
def build_extension(self, ext):
llvm_include_dir, llvm_library_dir = get_llvm()
# lit is used by the test suite
lit_dir = shutil.which('lit')
self.debug = True
extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.path)))
# create build directories
@@ -99,7 +101,8 @@ class CMakeBuild(build_ext):
# '-DPYTHON_EXECUTABLE=' + sys.executable,
# '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON',
"-DTRITON_LLVM_BUILD_DIR=" + llvm_build_dir,
"-DPYTHON_INCLUDE_DIRS=" + ";".join(python_include_dirs)
"-DPYTHON_INCLUDE_DIRS=" + ";".join(python_include_dirs),
"-DLLVM_EXTERNAL_LIT=" + lit_dir
]
# configuration
cfg = "Debug" if self.debug else "Release"
@@ -119,6 +122,11 @@ class CMakeBuild(build_ext):
subprocess.check_call(["cmake", self.base_dir] + cmake_args, cwd=self.build_temp, env=env)
subprocess.check_call(["cmake", "--build", "."] + build_args, cwd=self.build_temp)
# run tests. Note: this depends on llvm-lit
# -DLLVM_EXTERNAL_LIT=<path-to-lit.py>
# Note: get_llvm_lit_path(...) in llvm/cmake/modules/AddLLVM.cmake
subprocess.call(["cmake", "--build", ".", "--target", "check-triton"], cwd=self.build_temp, env=env)
setup(
name="triton",