summaryrefslogtreecommitdiffstats
path: root/tests/load-functions
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-16 12:40:10 +0100
committerMattias Andrée <maandree@kth.se>2023-12-16 12:40:10 +0100
commit683f205402a99cfc8cea46c83ce9b46a42616d42 (patch)
treef6ee1619454a6ec8b9e31770bbbc2abf36aae2fd /tests/load-functions
parentImprove portability (diff)
downloadlibsyscalls-683f205402a99cfc8cea46c83ce9b46a42616d42.tar.gz
libsyscalls-683f205402a99cfc8cea46c83ce9b46a42616d42.tar.bz2
libsyscalls-683f205402a99cfc8cea46c83ce9b46a42616d42.tar.xz
All kinds of stuff
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'tests/load-functions')
-rw-r--r--tests/load-functions24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/load-functions b/tests/load-functions
index 2e9ddda..3436158 100644
--- a/tests/load-functions
+++ b/tests/load-functions
@@ -1,6 +1,30 @@
# -*- sh -*-
# See LICENSE file for copyright and license details.
+parallelindex=0
+p () {
+ (
+ set +ev
+ pid=$$-$parallelindex
+ a=.a-$pid.tmp
+ b=.b-$pid.tmp
+ log=.x-$pid.tmp
+ ( set -ev ; $t "$@" ) > $log 2>&1
+ r=$?
+ test $r = 0 || cat -- $log >&2
+ rm -f -- .?-$pid.tmp
+ exit $r
+ ) &
+ eval parallelpid$(( ++parallelindex ))=$!
+}
+await () {
+ while (( parallelindex )); do
+ parallelvar=parallelpid$(( parallelindex-- ))
+ eval wait '$'$parallelvar
+ done
+}
+
+
stderr () {
("$@") 2>&1 >/dev/null
}