Fix bizarre segfault on older perls, not seen on CI ( augments d63c9e64 )
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / 40_script.bash
CommitLineData
b58ecb01 1#!/bin/bash
2
afeb40d2 3# this file is executed in a subshell - set up the common stuff
4source maint/travis-ci_scripts/common.bash
5
6if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi
b58ecb01 7
ad191fcf 8run_harness_tests() {
5ac4a96d 9 local -x HARNESS_OPTIONS=c:j$VCPU_USE
c5915b45 10 if [[ "$VCPU_USE" == 1 ]]; then
11 ulim=$(( ( $(ps xH | wc -l) - 3 ) + 4 )) # (real count excluding header + ps + wc) + space for ( make + tee + harness + <actual test> )
12 echo_err "$(tstamp) Setting process/thread limit to $ulim"
13 ulimit -u $ulim
14 sleep 10 # needed to settle things down a bit
15 fi
ad191fcf 16 make test 2> >(tee "$TEST_STDERR_LOG")
17}
b58ecb01 18
55c6fb91 19# announce everything we have on this box
20TRAVIS="" perl -Ilib t/00describe_environment.t >/dev/null
21
b9970637 22TEST_T0=$SECONDS
b58ecb01 23if [[ "$CLEANTEST" = "true" ]] ; then
24 echo_err "$(tstamp) Running tests with plain \`make test\`"
25 run_or_err "Prepare blib" "make pure_all"
ad191fcf 26 run_harness_tests
b58ecb01 27else
5ac4a96d 28 PROVECMD="prove -lrswj$VCPU_USE xt t"
19d6c0e1 29
30 # FIXME - temporary, until Package::Stash is fixed
31 if perl -M5.010 -e 1 &>/dev/null ; then
32 PROVECMD="$PROVECMD -T"
33 fi
34
b58ecb01 35 echo_err "$(tstamp) running tests with \`$PROVECMD\`"
b9970637 36 $PROVECMD 2> >(tee "$TEST_STDERR_LOG")
b58ecb01 37fi
b9970637 38TEST_T1=$SECONDS
b58ecb01 39
e52712a8 40if [[ -z "$DBIC_TRACE" ]] && [[ -z "$DBIC_MULTICREATE_DEBUG" ]] && [[ -s "$TEST_STDERR_LOG" ]] ; then
b9970637 41 STDERR_LOG_SIZE=$(wc -l < "$TEST_STDERR_LOG")
42
a9fc70ee 43 # prepend STDERR log
44 POSTMORTEM="$(
45 echo
46 echo "Test run produced $STDERR_LOG_SIZE lines of output on STDERR:"
f207111d 47 echo "============================================================="
a9fc70ee 48 cat "$TEST_STDERR_LOG"
f207111d 49 echo "============================================================="
a9fc70ee 50 echo "End of test run STDERR output ($STDERR_LOG_SIZE lines)"
f207111d 51 echo
879ff8cb 52 echo
a9fc70ee 53 )$POSTMORTEM"
b9970637 54fi
55
a9fc70ee 56echo
57echo "${POSTMORTEM:- \o/ No notable smoke run issues \o/ }"
58echo
b9970637 59echo "$(tstamp) Testing took a total of $(( $TEST_T1 - $TEST_T0 ))s"
a9fc70ee 60if [[ -n "$INSTALLDEPS_OUT" ]] ; then
61 echo "$(tstamp) Full dep install log at $(/usr/bin/nopaste -q -s Shadowcat -d DepInstall <<< "$INSTALLDEPS_OUT")"
62fi
63echo