Skip to content

Commit b587f62

Browse files
authored
support python -m cmake (#496)
1 parent 5f1e952 commit b587f62

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/cmake/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from cmake import cmake
2+
3+
if __name__ == "__main__":
4+
cmake()

tests/test_cmake.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,9 @@ def test_cmake_script(tool):
7171
assert len(scripts) == 1
7272
output = subprocess.check_output([str(scripts[0]), "--version"]).decode("ascii")
7373
assert output.splitlines()[0] == f"{tool} version {expected_version}"
74+
75+
76+
def test_cmake_main():
77+
expected_version = "3.29.5"
78+
output = subprocess.run([sys.executable, "-m", "cmake", "--version"], text=True, capture_output=True, check=False).stdout
79+
assert output.splitlines()[0] == f"cmake version {expected_version}"

0 commit comments

Comments
 (0)