Skip to content

Commit

Permalink
Update interpreter test output
Browse files Browse the repository at this point in the history
This also makes a couple minor changes re: running the script:

- removes the “belt and suspenders” `echo`ing that resulted in things being printed in triplicate
- added `gettext` to the Nix environment,  so `envsubst` is available
- changed the #!, to not get stuck with Bash 3.2 on macOS.
  • Loading branch information
sellout committed Nov 11, 2024
1 parent bc93be5 commit 2673620
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions nix/haskell-nix-flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
(args.nativeBuildInputs or [])
++ [
pkgs.cachix
pkgs.gettext # for envsubst, used by unison-src/builtin-tests/interpreter-tests.sh
pkgs.hpack
pkgs.pkg-config
pkgs.stack-wrapped
Expand Down
12 changes: 10 additions & 2 deletions unison-src/builtin-tests/interpreter-tests.output.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@ If you want to add or update tests, you can create a branch of that project, and

Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release.

``` ucm :hide:error
scratch/main> this is a hack to trigger an error, in order to swallow any error on the next line.
scratch/main> we delete the project to avoid any merge conflicts or complaints from ucm.
scratch/main> delete.project runtime-tests
```

``` ucm :hide
scratch/main> clone @unison/runtime-tests/releases/0.0.1 runtime-tests/selected
```

``` ucm
runtime-tests/selected> run tests
()
runtime-tests/selected> run tests.interpreter.only
()
```
4 changes: 1 addition & 3 deletions unison-src/builtin-tests/interpreter-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -ex

if [ -z "$1" ]; then
Expand All @@ -8,13 +8,11 @@ else
fi

runtime_tests_version="@unison/runtime-tests/releases/0.0.1"
echo $runtime_tests_version

codebase=${XDG_CACHE_HOME:-"$HOME/.cache"}/unisonlanguage/runtime-tests.unison

runtime_tests_version="$runtime_tests_version" \
envsubst '$runtime_tests_version' \
< unison-src/builtin-tests/interpreter-tests.tpl.md \
> unison-src/builtin-tests/interpreter-tests.md
echo "$ucm" transcript.fork -C $codebase -S $codebase unison-src/builtin-tests/interpreter-tests.md
time "$ucm" transcript.fork -C $codebase -S $codebase unison-src/builtin-tests/interpreter-tests.md

0 comments on commit 2673620

Please sign in to comment.