Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-image

Source of release 0.45.1

0.45.1 / tests / oracles / main.luc

# luce-image against independent codecs: gate.py builds the regression drivers and the Luce
# API, validation and navigation programs, then tests/check_*.py compare their output with
# Pillow, tifffile, imagecodecs and OpenEXR. It uses the Python of build/test-env when it
# exists (tests/requirements.txt), and skips when the oracles are not installed.
from luce_std import files, paths, process

let failed = ErrorCode.package(1)

pub func main(arguments: list[str]) -> int!:
    let root = process.current_directory()
    let here = process.variable("LUC_TEST_DIR") else "tests/oracles"
    let local = paths.join(root, "build/test-env/bin/python")
    let python = local if files.exists(local) else "python3"
    let done = process.run(python, [paths.join(here, "gate.py")])
    print(done.output.trim_end())
    if done.exit_code == 77:
        return 0
    if done.exit_code != 0:
        error(failed, f"gate.py: exit status {done.exit_code}\n{done.error_output}")
    return 0