mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +01:00
This harmonizes Swift integration tests with the rest of the repository, to prepare for the internal integration test runner to run them. The stripped down runner is kept compatible, so that current CI can still use it now. Maybe it will be kept for developer use. This PR includes: * moving the integration tests inside `ql` * editing `qlpack.yml` so that the internal runner can use it * change database directory to be `test-db` rather than `db`
23 lines
719 B
Python
23 lines
719 B
Python
from create_database_utils import *
|
|
from subprocess import check_call
|
|
from hashlib import sha256
|
|
from pathlib import Path
|
|
|
|
run_codeql_database_create([
|
|
'./build.sh',
|
|
], lang='swift',
|
|
)
|
|
|
|
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)
|
|
|
|
check_call(['diff', '-u', 'hashes.expected', 'hashes.actual'])
|