]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - posix/wordexp-tst.sh
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / posix / wordexp-tst.sh
index 5dff727e34efc001940f07bccf357aa1eaa0de03..ce86f87ccb88d758d383f75404db49c0718b4af0 100755 (executable)
@@ -1,6 +1,6 @@
-#! /bin/sh
+#!/bin/sh
 # Test for wordexp(3).
-# Copyright (C) 1998-2013 Free Software Foundation, Inc.
+# Copyright (C) 1998-2019 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,9 @@ set -e
 # The others are just there to be parameters.
 
 common_objpfx=$1; shift
-test_program_prefix=$1; shift
+test_program_prefix_before_env=$1; shift
+run_program_env=$1; shift
+test_program_prefix_after_env=$1; shift
 logfile=${common_objpfx}posix/wordexp-tst.out
 testout=${common_objpfx}posix/wordexp-test-result
 
@@ -38,7 +40,8 @@ IFS="         \
 export IFS
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
 cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
 wordexp returned 0
@@ -50,7 +53,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '${*}' unquoted > ${testout}2
 cat <<"EOF" | cmp - ${testout}2 >> $logfile || failed=1
 wordexp returned 0
@@ -63,7 +67,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '$@' unquoted > ${testout}3
 cat <<"EOF" | cmp - ${testout}3 >> $logfile || failed=1
 wordexp returned 0
@@ -76,7 +81,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '"$* quoted"' param > ${testout}4
 cat <<"EOF" | cmp - ${testout}4 >> $logfile || failed=1
 wordexp returned 0
@@ -88,7 +94,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '"$@ quoted"' param > ${testout}5
 cat <<"EOF" | cmp - ${testout}5 >> $logfile || failed=1
 wordexp returned 0
@@ -102,7 +109,8 @@ fi
 # Why?  Because bash does it that way..
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '$#' 2 3 4 5 > ${testout}6
 cat <<"EOF" | cmp - ${testout}6 >> $logfile || failed=1
 wordexp returned 0
@@ -114,7 +122,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '$2 ${3} $4' 2nd 3rd "4 th" > ${testout}7
 cat <<"EOF" | cmp - ${testout}7 >> $logfile || failed=1
 wordexp returned 0
@@ -129,7 +138,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '${11}' 2 3 4 5 6 7 8 9 10 11 > ${testout}8
 cat <<"EOF" | cmp - ${testout}8 >> $logfile || failed=1
 wordexp returned 0
@@ -141,7 +151,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '"a $@ b"' c d > ${testout}9
 cat <<"EOF" | cmp - ${testout}9 >> $logfile || failed=1
 wordexp returned 0
@@ -154,7 +165,8 @@ if test $failed -ne 0; then
   status=1
 fi
 
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '${#@} ${#2} *$**' two 3 4 > ${testout}10
 cat <<"EOF" | cmp - ${testout}10 || failed=1
 wordexp returned 0