File: upstream-tests-omalloc-getlucky.patch

package info (click to toggle)
singular 1:4.1.1-p2+ds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 35,860 kB
  • sloc: cpp: 288,280; ansic: 17,387; lisp: 4,242; yacc: 1,654; python: 1,608; makefile: 1,424; lex: 1,387; perl: 632; sh: 567; xml: 182
file content (61 lines) | stat: -rw-r--r-- 1,767 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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: 2015-11-14

--- a/omalloc/Makefile.am
+++ b/omalloc/Makefile.am
@@ -55,9 +55,11 @@
 ####################################################
 ## Test program
 
-TESTS = omtTest-m omtTest-r
+TESTS = getlucky-omtTest-m getlucky-omtTest-r
 
-check_PROGRAMS = $(TESTS)
+check_PROGRAMS = omtTest-m omtTest-r
+
+check_SCRIPTS = $(TESTS)
 
 # EXTRA_PROGRAMS = omtTest-r
 
@@ -73,3 +75,12 @@
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = omalloc.pc
 
+getlucky-omtTest-m: getlucky-omtTest-X.sh
+	$(LN_S) $< $@
+
+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