cleanup: remove committed .pyc and redundant Python test, add .gitignore
All checks were successful
Smoke Test / smoke (pull_request) Successful in 17s
All checks were successful
Smoke Test / smoke (pull_request) Successful in 17s
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
build/
|
||||||
|
*.pyc
|
||||||
|
__pycache__/
|
||||||
Binary file not shown.
@@ -1,64 +0,0 @@
|
|||||||
import pathlib
|
|
||||||
import shutil
|
|
||||||
import subprocess
|
|
||||||
import tempfile
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
|
|
||||||
REPO_ROOT = pathlib.Path(__file__).resolve().parents[1]
|
|
||||||
|
|
||||||
|
|
||||||
class StandaloneBuildTest(unittest.TestCase):
|
|
||||||
def test_cmake_builds_and_runs_ctest(self) -> None:
|
|
||||||
build_dir = pathlib.Path(tempfile.mkdtemp(prefix="turboquant-cmake-"))
|
|
||||||
self.addCleanup(lambda: shutil.rmtree(build_dir, ignore_errors=True))
|
|
||||||
|
|
||||||
configure = subprocess.run(
|
|
||||||
[
|
|
||||||
"cmake",
|
|
||||||
"-S",
|
|
||||||
str(REPO_ROOT),
|
|
||||||
"-B",
|
|
||||||
str(build_dir),
|
|
||||||
"-DTURBOQUANT_BUILD_TESTS=ON",
|
|
||||||
],
|
|
||||||
capture_output=True,
|
|
||||||
text=True,
|
|
||||||
check=False,
|
|
||||||
)
|
|
||||||
if configure.returncode != 0:
|
|
||||||
self.fail(
|
|
||||||
"cmake configure failed\n"
|
|
||||||
f"stdout:\n{configure.stdout}\n"
|
|
||||||
f"stderr:\n{configure.stderr}"
|
|
||||||
)
|
|
||||||
|
|
||||||
build = subprocess.run(
|
|
||||||
["cmake", "--build", str(build_dir)],
|
|
||||||
capture_output=True,
|
|
||||||
text=True,
|
|
||||||
check=False,
|
|
||||||
)
|
|
||||||
if build.returncode != 0:
|
|
||||||
self.fail(
|
|
||||||
"cmake build failed\n"
|
|
||||||
f"stdout:\n{build.stdout}\n"
|
|
||||||
f"stderr:\n{build.stderr}"
|
|
||||||
)
|
|
||||||
|
|
||||||
ctest = subprocess.run(
|
|
||||||
["ctest", "--test-dir", str(build_dir), "--output-on-failure"],
|
|
||||||
capture_output=True,
|
|
||||||
text=True,
|
|
||||||
check=False,
|
|
||||||
)
|
|
||||||
if ctest.returncode != 0:
|
|
||||||
self.fail(
|
|
||||||
"ctest failed\n"
|
|
||||||
f"stdout:\n{ctest.stdout}\n"
|
|
||||||
f"stderr:\n{ctest.stderr}"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
unittest.main()
|
|
||||||
Reference in New Issue
Block a user