python formatting

This commit is contained in:
Lynne Megido 2022-01-24 00:16:06 +10:00
parent e834c3e7fa
commit ee6224e98c
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90

13
test.py
View File

@ -1,13 +1,13 @@
#!/usr/bin/env python
# SPDX-FileCopyrightText: 2021-2022 Lynnesbian
#
# SPDX-License-Identifier: GPL-3.0-or-later
import re
import subprocess
import sys
def test_archs():
archs = ["aarch64", "powerpc", "riscv64gc"]
upto = 1
@ -15,9 +15,12 @@ def test_archs():
for arch in archs:
print(f"Testing {arch} ({upto} of {target})")
subprocess.run(f"cross test --features=json,infer-backend --target {arch}-unknown-linux-gnu".split(" ")).check_returncode()
subprocess\
.run(f"cross test --features=json,infer-backend --target {arch}-unknown-linux-gnu".split(" "))\
.check_returncode()
upto += 1
def test_versions():
match = re.search(
r'rust-version ?= ?"([\d.]+)"',
@ -41,9 +44,12 @@ def test_versions():
upto += 1
print(f"[{version}, {backend}] Scanning imgs ({upto} of {target})")
subprocess.run(f"cargo +{version} run --release --features=json,{backend}-backend -- imgs".split(" ")).check_returncode()
subprocess\
.run(f"cargo +{version} run --release --features=json,{backend}-backend -- imgs".split(" "))\
.check_returncode()
upto += 1
def main():
done_something = False
if "versions" in sys.argv:
@ -60,5 +66,6 @@ def main():
print("Done! You might want to run cargo clean...")
subprocess.run(["du", "-sh", "target"])
if __name__ == "__main__":
main()