Remove anything preinstalled on the travis perls when CLEANTEST is true
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / 40_script.bash
CommitLineData
b58ecb01 1#!/bin/bash
2
3source maint/travis-ci_scripts/common.bash
4if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi
5
ad191fcf 6run_harness_tests() {
7 local -x HARNESS_TIMER=1
8 local -x HARNESS_OPTIONS=c:j$NUMTHREADS
9 make test 2> >(tee "$TEST_STDERR_LOG")
10}
b58ecb01 11
b9970637 12TEST_T0=$SECONDS
b58ecb01 13if [[ "$CLEANTEST" = "true" ]] ; then
14 echo_err "$(tstamp) Running tests with plain \`make test\`"
15 run_or_err "Prepare blib" "make pure_all"
ad191fcf 16 run_harness_tests
b58ecb01 17else
ad191fcf 18 PROVECMD="prove --timer -lrswj$NUMTHREADS t xt"
19d6c0e1 19
20 # FIXME - temporary, until Package::Stash is fixed
21 if perl -M5.010 -e 1 &>/dev/null ; then
22 PROVECMD="$PROVECMD -T"
23 fi
24
b58ecb01 25 echo_err "$(tstamp) running tests with \`$PROVECMD\`"
b9970637 26 $PROVECMD 2> >(tee "$TEST_STDERR_LOG")
b58ecb01 27fi
b9970637 28TEST_T1=$SECONDS
b58ecb01 29
b9970637 30if [[ -z "$DBICTRACE" ]] && [[ -z "$POISON_ENV" ]] && [[ -s "$TEST_STDERR_LOG" ]] ; then
31 STDERR_LOG_SIZE=$(wc -l < "$TEST_STDERR_LOG")
32
a9fc70ee 33 # prepend STDERR log
34 POSTMORTEM="$(
35 echo
36 echo "Test run produced $STDERR_LOG_SIZE lines of output on STDERR:"
f207111d 37 echo "============================================================="
a9fc70ee 38 cat "$TEST_STDERR_LOG"
f207111d 39 echo "============================================================="
a9fc70ee 40 echo "End of test run STDERR output ($STDERR_LOG_SIZE lines)"
f207111d 41 echo
a9fc70ee 42 )$POSTMORTEM"
b9970637 43fi
44
a9fc70ee 45echo
46echo "${POSTMORTEM:- \o/ No notable smoke run issues \o/ }"
47echo
b9970637 48echo "$(tstamp) Testing took a total of $(( $TEST_T1 - $TEST_T0 ))s"
a9fc70ee 49if [[ -n "$INSTALLDEPS_OUT" ]] ; then
50 echo "$(tstamp) Full dep install log at $(/usr/bin/nopaste -q -s Shadowcat -d DepInstall <<< "$INSTALLDEPS_OUT")"
51fi
52echo