]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
utils/tests: add hwloc-compress-dir
authorBrice Goglin <brice.goglin@inria.fr>
Tue, 24 Sep 2013 14:16:24 +0000 (14:16 +0000)
committerBrice Goglin <brice.goglin@inria.fr>
Tue, 24 Sep 2013 14:16:24 +0000 (14:16 +0000)
This commit was SVN r5816.

config/hwloc_internal.m4
utils/Makefile.am
utils/test-hwloc-compress-dir.input.tar.gz [new file with mode: 0644]
utils/test-hwloc-compress-dir.output.tar.gz [new file with mode: 0644]
utils/test-hwloc-compress-dir.sh.in [new file with mode: 0755]

index 3932f6b039ccb18d0ba31f0d25a0afc341a751b2..b9d46973f8f48428ae19020996cd8f98385a0ad2 100644 (file)
@@ -413,6 +413,7 @@ int foo(void) {
         hwloc_config_prefix[utils/test-hwloc-annotate.sh]
         hwloc_config_prefix[utils/test-hwloc-assembler.sh]
         hwloc_config_prefix[utils/test-hwloc-calc.sh]
+        hwloc_config_prefix[utils/test-hwloc-compress-dir.sh]
         hwloc_config_prefix[utils/test-hwloc-diffpatch.sh]
         hwloc_config_prefix[utils/test-hwloc-distances.sh]
         hwloc_config_prefix[utils/test-hwloc-distrib.sh]
@@ -420,7 +421,7 @@ int foo(void) {
         hwloc_config_prefix[utils/test-hwloc-ls.sh]
         hwloc_config_prefix[utils/test-fake-plugin.sh])
 
-    AC_CONFIG_COMMANDS([chmoding-scripts], [chmod +x ]hwloc_config_prefix[tests/linux/test-topology.sh ]hwloc_config_prefix[tests/xml/test-topology.sh ]hwloc_config_prefix[tests/linux/hwloc-gather-topology ]hwloc_config_prefix[tests/linux/gather/test-gather-topology.sh ]hwloc_config_prefix[tests/wrapper.sh ]hwloc_config_prefix[utils/hwloc-assembler-remote ]hwloc_config_prefix[utils/hwloc-compress-dir ]hwloc_config_prefix[utils/test-hwloc-annotate.sh ]hwloc_config_prefix[utils/test-hwloc-assembler.sh ]hwloc_config_prefix[utils/test-hwloc-calc.sh ]hwloc_config_prefix[utils/test-hwloc-diffpatch.sh ]hwloc_config_prefix[utils/test-hwloc-distances.sh ]hwloc_config_prefix[utils/test-hwloc-distrib.sh ]hwloc_config_prefix[utils/test-hwloc-info.sh ]hwloc_config_prefix[utils/test-hwloc-ls.sh ]hwloc_config_prefix[utils/test-fake-plugin.sh])
+    AC_CONFIG_COMMANDS([chmoding-scripts], [chmod +x ]hwloc_config_prefix[tests/linux/test-topology.sh ]hwloc_config_prefix[tests/xml/test-topology.sh ]hwloc_config_prefix[tests/linux/hwloc-gather-topology ]hwloc_config_prefix[tests/linux/gather/test-gather-topology.sh ]hwloc_config_prefix[tests/wrapper.sh ]hwloc_config_prefix[utils/hwloc-assembler-remote ]hwloc_config_prefix[utils/hwloc-compress-dir ]hwloc_config_prefix[utils/test-hwloc-annotate.sh ]hwloc_config_prefix[utils/test-hwloc-assembler.sh ]hwloc_config_prefix[utils/test-hwloc-calc.sh ]hwloc_config_prefix[utils/test-hwloc-compress-dir.sh ]hwloc_config_prefix[utils/test-hwloc-diffpatch.sh ]hwloc_config_prefix[utils/test-hwloc-distances.sh ]hwloc_config_prefix[utils/test-hwloc-distrib.sh ]hwloc_config_prefix[utils/test-hwloc-info.sh ]hwloc_config_prefix[utils/test-hwloc-ls.sh ]hwloc_config_prefix[utils/test-fake-plugin.sh])
 
     # These links are only needed in standalone mode.  It would
     # be nice to m4 foreach this somehow, but whenever I tried
index 21a846146e3e1be55d40b256fdda9b540b4b6ff6..872d342f86185e6819ebd361e3b2e000f175c491 100644 (file)
@@ -16,6 +16,7 @@ EXTRA_DIST = \
        test-hwloc-annotate.input test-hwloc-annotate.output \
        test-hwloc-assembler.input1 test-hwloc-assembler.input2 test-hwloc-assembler.output \
        test-hwloc-calc.output \
+       test-hwloc-compress-dir.input.tar.gz test-hwloc-compress-dir.output.tar.gz \
        test-hwloc-diffpatch.input1 test-hwloc-diffpatch.input2 \
        test-hwloc-distances.output \
        test-hwloc-distrib.output \
@@ -79,6 +80,7 @@ TESTS = \
        test-hwloc-annotate.sh \
        test-hwloc-assembler.sh \
        test-hwloc-calc.sh \
+       test-hwloc-compress-dir.sh \
        test-hwloc-diffpatch.sh \
        test-hwloc-distances.sh \
        test-hwloc-distrib.sh \
diff --git a/utils/test-hwloc-compress-dir.input.tar.gz b/utils/test-hwloc-compress-dir.input.tar.gz
new file mode 100644 (file)
index 0000000..2d70a72
Binary files /dev/null and b/utils/test-hwloc-compress-dir.input.tar.gz differ
diff --git a/utils/test-hwloc-compress-dir.output.tar.gz b/utils/test-hwloc-compress-dir.output.tar.gz
new file mode 100644 (file)
index 0000000..697590e
Binary files /dev/null and b/utils/test-hwloc-compress-dir.output.tar.gz differ
diff --git a/utils/test-hwloc-compress-dir.sh.in b/utils/test-hwloc-compress-dir.sh.in
new file mode 100755 (executable)
index 0000000..578f132
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+#-*-sh-*-
+
+#
+# Copyright © 2013 Inria.  All rights reserved.
+# See COPYING in top-level directory.
+#
+
+HWLOC_top_builddir="@HWLOC_top_builddir@"
+compress="$HWLOC_top_builddir/utils/hwloc-compress-dir"
+HWLOC_top_srcdir="@HWLOC_top_srcdir@"
+
+HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/src
+export HWLOC_PLUGINS_PATH
+
+if test x@HWLOC_XML_LOCALIZED@ = x1; then
+  # make sure we use default numeric formats
+  LANG=C
+  LC_ALL=C
+  export LANG LC_ALL
+fi
+
+: ${TMPDIR=/tmp}
+{
+  tmp=`
+    (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
+  ` &&
+  test -n "$tmp" && test -d "$tmp"
+} || {
+  tmp=$TMPDIR/foo$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || exit $?
+
+set -e
+
+(cd "$tmp" && gunzip -c $HWLOC_top_srcdir/utils/test-hwloc-compress-dir.input.tar.gz | tar xf -)
+(cd "$tmp" && gunzip -c $HWLOC_top_srcdir/utils/test-hwloc-compress-dir.output.tar.gz | tar xf -)
+(cd "$tmp" && mkdir test-hwloc-compress-dir.newoutput)
+
+$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"
+
+rm -rf "$tmp"