Skip to content

Commit

Permalink
tests: use diff -u -w through configure variables everywhere
Browse files Browse the repository at this point in the history
Don't mix -b with -w, use the latter to solve CR/LF issues on Windows.
Use @DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ configure variables everywhere
to avoid build issues.

Thanks to Isuru Fernando for reporting the issue. Refs #327.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Sep 29, 2018
1 parent 0c62ce8 commit c27b96c
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/hwloc/linux/allowed/test-topology.sh.in
Expand Up @@ -67,7 +67,7 @@ test_topology ()
else
if [ "$HWLOC_UPDATE_TEST_TOPOLOGY_OUTPUT" != 1 ]
then
@DIFF@ @HWLOC_DIFF_U@ -b "$expected_output" "$output"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ "$expected_output" "$output"
result=$?
else
if ! @DIFF@ "$expected_output" "$output" >/dev/null
Expand Down
4 changes: 2 additions & 2 deletions tests/hwloc/linux/gather/test-gather-topology.sh.in
Expand Up @@ -2,7 +2,7 @@
#-*-sh-*-

#
# Copyright © 2012-2017 Inria. All rights reserved.
# Copyright © 2012-2018 Inria. All rights reserved.
# Copyright © 2010-2014 Cisco Systems, Inc. All rights reserved.
# Copyright © 2011 Université Bordeaux
# See COPYING in top-level directory.
Expand Down Expand Up @@ -82,7 +82,7 @@ if ! "$lstopo" --no-io "$tmpdir/save2.xml" ; then
fi

echo "Comparing XML outputs..."
( cd $tmpdir && diff -u save1.xml save2.xml )
( cd $tmpdir && @DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ save1.xml save2.xml )
result=$?

rm -rf "$tmpdir"
Expand Down
2 changes: 1 addition & 1 deletion tests/hwloc/linux/test-topology.sh.in
Expand Up @@ -60,7 +60,7 @@ test_topology ()
else
if [ "$HWLOC_UPDATE_TEST_TOPOLOGY_OUTPUT" != 1 ]
then
@DIFF@ @HWLOC_DIFF_U@ -b "$expected_output" "$output"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ "$expected_output" "$output"
result=$?
else
if ! @DIFF@ "$expected_output" "$output" >/dev/null
Expand Down
2 changes: 1 addition & 1 deletion utils/hwloc/test-hwloc-annotate.sh.in
Expand Up @@ -68,5 +68,5 @@ pu:1
EOF
$annotate $file $file dummy distances $distances

@DIFF@ @HWLOC_DIFF_U@ $srcdir/test-hwloc-annotate.output "$file"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-annotate.output "$file"
rm -rf "$tmp"
2 changes: 1 addition & 1 deletion utils/hwloc/test-hwloc-calc.sh.in
Expand Up @@ -107,5 +107,5 @@ node:0 node:3
root
EOF
) > "$file"
@DIFF@ @HWLOC_DIFF_U@ $srcdir/test-hwloc-calc.output "$file"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-calc.output "$file"
rm -rf "$tmp"
4 changes: 2 additions & 2 deletions utils/hwloc/test-hwloc-compress-dir.sh.in
Expand Up @@ -46,10 +46,10 @@ set -e

$compress "$tmp/test-hwloc-compress-dir.input" "$tmp/test-hwloc-compress-dir.newoutput"

@DIFF@ @HWLOC_DIFF_U@ -r "$tmp/test-hwloc-compress-dir.output" "$tmp/test-hwloc-compress-dir.newoutput"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ -r "$tmp/test-hwloc-compress-dir.output" "$tmp/test-hwloc-compress-dir.newoutput"

$compress -R "$tmp/test-hwloc-compress-dir.newoutput" "$tmp/test-hwloc-compress-dir.newoutput2"

@DIFF@ @HWLOC_DIFF_U@ -r "$tmp/test-hwloc-compress-dir.input" "$tmp/test-hwloc-compress-dir.newoutput2"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ -r "$tmp/test-hwloc-compress-dir.input" "$tmp/test-hwloc-compress-dir.newoutput2"

rm -rf "$tmp"
6 changes: 3 additions & 3 deletions utils/hwloc/test-hwloc-diffpatch.sh.in
Expand Up @@ -2,7 +2,7 @@
#-*-sh-*-

#
# Copyright © 2009-2013 Inria. All rights reserved.
# Copyright © 2009-2018 Inria. All rights reserved.
# Copyright © 2014 Cisco Systems, Inc. All rights reserved.
# See COPYING in top-level directory.
#
Expand Down Expand Up @@ -52,8 +52,8 @@ cp $srcdir/test-hwloc-diffpatch.input1 .
cat $diffoutput | $patch refname - $output1
$patch -R $srcdir/test-hwloc-diffpatch.input2 $diffoutput $output2

diff -u $srcdir/test-hwloc-diffpatch.input1 "$output2"
diff -u $srcdir/test-hwloc-diffpatch.input2 "$output1"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-diffpatch.input1 "$output2"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-diffpatch.input2 "$output1"

cd ..
rm -rf "$tmp"
2 changes: 1 addition & 1 deletion utils/hwloc/test-hwloc-distrib.sh.in
Expand Up @@ -69,5 +69,5 @@ set -e
$distrib --if synthetic --input "2 2 2 2" --to core 9
echo
) > "$file"
@DIFF@ @HWLOC_DIFF_U@ $srcdir/test-hwloc-distrib.output "$file"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-distrib.output "$file"
rm -rf "$tmp"
2 changes: 1 addition & 1 deletion utils/hwloc/test-hwloc-info.sh.in
Expand Up @@ -60,5 +60,5 @@ set -e
echo
$info --if synthetic --input "node:2 core:2 l2:2 l1d:2 pu:2" --descendants l1d -s core:1-2
) > "$file"
@DIFF@ @HWLOC_DIFF_U@ $srcdir/test-hwloc-info.output "$file"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-info.output "$file"
rm -rf "$tmp"
2 changes: 1 addition & 1 deletion utils/lstopo/test-lstopo.sh.in
Expand Up @@ -100,5 +100,5 @@ echo "**** Import from synthetic so that we can check some exact outputs in $fil
echo "** Export to XML..."
$ls -i "$SI" -.xml
) > "$file"
@DIFF@ @HWLOC_DIFF_U@ $srcdir/test-lstopo.output "$file"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-lstopo.output "$file"
rm -rf "$tmp"

0 comments on commit c27b96c

Please sign in to comment.