diff options
author | 2014-01-24 18:28:35 +0000 | |
---|---|---|
committer | 2014-01-24 18:28:35 +0000 | |
commit | dd10e0ec4c9aeeadcd922d3ad0bf01496d920978 (patch) | |
tree | 83ddcb4e649ce11e1ee869d3817721b792c25cd5 | |
parent | 68c74884d0da1aa794bb660a37f31f2f9108bc36 (diff) |
make GM self-test run gm/rebaseline_server unittests
R=borenet@google.com
Author: epoger@google.com
Review URL: https://codereview.chromium.org/143983017
git-svn-id: http://skia.googlecode.com/svn/trunk@13170 2bbb7eff-a529-9590-31e7-b0007b416f81
-rwxr-xr-x | gm/rebaseline_server/test_all.py | 6 | ||||
-rwxr-xr-x | gm/tests/run.sh | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/gm/rebaseline_server/test_all.py b/gm/rebaseline_server/test_all.py index ba3d8fdbe0..299d1340f2 100755 --- a/gm/rebaseline_server/test_all.py +++ b/gm/rebaseline_server/test_all.py @@ -19,8 +19,10 @@ import unittest def main(): suite = unittest.TestLoader().discover(os.path.dirname(__file__), pattern='*_test.py') - unittest.TextTestRunner(verbosity=2).run(suite) - + results = unittest.TextTestRunner(verbosity=2).run(suite) + print repr(results) + if not results.wasSuccessful(): + raise Exception('failed one or more unittests') if __name__ == '__main__': main() diff --git a/gm/tests/run.sh b/gm/tests/run.sh index 7e1f03dcb1..29074e5f1d 100755 --- a/gm/tests/run.sh +++ b/gm/tests/run.sh @@ -47,10 +47,11 @@ function compare_directories { # Run a command, and validate that it succeeds (returns 0). function assert_passes { COMMAND="$1" - OUTPUT=$($COMMAND 2>&1) + echo + echo "assert_passes $COMMAND ..." + $COMMAND if [ $? != 0 ]; then echo "This command was supposed to pass, but failed: [$COMMAND]" - echo $OUTPUT ENCOUNTERED_ANY_ERRORS=1 fi } @@ -58,10 +59,11 @@ function assert_passes { # Run a command, and validate that it fails (returns nonzero). function assert_fails { COMMAND="$1" - OUTPUT=$($COMMAND 2>&1) + echo + echo "assert_fails $COMMAND ..." + $COMMAND if [ $? == 0 ]; then echo "This command was supposed to fail, but passed: [$COMMAND]" - echo $OUTPUT ENCOUNTERED_ANY_ERRORS=1 fi } @@ -274,6 +276,9 @@ for CASE in $FAILING_CASES; do assert_fails "python gm/display_json_results.py $GM_OUTPUTS/$CASE/$OUTPUT_EXPECTED_SUBDIR/json-summary.txt" done +# Exercise all rebaseline_server unittests. +assert_passes "python gm/rebaseline_server/test_all.py" + if [ $ENCOUNTERED_ANY_ERRORS == 0 ]; then echo "All tests passed." exit 0 |