interplane.Get Omega
Read in your language

omega-feel

This project has not described itself yet.

Brought by drakestapleton

branch main Branches Tags History

omega-feel / tests / seal.sh

13 lines · 951 bytes Raw Blame History
1#!/bin/sh
2# tests/seal.sh: write tests/wolfram.sha256, one line per Wolfram script: its name, its SHA-256, the file
3# holding its result and that file's SHA-256. The result of oracle.wl is expected-wolfram.txt; the result
4# of every other NAME.wl is NAME-result.txt. Run it after a script has been evaluated and its final value
5# written to the result file; tests/run.sh then fails when a script or a result changes without the
6# other being evaluated and sealed again. It records what is on disk. It does not run Wolfram, so it
7# cannot show that a result came from its script: a second evaluation by someone else does that.
8cd "$(dirname "$0")" || exit 1
9for w in *.wl; do
10 case $w in oracle.wl) r=expected-wolfram.txt ;; *) r=${w%.wl}-result.txt ;; esac
11 [ -f "$r" ] || { echo "seal: no $r for $w" >&2; exit 1; }
12 printf '%s %s %s %s\n' "$w" "$(sha256sum < "$w" | cut -d' ' -f1)" "$r" "$(sha256sum < "$r" | cut -d' ' -f1)"
13done > wolfram.sha256