Description: tests: omalloc: multi-running script
 Quoting the upstream maintainer: ``omalloc testing/verification may oversee
 some memory error in some random cases''. This patch introduceds a simple
 wrapper that is meant to work around those unlucky cases by running a few
 number of tests instead of just one test; meant to be submitted to the
 upstream maintainer.
Origin: vendor, Debian
Forwarded: https://github.com/Singular/Sources/pull/733
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2021-11-20

--- a/omalloc/Makefile.am
+++ b/omalloc/Makefile.am
@@ -68,9 +68,11 @@
 ####################################################
 ## Test program
 
-TESTS = omtTest-r
+TESTS = getlucky-omtTest-r
 
-check_PROGRAMS = $(TESTS)
+check_PROGRAMS = omtTest-r
+
+check_SCRIPTS = $(TESTS)
 
 # EXTRA_PROGRAMS = omtTest-r
 
@@ -82,3 +84,9 @@
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = omalloc.pc
 
+getlucky-omtTest-r: getlucky-omtTest-X.sh
+	$(LN_S) $< $@
+
+CLEANFILES += $(TESTS)
+
+EXTRA_DIST = getlucky-omtTest-X.sh
--- /dev/null
+++ b/omalloc/getlucky-omtTest-X.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+##
+## comment:
+##  omalloc testing/verification may oversee some memory error in some random cases:
+##  this simple wrapper is meant to work around those unlucky cases by running a few
+##  number of tests instead of just one test.
+##
+SCRIPTNAME=${0##*/}
+SCRIPTDIR=${0%/*}
+CHECK_PROGRAM=${SCRIPTNAME#getlucky-}
+NUMBEROF_TRIAL=11
+for idx in $(seq 1 $NUMBEROF_TRIAL); do
+	${SCRIPTDIR}/$CHECK_PROGRAM && { echo "$SCRIPTNAME: SUMMARY: $idx trial(s)" ; exit 0 ; }
+	sleep 3
+done
+echo "$SCRIPTNAME: SUMMARY: $idx failed trials"
+exit 1
+# eos
