This is a mirror of the GitLab repo!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.6 KiB

#!/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
target = len(archs)
for arch in archs:
print(f"Testing {arch} ({upto} of {target})")"cross test --features=json,infer-backend --target {arch}-unknown-linux-gnu".split(" ")).check_returncode()
upto += 1
def test_versions():
match =
r'rust-version ?= ?"([\d.]+)"',
open("Cargo.toml", "r").read(-1)
if not match:
print("Couldn't find rust-version")
versions = [, "stable", "nightly"]
backends = ["xdg-mime", "infer"]
upto = 1
target = len(versions) * len(backends) * 2
for version in versions:
for backend in backends:
print(f"[{version}, {backend}] Tests ({upto} of {target})")"cargo +{version} test --features=json,{backend}-backend".split(" ")).check_returncode()
upto += 1
print(f"[{version}, {backend}] Scanning imgs ({upto} of {target})")"cargo +{version} run --release --features=json,{backend}-backend -- imgs".split(" ")).check_returncode()
upto += 1
def main():
done_something = False
if "versions" in sys.argv:
done_something = True
if "archs" in sys.argv:
done_something = True
if not done_something:
print("You must supply at least one of `versions` or `archs` as an argument! 0uo")
print("Done! You might want to run cargo clean...")["du", "-sh", "target"])
if __name__ == "__main__":