aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-08-09 23:24:17 -0700
committerJade Lovelace <lix@jade.fyi>2024-08-10 16:10:16 -0700
commit0c7619535112e19232384e15e82ffa6a5af7569d (patch)
treec9500d6bc74b50a8bb39f580ebf5389de10e786c /tests
parent292567e0b0a4681eb8ca803c26293d70857fe387 (diff)
build: remove expect as a dependency
I was packaging Lix 2.91 for nixpkgs and was annoyed at the expect dependency. Turns out that you can replace unbuffer with a pretty-short Python script. It became less short after I found out that Linux was converting \n to \r\n in the terminal subsystem, which was not very funny, but is at least solved by twiddling termios bits. Change-Id: I8a2700abcbbf6a9902e01b05b40fa9340c0ab90c
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/common/vars-and-functions.sh.in4
-rw-r--r--tests/functional/flakes/show.sh3
-rw-r--r--tests/functional/meson.build2
3 files changed, 8 insertions, 1 deletions
diff --git a/tests/functional/common/vars-and-functions.sh.in b/tests/functional/common/vars-and-functions.sh.in
index eda15308d..451cf5383 100644
--- a/tests/functional/common/vars-and-functions.sh.in
+++ b/tests/functional/common/vars-and-functions.sh.in
@@ -234,6 +234,10 @@ enableFeatures() {
sed -i 's/experimental-features .*/& '"$features"'/' "$NIX_CONF_DIR"/nix.conf
}
+runinpty() {
+ @python@ @runinpty@ "$@"
+}
+
set -x
onError() {
diff --git a/tests/functional/flakes/show.sh b/tests/functional/flakes/show.sh
index 25f481575..857c77ae1 100644
--- a/tests/functional/flakes/show.sh
+++ b/tests/functional/flakes/show.sh
@@ -104,7 +104,8 @@ cat >flake.nix<<EOF
};
}
EOF
-unbuffer sh -c '
+
+runinpty sh -c '
stty rows 20 cols 100
nix flake show > show-output.txt
'
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 2b5dfe422..fb8d77a57 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -7,6 +7,8 @@ test_confdata = {
'sandbox_shell': busybox.found() ? busybox.full_path() : '',
'PACKAGE_VERSION': meson.project_version(),
'system': host_system,
+ 'python': python.full_path(),
+ 'runinpty': runinpty.full_path(),
}
# Just configures `common/vars-and-functions.sh.in`.