Skip to content

Commit d2fe04d

Browse files
authored
tests: support running tests with system cmake3 visible (#211)
Include other potential cmake aliases. Closes: #209 Signed-off-by: Cristian Le <[email protected]>
1 parent 084f457 commit d2fe04d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_cmake_config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def configure_args(config: CMaker, *, init: bool = False) -> Generator[str, None
3838
@pytest.mark.configure()
3939
def test_init_cache(fp, tmp_path):
4040
fp.register([fp.program("cmake"), "--version"], stdout="3.14.0")
41+
fp.register([fp.program("cmake3"), "--version"], stdout="3.14.0")
4142

4243
config = CMaker(
4344
CMake.default_search(),
@@ -52,6 +53,7 @@ def test_init_cache(fp, tmp_path):
5253
cmd = list(configure_args(config, init=True))
5354
print("Registering: cmake", *cmd)
5455
fp.register([fp.program("cmake"), *cmd])
56+
fp.register([fp.program("cmake3"), *cmd])
5557
config.configure()
5658

5759
cmake_init = config.build_dir / "CMakeInit.txt"
@@ -70,6 +72,7 @@ def test_init_cache(fp, tmp_path):
7072
def test_too_old(fp, monkeypatch):
7173
monkeypatch.setattr(shutil, "which", lambda _: None)
7274
fp.register([fp.program("cmake"), "--version"], stdout="3.14.0")
75+
fp.register([fp.program("cmake3"), "--version"], stdout="3.14.0")
7376

7477
with pytest.raises(CMakeNotFoundError) as excinfo:
7578
CMake.default_search(minimum_version=Version("3.15"))
@@ -79,6 +82,7 @@ def test_too_old(fp, monkeypatch):
7982
@pytest.mark.configure()
8083
def test_cmake_args(tmp_path, fp):
8184
fp.register([fp.program("cmake"), "--version"], stdout="3.15.0")
85+
fp.register([fp.program("cmake3"), "--version"], stdout="3.15.0")
8286

8387
config = CMaker(
8488
CMake.default_search(),
@@ -91,6 +95,7 @@ def test_cmake_args(tmp_path, fp):
9195
cmd.append("-DSOMETHING=one")
9296
print("Registering: cmake", *cmd)
9397
fp.register([fp.program("cmake"), *cmd])
98+
fp.register([fp.program("cmake3"), *cmd])
9499

95100
config.configure(cmake_args=["-DSOMETHING=one"])
96101

@@ -100,6 +105,7 @@ def test_cmake_args(tmp_path, fp):
100105
@pytest.mark.configure()
101106
def test_cmake_paths(tmp_path, fp):
102107
fp.register([fp.program("cmake"), "--version"], stdout="3.15.0")
108+
fp.register([fp.program("cmake3"), "--version"], stdout="3.15.0")
103109

104110
config = CMaker(
105111
CMake.default_search(),
@@ -113,6 +119,7 @@ def test_cmake_paths(tmp_path, fp):
113119
cmd = list(configure_args(config))
114120
print("Registering: cmake", *cmd)
115121
fp.register([fp.program("cmake"), *cmd])
122+
fp.register([fp.program("cmake3"), *cmd])
116123

117124
config.configure()
118125

0 commit comments

Comments
 (0)