aboutsummaryrefslogtreecommitdiff
path: root/ci/compile-tests/bin
diff options
context:
space:
mode:
Diffstat (limited to 'ci/compile-tests/bin')
-rwxr-xr-xci/compile-tests/bin/compile-test-start-delayed61
-rwxr-xr-xci/compile-tests/bin/coqc-delayed3
-rwxr-xr-xci/compile-tests/bin/coqdep-delayed3
3 files changed, 67 insertions, 0 deletions
diff --git a/ci/compile-tests/bin/compile-test-start-delayed b/ci/compile-tests/bin/compile-test-start-delayed
new file mode 100755
index 00000000..f528f4d1
--- /dev/null
+++ b/ci/compile-tests/bin/compile-test-start-delayed
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# This file is part of Proof General.
+#
+# © Copyright 2021 Hendrik Tews
+#
+# Authors: Hendrik Tews
+# Maintainer: Hendrik Tews <hendrik@askra.de>
+#
+# License: GPL (GNU GENERAL PUBLIC LICENSE)
+#
+# See function usage for documentation.
+
+set -e
+#set -x
+
+function usage(){
+ cat <<-EOF
+ usage: compile-test-start-delayed key prog args...
+
+ Start program prog with arguments args with some delay. There
+ must be at least one argument in args and the last one must be
+ a file. The delay is taken from a line in that file that
+ contains the key, followed by a space and the delay in seconds
+ (maybe somewhere in the middle of the line). The file must
+ contain at most one line containing key. When there is no line
+ containing key the delay is zero.
+EOF
+}
+
+if [ $# -lt 3 ] ; then
+ usage
+ exit 1
+fi
+
+# echo compile-test-start-delayed "$@"
+
+key="$1"
+file="${@: -1}"
+shift
+
+delay=$(sed -ne "/$key/ s/.*$key \([0-9]*\).*/\1/p" $file)
+
+if [ -z "$delay" ] ; then
+ # echo compile-test-start-delayed: key $key not found in $file >&9
+ delay=0
+fi
+
+if [ $delay -ne 0 ] ; then
+ date "+compile-test-start-delayed +%Y-%m-%d %T %Z" >&9
+ echo delay $delay for $@ >&9
+fi
+
+sleep $delay
+date "+compile-test-start-delayed +%Y-%m-%d %T %Z" >&9
+echo start $@ >&9
+
+#set -x
+#echo "$@"
+set +e
+exec "$@"
diff --git a/ci/compile-tests/bin/coqc-delayed b/ci/compile-tests/bin/coqc-delayed
new file mode 100755
index 00000000..26c92805
--- /dev/null
+++ b/ci/compile-tests/bin/coqc-delayed
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+exec compile-test-start-delayed coqc-delay coqc "$*"
diff --git a/ci/compile-tests/bin/coqdep-delayed b/ci/compile-tests/bin/coqdep-delayed
new file mode 100755
index 00000000..f123770a
--- /dev/null
+++ b/ci/compile-tests/bin/coqdep-delayed
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+exec compile-test-start-delayed coqdep-delay coqdep "$*"