]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: make ls tests independent of COLORTERM env
authorPádraig Brady <P@draigBrady.com>
Fri, 18 Apr 2014 10:19:10 +0000 (11:19 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 18 Apr 2014 10:23:37 +0000 (11:23 +0100)
Since the recent commit v8.22-68-g08783f1, ls coloring
is now dependent on the COLORTERM environment variable.

* tests/envvar-check: Unset COLORTERM from test environment.
* tests/ls/color-dtype-dir.sh: Ensure coloring is used.
* tests/misc/ls-misc.pl: Likewise.

Prompted by the continuous integration build failure at:
http://hydra.nixos.org/build/10397646

tests/envvar-check
tests/ls/color-dtype-dir.sh
tests/misc/ls-misc.pl

index 09b4ded5fe18d4bb65e6bc6ba29ab93e831587aa..b6d94b4cb71d4205204b2cfebeb966dfa81128e3 100644 (file)
@@ -43,6 +43,7 @@ vars='
   SIMPLE_BACKUP_SUFFIX
   TABSIZE
   TERM
+  COLORTERM
   TIME_STYLE
   TMPDIR
   VERSION_CONTROL
index 88dd781ff64add3347a15fad19a22c8b21213408..559a188494b6841816ff859687f84ba12c5ee572 100755 (executable)
@@ -30,7 +30,7 @@ chmod o+w other-writable || framework_failure_
 chmod o+t sticky || framework_failure_
 
 
-ls --color=always > out || fail=1
+TERM=xterm ls --color=always > out || fail=1
 cat -A out > o1 || fail=1
 mv o1 out || fail=1
 
index f562b72e6ac4036af33c2ec6495a1fdcb698a085..a47e70b7abc88940faed55df7f467cf0b3ec7869 100755 (executable)
@@ -303,9 +303,12 @@ my @Tests =
             . "\e[37;44msticky$e\n"
          },
 
+        {PRE => sub {
+         push_ls_colors('ow=34;42:tw=30;42:sg=30;43:su=37;41:st=37;44'); }},
         {POST => sub {
          unlink qw(setuid setgid);
-         foreach my $dir (qw(owr owt sticky)) {rmdir $dir} }},
+         foreach my $dir (qw(owr owt sticky)) {rmdir $dir}
+         restore_ls_colors; }},
          ],
 
      # For 5.97 and earlier, --file-type acted like --indicator-style=slash.