diff --git a/tests/core/ltlcross5.test b/tests/core/ltlcross5.test index 82e9fdc89..c89a7bd0b 100644 --- a/tests/core/ltlcross5.test +++ b/tests/core/ltlcross5.test @@ -1,6 +1,6 @@ #!/bin/sh # -*- coding: utf-8 -*- -# Copyright (C) 2019 Laboratoire de Recherche et Développement de +# Copyright (C) 2019, 2023 Laboratoire de Recherche et Développement de # l'Epita (LRDE). # # This file is part of Spot, a model checking library. @@ -24,10 +24,22 @@ set -e unset TMPDIR unset SPOT_TMPDIR +err=0 + +SPOT_TMPDIR=bar ltlcross ltl2tgba -f GFa 2>err && err=1 +cat err +grep 'failed to create temporary file' err +grep 'Note that the directory.*SPOT_TMPDIR ' err + +TMPDIR=bar ltlcross ltl2tgba -f GFa 2>err && err=2 +cat err +grep 'failed to create temporary file' err +grep 'Note that the directory.* TMPDIR ' err + + mkdir foo chmod a-w foo cd foo -err=0 if touch bar; then # We are likely running as root, so we cannot detect permission # issues. @@ -39,27 +51,17 @@ fi ltlcross ltl2tgba -f GFa 2>../err && err=1 cd .. cat err -grep 'failed to create temporary file' err || err=1 -grep 'executing this from a writable' err || err=1 +grep 'failed to create temporary file' err || err=3 +grep 'executing this from a writable' err || err=3 grep 'SPOT_TMPDIR' err || err=1 -SPOT_TMPDIR=foo ltlcross ltl2tgba -f GFa 2>err && err=2 +SPOT_TMPDIR=foo ltlcross ltl2tgba -f GFa 2>err && err=4 cat err -grep 'failed to create temporary file' err || err=2 -grep 'executing this from a writable' err && err=2 +grep 'failed to create temporary file' err || err=4 +grep 'executing this from a writable' err && err=4 grep 'SPOT_TMPDIR' err chmod a+w foo rmdir foo -SPOT_TMPDIR=bar ltlcross ltl2tgba -f GFa 2>err && err=3 -cat err -grep 'failed to create temporary file' err -grep 'Note that the directory.*SPOT_TMPDIR ' err - -TMPDIR=bar ltlcross ltl2tgba -f GFa 2>err && err=4 -cat err -grep 'failed to create temporary file' err -grep 'Note that the directory.* TMPDIR ' err - exit $err