diff options
Diffstat (limited to 'tests/Coreutils.pm')
-rw-r--r-- | tests/Coreutils.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/Coreutils.pm b/tests/Coreutils.pm index 0c8bb82c..71b15165 100644 --- a/tests/Coreutils.pm +++ b/tests/Coreutils.pm @@ -1,7 +1,7 @@ package Coreutils; # This is a testing framework. -# Copyright (C) 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1998-2013 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ my @Types = qw (IN IN_PIPE OUT ERR AUX CMP EXIT PRE POST OUT_SUBST my %Types = map {$_ => 1} @Types; my %Zero_one_type = map {$_ => 1} qw (OUT ERR EXIT PRE POST OUT_SUBST ERR_SUBST ENV); -my $srcdir = $ENV{srcdir}; +my $srcdir = "$ENV{srcdir}"; my $Global_count = 1; # When running in a DJGPP environment, make $ENV{SHELL} point to bash. @@ -46,7 +46,7 @@ defined $ENV{DJDIR} # ================ # 'contents' contents only (file name is derived from test name) # {filename => 'contents'} filename and contents -# {filename => undef} filename only -- $(srcdir)/filename must exist +# {filename => undef} filename only -- $(srcdir)/tests/filename must exist # # FIXME: If there is more than one input file, then you can't specify 'REDIR'. # PIPE is still ok. @@ -130,14 +130,14 @@ sub _compare_files ($$$$$) { my ($program_name, $test_name, $in_or_out, $actual, $expected) = @_; - my $differ = compare ($expected, $actual); + my $differ = compare ($actual, $expected); if ($differ) { my $info = (defined $in_or_out ? "std$in_or_out " : ''); warn "$program_name: test $test_name: ${info}mismatch, comparing " - . "$actual (actual) and $expected (expected)\n"; + . "$expected (expected) and $actual (actual)\n"; # Ignore any failure, discard stderr. - system "diff -c $actual $expected 2>/dev/null"; + system "diff -c $expected $actual 2>/dev/null"; } return $differ; @@ -185,7 +185,7 @@ sub _process_file_spec ($$$$$) # FIXME: put $srcdir in here somewhere warn "$program_name: $test_name: specified file '$file' does" . " not exist\n" - if ! -f "$srcdir/$file"; + if ! -f "$srcdir/tests/$file"; } return $file; |