From c90ac7bf7f144871365efc73b88a0baca5787abd Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Thu, 22 Sep 2022 17:33:21 -0500 Subject: [PATCH] Fix tests on macOS 10.10 All usages of `mktemp` must go through the (fish-only) `mktemp` test function that abstracts over the differences across multiple platforms/flavors. Tests can be easily run individually via `ninja -C build test_xxx` and there isn't a good reason to randomly manually override $HOME and $XDG_CONFIG_HOME for a test here and a test there. If it's absolutely necessary, littlecheck.py should be extended to support a `%temp` variable initialized to a temporary directory and that can be used instead of calling out to the platform-provided `mktemp` via a subshell. --- tests/checks/features-qmark1.fish | 2 +- tests/checks/set.fish | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/checks/features-qmark1.fish b/tests/checks/features-qmark1.fish index 6643581c1..6d42c8409 100644 --- a/tests/checks/features-qmark1.fish +++ b/tests/checks/features-qmark1.fish @@ -1,3 +1,3 @@ # Explicitly overriding HOME/XDG_CONFIG_HOME is only required if not invoking via `make test` -# RUN: env HOME="$(mktemp -d)" XDG_CONFIG_HOME="$(mktemp -d)" %fish --features '' -c 'string match --quiet "??" ab ; echo "qmarkon: $status"' +# RUN: env %fish --features '' -c 'string match --quiet "??" ab ; echo "qmarkon: $status"' #CHECK: qmarkon: 0 diff --git a/tests/checks/set.fish b/tests/checks/set.fish index 4fd30e19b..1fbc671f1 100644 --- a/tests/checks/set.fish +++ b/tests/checks/set.fish @@ -1,5 +1,5 @@ # Explicitly overriding HOME/XDG_CONFIG_HOME is only required if not invoking via `make test` -# RUN: env FISH=%fish HOME="$(mktemp -d)" XDG_CONFIG_HOME="$(mktemp -d)" %fish %s +# RUN: env FISH=%fish %fish %s # Environment variable tests # Test if variables can be properly set