32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
# Runs blossom's tests of its commands. Each makes projects in a folder of its
|
|||
|
|
# own, runs the blossom it's given first on them, and compares what it says and
|
||
|
|
# what it makes with what's expected. blossom's config in that folder names the
|
||
|
|
# `sakura` that `SAKURA` names, where it's set, as `blossom test` sets it, which
|
||
|
|
# finds the standard library as it does when it's run alone:
|
||
|
|
#
|
||
|
|
# blossom test --only blossom.commands
|
||
|
|
#
|
||
|
|
# or, from the root of the repository, with a blossom built:
|
||
|
|
#
|
||
|
|
# SAKURA=SAKURA sakura run tests/commands/*.sakura -- BLOSSOM
|
||
|
|
#
|
||
|
|
# Add `--only TEXT` after BLOSSOM to run those whose name holds the text, and
|
||
|
|
# `--here` to run them in one program, as a debugger wants. They run `git`, `sh`,
|
||
|
|
# and `tar`, so they run on Linux.
|
||
|
|
import std::io;
|
||
|
|
import std::process;
|
||
|
|
import system;
|
||
|
|
import std::testing;
|
||
|
|
|
||
|
|
def main(args: span<strview>): void {
|
||
|
|
if args.length == 0 || args[0].starts_with("-") {
|
||
|
|
io::println("blossom's tests are given the blossom they run first, as `-- .blossom/KEY/bin/blossom`.");
|
||
|
|
exit(2);
|
||
|
|
}
|
||
|
|
if process::variable("SAKURA") is none {
|
||
|
|
io::println("blossom's tests run the `sakura` that `SAKURA` names, as `blossom test` sets it.");
|
||
|
|
exit(2);
|
||
|
|
}
|
||
|
|
blossom_at = args[0];
|
||
|
|
exit(tester::run(args));
|
||
|
|
}
|