Skip to content

Commit

Permalink
fixup! Port build task test from colcon_core to colcon_cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Jun 12, 2024
1 parent bcbe4e8 commit be008f0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/spell_check.words
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ rmtree
rtype
samefile
scspell
setenv
setuptools
skipif
stepanas
Expand Down
16 changes: 16 additions & 0 deletions test/test_task_cmake_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit be008f0

Please sign in to comment.