diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 22523599..1678761e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,7 +42,7 @@ jobs: integration-tests-aspect: strategy: matrix: - os: [ ubuntu-22.04, macos-12 ] + os: [ ubuntu-22.04, macos-12, windows-2022 ] runs-on: ${{ matrix.os }} needs: [ fast-tests ] steps: diff --git a/test/aspect/alias/test_invalid_dependency_through_alias.py b/test/aspect/alias/test_invalid_dependency_through_alias.py index c53ac412..d523ea78 100644 --- a/test/aspect/alias/test_invalid_dependency_through_alias.py +++ b/test/aspect/alias/test_invalid_dependency_through_alias.py @@ -1,3 +1,5 @@ +from pathlib import Path + from result import ExpectedResult, Result from test_case import TestCaseBase @@ -6,7 +8,7 @@ class TestCase(TestCaseBase): def execute_test_logic(self) -> Result: expected = ExpectedResult( success=False, - invalid_includes=["File='alias/use_a_and_b.cpp', include='alias/a.h'"], + invalid_includes=[f"File='{Path('alias/use_a_and_b.cpp')}', include='alias/a.h'"], ) actual = self._run_dwyu(target="//alias:use_a_transitively", aspect=self.default_aspect) diff --git a/test/aspect/defines/defines_from_bazel_target.h b/test/aspect/defines/defines_from_bazel_target.h index a15f1d96..7f6c0c72 100644 --- a/test/aspect/defines/defines_from_bazel_target.h +++ b/test/aspect/defines/defines_from_bazel_target.h @@ -1,17 +1,17 @@ #ifdef SOME_DEFINE #include "defines/support/a.h" #else -#include "defines/support/b.h" +#include "non/existing/a.h" #endif #ifdef LOCAL_DEFINE #include "defines/support/a.h" #else -#include "defines/support/b.h" +#include "non/existing/b.h" #endif #if SOME_COPT > 40 #include "defines/support/a.h" #else -#include "defines/support/b.h" +#include "non/existing/c.h" #endif diff --git a/test/aspect/defines/transitive_defines_from_bazel_target.h b/test/aspect/defines/transitive_defines_from_bazel_target.h index e99dbf4f..3d175881 100644 --- a/test/aspect/defines/transitive_defines_from_bazel_target.h +++ b/test/aspect/defines/transitive_defines_from_bazel_target.h @@ -3,7 +3,7 @@ #ifdef TRANSITIVE_DEFINE #include "defines/support/a.h" #else -#include "defines/support/b.h" +#include "non/existing/a.h" #endif #include "defines/support/a.h" @@ -13,9 +13,9 @@ // 'local_defines' which should not leak to users of the target #ifdef LOCAL_DEFINE -#include "defines/support/b.h" +#include "non/existing/b.h" #endif #ifdef LOCAL_COPT -#include "defines/support/b.h" +#include "non/existing/c.h" #endif diff --git a/test/aspect/execution_logic.py b/test/aspect/execution_logic.py index 851129c1..03517e5a 100644 --- a/test/aspect/execution_logic.py +++ b/test/aspect/execution_logic.py @@ -3,7 +3,6 @@ import logging import subprocess from importlib.machinery import SourceFileLoader -from os import environ from pathlib import Path from typing import TYPE_CHECKING @@ -75,7 +74,7 @@ def main( versions = [TestedVersions(bazel=bazel, python=python)] if bazel and python else tested_versions failed_tests = [] - output_root = Path(environ["HOME"]) / ".cache" / "bazel" / workspace_path.relative_to("/") + output_root = Path.home() / ".cache" / "bazel" / "dwyu" for version in versions: output_base = output_root / f"aspect_integration_tests_bazel_{version.bazel}_python_{version.python}" output_base.mkdir(parents=True, exist_ok=True) diff --git a/test/aspect/ignore_includes/test_include_not_covered_by_patterns.py b/test/aspect/ignore_includes/test_include_not_covered_by_patterns.py index 36d1e6b2..bbc41721 100644 --- a/test/aspect/ignore_includes/test_include_not_covered_by_patterns.py +++ b/test/aspect/ignore_includes/test_include_not_covered_by_patterns.py @@ -1,3 +1,5 @@ +from pathlib import Path + from result import ExpectedResult, Result from test_case import TestCaseBase @@ -7,7 +9,7 @@ def execute_test_logic(self) -> Result: expected = ExpectedResult( success=False, invalid_includes=[ - "File='ignore_includes/use_not_ignored_header.h', include='example_substring_matching_does_not_work_here.h'" + f"File='{Path('ignore_includes/use_not_ignored_header.h')}', include='example_substring_matching_does_not_work_here.h'" ], ) actual = self._run_dwyu( diff --git a/test/aspect/target_mapping/test_use_c_with_direct_deps_mapping.py b/test/aspect/target_mapping/test_use_c_with_direct_deps_mapping.py index 3f41790c..62457cba 100644 --- a/test/aspect/target_mapping/test_use_c_with_direct_deps_mapping.py +++ b/test/aspect/target_mapping/test_use_c_with_direct_deps_mapping.py @@ -1,3 +1,5 @@ +from pathlib import Path + from result import ExpectedResult, Result from test_case import TestCaseBase @@ -6,7 +8,7 @@ class TestCase(TestCaseBase): def execute_test_logic(self) -> Result: expected = ExpectedResult( success=False, - invalid_includes=["File='target_mapping/use_lib_c.cpp', include='target_mapping/libs/c.h'"], + invalid_includes=[f"File='{Path('target_mapping/use_lib_c.cpp')}', include='target_mapping/libs/c.h'"], unused_public_deps=["//target_mapping/libs:a"], ) actual = self._run_dwyu( diff --git a/test/aspect/target_mapping/test_use_c_with_specific_mapping.py b/test/aspect/target_mapping/test_use_c_with_specific_mapping.py index 97eab6ef..e845a1f2 100644 --- a/test/aspect/target_mapping/test_use_c_with_specific_mapping.py +++ b/test/aspect/target_mapping/test_use_c_with_specific_mapping.py @@ -1,3 +1,5 @@ +from pathlib import Path + from result import ExpectedResult, Result from test_case import TestCaseBase @@ -6,7 +8,7 @@ class TestCase(TestCaseBase): def execute_test_logic(self) -> Result: expected = ExpectedResult( success=False, - invalid_includes=["File='target_mapping/use_lib_c.cpp', include='target_mapping/libs/c.h'"], + invalid_includes=[f"File='{Path('target_mapping/use_lib_c.cpp')}', include='target_mapping/libs/c.h'"], unused_public_deps=["//target_mapping/libs:a"], ) actual = self._run_dwyu( diff --git a/test/aspect/tree_artifact/test_invalid_tree_artifact.py b/test/aspect/tree_artifact/test_invalid_tree_artifact.py index d9c26f41..aeee919c 100644 --- a/test/aspect/tree_artifact/test_invalid_tree_artifact.py +++ b/test/aspect/tree_artifact/test_invalid_tree_artifact.py @@ -1,3 +1,5 @@ +from pathlib import Path + from result import ExpectedResult, Result from test_case import TestCaseBase @@ -7,7 +9,9 @@ def execute_test_logic(self) -> Result: expected = ExpectedResult( success=False, # We omit "File='bazel-out/ to allow testing in various environments - invalid_includes=["/bin/tree_artifact/sources.cc/tree_lib.cc', include='tree_artifact/some_lib.h'"], + invalid_includes=[ + f"{Path('/bin/tree_artifact/sources.cc/tree_lib.cc')}', include='tree_artifact/some_lib.h'" + ], ) actual = self._run_dwyu( target="//tree_artifact:tree_artifact_library", diff --git a/test/aspect/using_transitive_dep/test_detect_using_transitive_dep.py b/test/aspect/using_transitive_dep/test_detect_using_transitive_dep.py index ca181248..8f22da95 100644 --- a/test/aspect/using_transitive_dep/test_detect_using_transitive_dep.py +++ b/test/aspect/using_transitive_dep/test_detect_using_transitive_dep.py @@ -1,3 +1,5 @@ +from pathlib import Path + from result import ExpectedResult, Result from test_case import TestCaseBase @@ -6,7 +8,7 @@ class TestCase(TestCaseBase): def execute_test_logic(self) -> Result: expected = ExpectedResult( success=False, - invalid_includes=["File='using_transitive_dep/main.cpp', include='using_transitive_dep/foo.h'"], + invalid_includes=[f"File='{Path('using_transitive_dep/main.cpp')}', include='using_transitive_dep/foo.h'"], ) actual = self._run_dwyu(target="//using_transitive_dep:main", aspect=self.default_aspect) diff --git a/test/aspect/using_transitive_dep/test_detect_using_transitive_impl_dep.py b/test/aspect/using_transitive_dep/test_detect_using_transitive_impl_dep.py index 3e723498..fb9c00bd 100644 --- a/test/aspect/using_transitive_dep/test_detect_using_transitive_impl_dep.py +++ b/test/aspect/using_transitive_dep/test_detect_using_transitive_impl_dep.py @@ -1,3 +1,5 @@ +from pathlib import Path + from result import ExpectedResult, Result from test_case import TestCaseBase @@ -7,7 +9,7 @@ def execute_test_logic(self) -> Result: expected = ExpectedResult( success=False, invalid_includes=[ - "File='using_transitive_dep/transitive_usage_through_impl_deps.h', include='using_transitive_dep/foo.h'" + f"File='{Path('using_transitive_dep/transitive_usage_through_impl_deps.h')}', include='using_transitive_dep/foo.h'" ], ) actual = self._run_dwyu(