1#!/bin/sh 2#-*-sh-*- 3 4# 5# Copyright © 2015-2018 Inria. All rights reserved. 6# See COPYING in top-level directory. 7# 8 9HWLOC_top_srcdir="@HWLOC_top_srcdir@" 10HWLOC_top_builddir="@HWLOC_top_builddir@" 11srcdir="$HWLOC_top_srcdir/utils/hwloc" 12builddir="$HWLOC_top_builddir/utils/hwloc" 13hdhd="$builddir/hwloc-dump-hwdata" 14 15: ${TMPDIR=/tmp} 16{ 17 tmp=` 18 (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null 19 ` && 20 test -n "$tmp" && test -d "$tmp" 21} || { 22 tmp=$TMPDIR/foo$$-$RANDOM 23 (umask 077 && mkdir "$tmp") 24} || exit $? 25 26set -e 27 28tarball="$srcdir/test-hwloc-dump-hwdata/"`basename $1` 29(cd "$tmp" && tar xfj $tarball) 30 31HWLOC_FSROOT="`echo "$tmp"/*`" 32export HWLOC_FSROOT 33 34$hdhd -o $tmp/output 35 36@DIFF@ @HWLOC_DIFF_U@ -r "$HWLOC_FSROOT/expected_output" "$tmp/output" 37 38rm -rf "$tmp" 39