From 2ae2eea54e127310612bf0f9fadf269b584eec98 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Tue, 5 Jul 2022 10:12:56 +0200 Subject: [PATCH] run-tests: fix command `debug` on NixOS 22.05 --- test/run-tests.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/run-tests.sh b/test/run-tests.sh index e63a823..589fa94 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -135,15 +135,17 @@ run() { echo "Running interactive testing environment" tests=$( echo 'is_interactive = True' - echo 'exec(os.environ["testScript"])' + echo 'exec(open(os.environ["testScript"]).read())' # Start VM echo 'start_all()' - # Start REPL + # Start REPL. + # Use `code.interact` for the REPL instead of the builtin test driver REPL + # because it supports low featured terminals like Emacs' shell-mode. echo 'import code' echo 'code.interact(local=globals())' ) else - tests='exec(os.environ["testScript"])' + tests='exec(open(os.environ["testScript"]).read())' fi echo "VM stats: CPUs: $numCPUs, memory: $memoryMiB MiB" @@ -154,10 +156,9 @@ run() { TMPDIR="$TMPDIR" \ USE_TMPDIR=1 \ NIX_DISK_IMAGE=$TMPDIR/img.qcow2 \ - tests="$tests" \ QEMU_OPTS="-smp $numCPUs -m $memoryMiB -nographic $QEMU_OPTS" \ QEMU_NET_OPTS="$QEMU_NET_OPTS" \ - $TMPDIR/driver/bin/nixos-test-driver + $TMPDIR/driver/bin/nixos-test-driver <(echo "$tests") } debug() {