]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix false failure in recent test adjustment
authorPádraig Brady <P@draigBrady.com>
Sat, 6 Jun 2015 13:17:14 +0000 (14:17 +0100)
committerPádraig Brady <P@draigBrady.com>
Sat, 6 Jun 2015 13:27:54 +0000 (14:27 +0100)
* configure.ac: Comment on why we link rather than run the test,
and remove the moot __ELF__ check since we never ran it anyway,
and the new CFLAGS and LDFLAGS are a more direct test of support.
* tests/misc/wc-parallel.sh: Fix a syntax error in the previous change.
* tests/misc/md5sum-parallel.sh: Use better error checking, consistent
with that used in wc-parallel.sh.

configure.ac
tests/misc/md5sum-parallel.sh
tests/misc/wc-parallel.sh

index a50992d042dacc4407499549aa5269c4b31973d6..fc1a0526bd68b0a627075303ea01b8bd58561d90 100644 (file)
@@ -454,6 +454,7 @@ if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
   gl_ADD_PROG([optional_bin_progs], [df])
 fi
 
+# Build stdbuf only if supported
 ac_save_CFLAGS=$CFLAGS
 ac_save_LDFLAGS=$LDFLAGS
 # Detect warnings about ignored "constructor" attributes.
@@ -464,18 +465,15 @@ AC_MSG_CHECKING([whether this system supports stdbuf])
 CFLAGS="-fPIC $CFLAGS"
 LDFLAGS="-shared $LDFLAGS"
 stdbuf_supported=no
+# Note we only LINK here rather than RUN to support cross compilation
 AC_LINK_IFELSE(
   [AC_LANG_PROGRAM([[
     static int stdbuf = 0;
 
-    /* Restrict to ELF systems with compilers
-       that support the constructor attribute.  */
     void __attribute__ ((constructor))
     stdbuf_init (void)
     {
-      #if __ELF__
-        stdbuf = 1;
-      #endif
+      stdbuf = 1;
     }]],[[
     return !(stdbuf == 1);]])
   ],
index 86f5af76f1928658d6f177609c2cdfb90a5b392a..2a526bdf2f9d3c2053cfd73d3ab49485fd56b624 100755 (executable)
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ md5sum
 
+xargs -P2 </dev/null >/dev/null 2>&1 \
+  || skip_ 'xargs -P is required'
+
 (mkdir tmp && cd tmp && seq 500 | xargs touch)
 
 # This will output at least 16KiB per process
 # and start 3 processes, with 2 running concurrently,
 # which triggers often on Fedora 11 at least.
-(find tmp tmp tmp -type f | xargs -n500 -P2 md5sum) |
+(find tmp tmp tmp -type f | xargs -n500 -P2 md5sum 2>err) |
 sed -n '/[0-9a-f]\{32\}  /!p' |
 grep . > /dev/null && fail=1
+compare /dev/null err || fail=1
 
 Exit $fail
index 98c36b9faa354fd20349b195e91765c400f5960a..19497e0476e61625bb57567839729f8b6b3772a2 100755 (executable)
@@ -20,9 +20,8 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ wc
 
-if xargs -P2 </dev/null >/dev/null 2>&1
-  skip_ 'xargs -P is required'
-fi
+xargs -P2 </dev/null >/dev/null 2>&1 \
+  || skip_ 'xargs -P is required'
 
 (mkdir tmp && cd tmp && seq 2000 | xargs touch)