Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 2 | set -e |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 3 | source .jenkins.d/util.sh |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 4 | |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 5 | export CACHE_DIR=${CACHE_DIR:-/tmp} |
| 6 | export WAF_JOBS=${WAF_JOBS:-1} |
| 7 | [[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 8 | |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 9 | nanos() { |
| 10 | # Cannot use date(1) because macOS does not support %N format specifier |
| 11 | python3 -c 'import time; print(int(time.time() * 1e9))' |
| 12 | } |
| 13 | |
| 14 | for file in .jenkins.d/*; do |
Nick G | d69f9a3 | 2016-08-23 11:30:02 -0500 | [diff] [blame] | 15 | [[ -f $file && -x $file ]] || continue |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 16 | |
| 17 | if [[ -n $TRAVIS ]]; then |
| 18 | label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/') |
| 19 | echo -ne "travis_fold:start:${label}\r" |
| 20 | echo -ne "travis_time:start:${label}\r" |
| 21 | start=$(nanos) |
| 22 | fi |
| 23 | |
| 24 | echo "\$ $file" |
Nick G | d69f9a3 | 2016-08-23 11:30:02 -0500 | [diff] [blame] | 25 | "$file" |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 26 | |
| 27 | if [[ -n $TRAVIS ]]; then |
| 28 | finish=$(nanos) |
| 29 | echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r" |
| 30 | echo -ne "travis_fold:end:${label}\r" |
| 31 | fi |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 32 | done |