aboutsummaryrefslogtreecommitdiff
path: root/travis-test.sh
diff options
context:
space:
mode:
authorDiego <diegolparra@gmail.com>2016-12-04 15:37:51 -0300
committerDiego <diegolparra@gmail.com>2016-12-04 15:37:51 -0300
commit56039ef037d42cb817d0bc6d5a5891bc87e633c3 (patch)
tree711d36b49d69f7321ea75172d9d4969e318d7afe /travis-test.sh
parente02d137ab960676cb89ff597bc33915f8b83a4d2 (diff)
downloadKamon-56039ef037d42cb817d0bc6d5a5891bc87e633c3.tar.gz
Kamon-56039ef037d42cb817d0bc6d5a5891bc87e633c3.tar.bz2
Kamon-56039ef037d42cb817d0bc6d5a5891bc87e633c3.zip
wip
Diffstat (limited to 'travis-test.sh')
-rwxr-xr-xtravis-test.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/travis-test.sh b/travis-test.sh
new file mode 100755
index 00000000..5ccd9fe0
--- /dev/null
+++ b/travis-test.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+# Licensed under the Apache License, Version 2.0
+# Adapted from https://github.com/paulp/psp-std/blob/master/bin/test
+
+runTests () {
+ sbt -Dakka.test.timefactor=1.5 \
+ 'set concurrentRestrictions in Global += Tags.limit(Tags.Compile, 2)' \
+ 'set testOptions in test in Global := Seq(Tests.Argument(TestFrameworks.ScalaTest, "-oUNCXHELPOQRM"))' \
+ test || exit 1
+
+ echo "[info] $(date) - finished sbt test"
+}
+
+stripTerminalEscapeCodes () {
+ sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGKM]//g"
+}
+
+mkRegex () { ( IFS="|" && echo "$*" ); }
+
+filterOutput() {
+ while read line; do
+ if ! [[ $(echo $line | stripTerminalEscapeCodes) =~ $excludeRegex ]] ; then
+ echo $line
+ fi
+ done
+}
+
+main() {
+ # sbt output filter
+ local excludeRegex=$(mkRegex \
+ '\[info\] (Resolving|Loading|Updating|Packaging|Done updating|downloading| \[SUCCESSFUL \])' \
+ 're[-]run with [-]unchecked for details' \
+ 'one warning found'
+ )
+
+ echo "[info] $(date) - starting sbt test"
+ (set -o pipefail && runTests |& filterOutput)
+}
+
+main $@ \ No newline at end of file