diff --git a/test/spell_check.words b/test/spell_check.words index e0ee75f..2be9d8c 100644 --- a/test/spell_check.words +++ b/test/spell_check.words @@ -46,6 +46,7 @@ rmtree rtype samefile scspell +setenv setuptools skipif stepanas diff --git a/test/test_task_cmake_build.py b/test/test_task_cmake_build.py index 99b8172..73d391b 100644 --- a/test/test_task_cmake_build.py +++ b/test/test_task_cmake_build.py @@ -3,6 +3,7 @@ # Licensed under the Apache License, Version 2.0 import asyncio +import os from pathlib import Path import shutil from types import SimpleNamespace @@ -25,6 +26,21 @@ def monkey_patch_put_event_into_queue(monkeypatch): ) +@pytest.fixture(autouse=True) +def monkey_patch_vs_version(monkeypatch): + """ + Ensure that VisualStudioVersion is set for the test. + + As it stands, colcon-cmake uses the VisualStudioVersion environment + variable to determine if it needs to override the platform so that 64-bit + binaries are built on 64-bit platforms. This is normally set within + a developer command prompt. We don't really care in this context, so just + set it to something to appease the check. + """ + if os.name == 'nt' and 'VisualStudioVersion' not in os.environ: + monkeypatch.setenv('VisualStudioVersion', '16.0') + + def _test_build_package( tmp_path, *, cmake_args=None, cmake_clean_cache=False, cmake_clean_first=False, cmake_force_configure=None,