~ubuntu-branches/ubuntu/vivid/mpich/vivid-proposed

« back to all changes in this revision

Viewing changes to src/pm/hydra/tools/topo/hwloc/hwloc/tests/xml/test-topology.sh.in

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-04-01 20:24:20 UTC
  • mfrom: (5.2.4 sid)
  • Revision ID: package-import@ubuntu.com-20140401202420-t5ey1ia2klt5dkq3
Tags: 3.1-4
* [c3e3398] Disable test_primitives, which is unreliable on some platforms.
            (Closes: #743047)
* [265a699] Add minimal autotest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
#
5
5
# Copyright © 2009 CNRS
6
 
# Copyright © 2009-2012 Inria.  All rights reserved.
 
6
# Copyright © 2009-2013 Inria.  All rights reserved.
7
7
# Copyright © 2009-2012 Université Bordeaux 1
8
8
# Copyright © 2010 Cisco Systems, Inc.  All rights reserved.
9
9
# See COPYING in top-level directory.
16
16
HWLOC_top_srcdir="@HWLOC_top_srcdir@"
17
17
lstopo="@HWLOC_top_builddir@/utils/lstopo-no-graphics"
18
18
 
19
 
HWLOC_PLUGINS_PATH=${abs_top_builddir}/src
 
19
HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/src
20
20
export HWLOC_PLUGINS_PATH
21
21
 
22
22
if test x@HWLOC_XML_LOCALIZED@ = x1; then
52
52
 
53
53
set -e
54
54
 
 
55
dirname=`dirname $1`
 
56
basename=`basename $1 .xml`
 
57
 
 
58
source="${dirname}/${basename}.xml"
 
59
source_file="${dirname}/${basename}.source"
 
60
test -f "$source_file" && source="${dirname}/"`cat $source_file`
 
61
 
 
62
options_file="${dirname}/${basename}.options"
 
63
test -f "$options_file" && opts=`cat $options_file`
 
64
 
 
65
test -f "${dirname}/${basename}.env" && . "${dirname}/${basename}.env"
 
66
 
55
67
do_run()
56
68
{
57
 
  $lstopo --if xml --input "$1" --of xml "$file"
 
69
  echo $lstopo --if xml --input "$source" --of xml "$file" $opts
 
70
  $lstopo --if xml --input "$source" --of xml "$file" $opts
58
71
 
59
72
  if [ "$HWLOC_UPDATE_TEST_TOPOLOGY_OUTPUT" != 1 ]
60
73
  then
61
 
    diff @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ "$1" "$file"
 
74
    diff @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ "${dirname}/${basename}.xml" "$file"
62
75
  else
63
 
    if ! diff "$1" "$file" >/dev/null
 
76
    if ! diff "${dirname}/${basename}.xml" "$file" >/dev/null
64
77
    then
65
 
        cp -f "$file" "$1"
66
 
        echo "Updated $1"
 
78
        cp -f "$file" "${dirname}/${basename}.xml"
 
79
        echo "Updated ${basename}.xml"
67
80
    fi
68
81
  fi
69
82
 
82
95
echo "Importing with default parser and reexporting with minimalistic implementation..."
83
96
HWLOC_NO_LIBXML_IMPORT=0
84
97
HWLOC_NO_LIBXML_EXPORT=1
85
 
do_run "$1"
 
98
do_run "$dirname" "$basename"
86
99
echo "Importing with minimalistic parser and reexporting with default implementation..."
87
100
HWLOC_NO_LIBXML_IMPORT=1
88
101
HWLOC_NO_LIBXML_EXPORT=0
89
 
do_run "$1"
 
102
do_run "$dirname" "$basename"
90
103
 
91
104
rm -rf "$tmp"