From 2157d91a5cfdd9f79135837644b385ad9efe544c Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 29 Aug 2021 12:38:28 -0500 Subject: [PATCH] Re-add explicit littlecheck HOME/XDG_CONFIG_HOME overrides on request This was requested by a team member who would like for some tests to remain invokable (in thier own $HOME) directly via littlecheck without relying on the test driver to prep the environment. A comment explaining the rationale is also added so this doesn't get passed down as folklore "you need to include this for tests to run" even though no one understands why. --- tests/checks/features-qmark1.fish | 3 ++- tests/checks/set.fish | 5 +++-- tests/checks/symlinks-not-overwritten.fish | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/checks/features-qmark1.fish b/tests/checks/features-qmark1.fish index 73a244331..6643581c1 100644 --- a/tests/checks/features-qmark1.fish +++ b/tests/checks/features-qmark1.fish @@ -1,2 +1,3 @@ -#RUN: env %fish --features '' -c 'string match --quiet "??" ab ; echo "qmarkon: $status"' +# 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"' #CHECK: qmarkon: 0 diff --git a/tests/checks/set.fish b/tests/checks/set.fish index fa1288934..dae4845d1 100644 --- a/tests/checks/set.fish +++ b/tests/checks/set.fish @@ -1,4 +1,5 @@ -# RUN: env FISH=%fish %fish %s +# 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 # Environment variable tests # Test if variables can be properly set @@ -802,7 +803,7 @@ function test-function-scope #CHECK: $globalvar: set in global scope, unexported, with 1 elements #CHECK: $globalvar[1]: |global| end - + test-function-scope echo $funcvar $funcvar2 # CHECK: diff --git a/tests/checks/symlinks-not-overwritten.fish b/tests/checks/symlinks-not-overwritten.fish index 1aec377a6..0a3aa5dac 100644 --- a/tests/checks/symlinks-not-overwritten.fish +++ b/tests/checks/symlinks-not-overwritten.fish @@ -1,4 +1,5 @@ -#RUN: %fish -C 'set -g fish %fish' %s +# 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 -C 'set -g fish %fish' %s mkdir -p $XDG_CONFIG_HOME/fish