Update run_test and run_bench scripts

This commit is contained in:
Joscha
2026-03-13 17:30:55 +01:00
parent 67352d7a21
commit 1f2819252a
59 changed files with 22 additions and 165 deletions

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../../tests/env_test.sh
leanmake --always-make bin
capture ./build/bin/test hello world

3
doc/examples/run_test → doc/examples/run_test.sh Executable file → Normal file
View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../tests/env_test.sh
capture_only "$1" \
lean -Dlinter.all=false "$1"
check_exit_is_success

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_bench.sh
STAGE_THIS="stage$STAGE"
STAGE_NEXT="stage$((STAGE + 1))"
@@ -17,19 +14,7 @@ echo ">"
echo "> Configuring $STAGE_NEXT..."
echo ">"
# Building a stage mostly affects files in that stage's build directory.
# However, the bench suite runs inside the source directory for developer UX
# reasons, so some stage-specific bench suite files are generated in the source
# directory (namely the env_*.sh files).
#
# To avoid messing up the rest of the bench suite, we restore those files to
# STAGE_THIS's versions immediately after we configure STAGE_NEXT. Yes, this is
# a big hack, but it allows running the build benchmark as part of the bench
# suite instead of completely separately.
#
# Configuring STAGE_NEXT also builds all stages up to and including STAGE_THIS.
make -C "$BUILD_ROOT" -j"$(nproc)" "$STAGE_NEXT-configure"
make -C "$BUILD_ROOT" -j"$(nproc)" "$STAGE_THIS-configure"

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../../env_bench.sh
rm -f measurements.jsonl
# Build dependencies first so their compilation isn't measured.

View File

@@ -1,5 +1,2 @@
#!/usr/bin/env bash
source ../../../env_test.sh
# Limit threads to avoid exhausting memory with the large thread stack.
LEAN_NUM_THREADS=1 lake test

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_bench.sh
make -C "$BUILD_DIR" install DESTDIR="$(realpath install)"
python measure_sizes.py "$SRC_DIR" "$BUILD_DIR" install measurements.jsonl
rm -rf install

2
tests/compile/run_bench → tests/compile/run_bench.sh Executable file → Normal file
View File

@@ -1,5 +1,3 @@
#!/usr/bin/env bash
source ../env_bench.sh
source_init "$1"
if [[ -f "$1.do_compile_bench" ]]; then DO_COMPILE=1

2
tests/compile/run_test → tests/compile/run_test.sh Executable file → Normal file
View File

@@ -1,5 +1,3 @@
#!/usr/bin/env bash
source ../env_test.sh
source_init "$1"
if [[ -f "$1.do_compile_test" ]]; then DO_COMPILE=1

View File

@@ -1,5 +1,3 @@
#!/usr/bin/env bash
source ../env_bench.sh
source_init "$1"
if [[ -f "$1.do_compile_bench" ]]; then DO_COMPILE=1

View File

@@ -1 +0,0 @@
../compile/run_test

View File

@@ -0,0 +1 @@
../compile/run_test.sh

3
tests/docparse/run_test → tests/docparse/run_test.sh Executable file → Normal file
View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../env_test.sh
# IO.Process.exit (used by the file worker) seems to be incompatible with LSAN
# TODO: investigate or work around
export ASAN_OPTIONS=detect_leaks=0

3
tests/elab/run_test → tests/elab/run_test.sh Executable file → Normal file
View File

@@ -1,7 +1,4 @@
#!/usr/bin/env bash
source ../env_test.sh
source_init "$1"
run_before "$1"
# `--root` to infer same private names as in the server

View File

@@ -1,7 +1,4 @@
#!/usr/bin/env bash
source ../env_bench.sh
source_init "$1"
run_before "$1"
TOPIC="elab/$(basename "$1" .lean)"

View File

@@ -1 +0,0 @@
../elab/run_test

View File

@@ -0,0 +1 @@
../elab/run_test.sh

View File

@@ -1,7 +1,4 @@
#!/usr/bin/env bash
source ../env_test.sh
source_init "$1"
run_before "$1"
# `--root` to infer same private names as in the server

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_bench.sh
PREFIX="lake/inundation"
rm -f measurements.jsonl

3
tests/misc/run_test → tests/misc/run_test.sh Executable file → Normal file
View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../env_test.sh
NAME="$1"
FILE="$(realpath "$1")"
source "$1"

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../env_bench.sh
NAME="$1"
FILE="$(realpath "$1")"
OUT="$FILE.measurements.jsonl"

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
# LEAN_EXPORTING needs to be defined for .c files included in shared libraries
lean --c=SnakeLinter.c SnakeLinter.lean
leanc ${LEANC_OPTS-} -O3 -DNDEBUG -DLEAN_EXPORTING -shared -o SnakeLinter.so SnakeLinter.c

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
# IO.Process.exit (used by the file worker) seems to be incompatible with LSAN
# TODO: investigate or work around
export ASAN_OPTIONS=detect_leaks=0

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -0,0 +1,2 @@
rm -rf .lake/build
lake build

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -0,0 +1,2 @@
rm -rf .lake/build
lake build

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
run lake exe release

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
# The test covers the behavior of transitively importing multiple modules
# that have a definition with the same name.

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -0,0 +1,2 @@
rm -rf .lake/build
lake build

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -0,0 +1,2 @@
rm -rf .lake/build
lake build

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -0,0 +1,2 @@
rm -rf .lake/build
lake build

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -0,0 +1,2 @@
rm -rf .lake/build
lake build

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
# This test covers importing modules which are defined in multiple packages
# (with the same original package name).

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
LEAN_ABORT_ON_PANIC=1 lake build

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake exe "path with spaces"
# presence of this file should not break process spawn

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -0,0 +1,2 @@
rm -rf .lake/build
lake build

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
mkdir -p Rebuild

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
# Test that Lean will use the specified olean from `setup.json`
lean Dep.lean -o Dep.olean
lean Test.lean --setup setup.json

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build release

View File

@@ -1,5 +1,2 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
LEAN_ABORT_ON_PANIC=1 lake build

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
# We need a package test because we need multiple files with imports.
# Currently the other package tests all succeed,
# but here we need to check for a particular error message.

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -0,0 +1,2 @@
rm -rf .lake/build
lake build

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake exe user_attr

View File

@@ -0,0 +1,2 @@
rm -rf .lake/build
lake exe user_attr

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
capture lake build -v

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build

View File

@@ -0,0 +1,2 @@
rm -rf .lake/build
lake build

View File

@@ -1,5 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
set -euo pipefail
# Deermine shared library extension

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../../env_test.sh
# This directory contains a unified version of the "ring example"
# developed by Kim across the following 4 repositories:
#

3
tests/server/run_test → tests/server/run_test.sh Executable file → Normal file
View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../env_test.sh
run_before "$1"
capture_only "$1" \

View File

@@ -1,6 +1,3 @@
#!/usr/bin/env bash
source ../env_test.sh
# IO.Process.exit (used by the file worker) seems to be incompatible with LSAN
# TODO: investigate or work around
export ASAN_OPTIONS=detect_leaks=0