Repository navigation
Description
Problem
The case-layout validator searches the entire Wave source for host-os= and host-arch=. A string literal or an ordinary explanatory comment containing either text is rejected as legacy test metadata. This prevents otherwise legitimate cases from entering the manifest-driven test suite.
Confirmed against master ecb1637602ff409aab3d0c480fd9ec1e73e645ba using temporary case files; no Wave compiler is needed to reproduce the validator failure.
Reproduce from the repository root
from pathlib import Path
from tempfile import TemporaryDirectory
from types import SimpleNamespace
from unittest.mock import patch
from tools import case_manifest
with TemporaryDirectory() as temporary:
root = Path(temporary)
suite = root / "shared"
suite.mkdir()
for number in range(1, 11):
(suite / f"test{number}.wave").write_text(
'fun main() { println("host-os=linux"); }\n',
encoding="utf-8",
)
target = SimpleNamespace(suite="shared", suites=("shared",))
with patch.object(case_manifest, "CASES_ROOT", root):
case_manifest._validate_case_layout([target])Actual: CaseManifestError: case 'shared/test1.wave' uses legacy platform metadata; use its directory.
An ordinary comment such as // Ordinary text: host-arch=arm64 also triggers the same failure.
Starting points
- tools/case_manifest.py:
_validate_case_layout. - tools/test_contracts.py: existing leading
// wave-test:metadata handling. - tools/test_case_manifest.py: validator tests.
Small contribution scope
- Recognize deprecated keys in actual leading
// wave-test:directives instead of searching arbitrary source text. - Preserve rejection of both deprecated keys, including whitespace around the key/value separator and keys appearing after another comma-separated item.
- Add isolated temporary-directory regressions for string literals, ordinary comments, and real deprecated directives. Keep the suite count/numbering checks intact.
No compiler parser change, additional dependency, or test removal is needed.
Done when
- String literals and ordinary comments containing either text pass layout validation.
- Actual deprecated metadata is still rejected with the case path.
python3 -m unittest tools.test_case_manifest tools.test_test_contractspasses.
Python 3.11+ is sufficient for this task; LLVM and cross-platform toolchains are not required.
Activity