Files
codeql/swift/ql/integration-tests/posix/frontend-invocations/test.py
Cornelius Riemenschneider a92a845719 Swift: Move all integration tests.
We are no longer bound to the platform-specific directories,
so simplify the test organization.
If you don't want this change, just skip merging this PR. It's purely optional.
2024-08-28 10:47:17 +02:00

25 lines
810 B
Python

from hashlib import sha256
from pathlib import Path
import runs_on
import pytest
@runs_on.posix
@pytest.mark.ql_test("DB-CHECK", xfail=True)
def test(codeql, swift, expected_files):
codeql.database.create(command="./build.sh")
with open("hashes.expected", "w") as expected:
for f in sorted(Path().glob("*.swiftmodule")):
with open(f, "rb") as module:
print(f.name, sha256(module.read()).hexdigest(), file=expected)
with open("hashes.actual", "w") as actual:
hashes = [
(s.name, s.resolve().name)
for s in Path("test-db/working/swift-extraction-artifacts/store").iterdir()
]
hashes.sort()
for module, hash in hashes:
print(module, hash, file=actual)
expected_files.add("hashes.expected")