From d65871241dc37d76d6a316398d153a394eb057bb Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Thu, 16 Sep 2021 17:58:50 +0200 Subject: [PATCH] chore: replace `sed` with `perl` in test driver Consistent across all three platforms --- nix/bootstrap.nix | 3 ++- tests/common.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nix/bootstrap.nix b/nix/bootstrap.nix index 1b8b916b10..171aa10105 100644 --- a/nix/bootstrap.nix +++ b/nix/bootstrap.nix @@ -1,5 +1,5 @@ { debug ? false, stage0debug ? false, extraCMakeFlags ? [], - stdenv, lib, cmake, gmp, gnumake, bash, buildLeanPackage, writeShellScriptBin, runCommand, symlinkJoin, lndir, + stdenv, lib, cmake, gmp, gnumake, bash, buildLeanPackage, writeShellScriptBin, runCommand, symlinkJoin, lndir, perl, ... } @ args: with builtins; rec { @@ -122,6 +122,7 @@ rec { test = buildCMake { name = "lean-test-${desc}"; realSrc = lib.sourceByRegex ../. [ "src.*" "tests.*" ]; + buildInputs = [ gmp perl ]; preConfigure = '' cd src ''; diff --git a/tests/common.sh b/tests/common.sh index efc8d5e2cb..532ccf9e44 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -27,7 +27,7 @@ function compile_lean { function exec_capture { # mvar suffixes like in `?m.123` are deterministic but prone to change on minor changes, so strip them - "$@" 2>&1 | sed -E 's/(\?\w)\.[0-9]+/\1/g' > "$f.produced.out" + "$@" 2>&1 | perl -pe 's/(\?\w)\.[0-9]+/\1/g' > "$f.produced.out" } # Remark: `${var+x}` is a parameter expansion which evaluates to nothing if `var` is unset, and substitutes the string `x` otherwise.