summaryrefslogtreecommitdiff
path: root/.ci/travis.sh
diff options
context:
space:
mode:
Diffstat (limited to '.ci/travis.sh')
-rwxr-xr-x.ci/travis.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/.ci/travis.sh b/.ci/travis.sh
new file mode 100755
index 0000000000..6ae67e2e82
--- /dev/null
+++ b/.ci/travis.sh
@@ -0,0 +1,24 @@
1#!/bin/sh
2
3# https://github.com/travis-ci/travis-rubies/blob/9f7962a881c55d32da7c76baefc58b89e3941d91/build.sh#L38-L44
4
5travis_fold() {
6 echo -e "travis_fold:start:$1\033[33;1m$2\033[0m"
7}
8travis_endfold() {
9 echo -e "\ntravis_fold:end:$1\r"
10}
11
12travis_time_start() {
13 travis_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
14 travis_start_time=$(travis_nanoseconds)
15 echo -en "travis_time:start:$travis_timer_id\r${ANSI_CLEAR}"
16}
17
18travis_time_finish() {
19 local result=$?
20 travis_end_time=$(travis_nanoseconds)
21 local duration=$(($travis_end_time-$travis_start_time))
22 echo -en "\ntravis_time:end:$travis_timer_id:start=$travis_start_time,finish=$travis_end_time,duration=$duration\r${ANSI_CLEAR}"
23 return $result
24}