diff --git a/.travis.yml b/.travis.yml index 27600aff..b21c7ee3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,7 @@ env: global: - secure: uytPp0Fs+LT3QDEhDM3LJWiLvT2AHbdWnXrPEs+bYshQwt9wST+KQnYLyRfBuGg2ux3pkZwsRUFexvN8pQ3ab4aU2P21Xo98TzdXRwXurNYePgk/3tykEH+JrL52DfjCWB1VsjzzFrP02XU0XtB30qWC/n+fxeMWT7JT2GVh/OE= language: rust -script: - - mkdir build - - cd build - - ../configure - - make check docs for_c +script: scripts/travis-build.sh after_script: - cd /home/travis/build/servo/html5ever/target - curl http://www.rust-ci.org/artifacts/put?t=$RUSTCI_TOKEN | sh diff --git a/scripts/shrink-test-output.py b/scripts/shrink-test-output.py new file mode 100755 index 00000000..74be7b3b --- /dev/null +++ b/scripts/shrink-test-output.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# Copyright 2015 The html5ever Project Developers. See the +# COPYRIGHT file at the top-level directory of this distribution. +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +import re +import sys + + +REPLACEMENTS = { + 'ok': '.', + 'FAILED': 'F', + 'ignored': 'I', +} +TEST_RESULT_RE = re.compile( + r'^test .* \.\.\. ({0})$'.format('|'.join(REPLACEMENTS.keys()))) + + +def main(): + while True: + line = sys.stdin.readline() + if len(line) is 0: + break + match = TEST_RESULT_RE.match(line) + if match: + sys.stdout.write(REPLACEMENTS[match.group(1)]) + else: + sys.stdout.write(line) + sys.stdout.flush() + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh new file mode 100755 index 00000000..8a0148c1 --- /dev/null +++ b/scripts/travis-build.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2015 The html5ever Project Developers. See the +# COPYRIGHT file at the top-level directory of this distribution. +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +set -ex + +mkdir build +cd build +../configure +make check docs for_c | ../scripts/shrink-test-output.py +exit ${PIPESTATUS[0]}