Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # This a simple script to make building/testing Mojo components easier (on | 6 # This a simple script to make building/testing Mojo components easier (on |
| 7 # Linux). | 7 # Linux). |
| 8 | 8 |
| 9 # TODO(vtl): Maybe make the test runner smart and not run unchanged test | 9 # TODO(vtl): Maybe make the test runner smart and not run unchanged test |
| 10 # binaries. | 10 # binaries. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 mojo/tools/test_runner.py mojo/tools/data/unittests "out/$1" \ | 54 mojo/tools/test_runner.py mojo/tools/data/unittests "out/$1" \ |
| 55 mojob_test_successes || exit 1 | 55 mojob_test_successes || exit 1 |
| 56 } | 56 } |
| 57 | 57 |
| 58 do_perftests() { | 58 do_perftests() { |
| 59 echo "Running perf tests in out/$1 ..." | 59 echo "Running perf tests in out/$1 ..." |
| 60 "out/$1/mojo_public_system_perftests" || exit 1 | 60 "out/$1/mojo_public_system_perftests" || exit 1 |
| 61 } | 61 } |
| 62 | 62 |
| 63 do_pytests() { | 63 do_pytests() { |
| 64 echo "Running Python unit tests under mojo/public/tools/bindings/pylib ..." | 64 python mojo/tools/run_mojo_python_tests.py || exit 1 |
| 65 python -m unittest \ | |
| 66 discover -s mojo/public/tools/bindings/pylib -p "*_unittest.py" | |
| 67 } | 65 } |
| 68 | 66 |
| 69 do_gyp() { | 67 do_gyp() { |
| 70 local gyp_defines="$(make_gyp_defines)" | 68 local gyp_defines="$(make_gyp_defines)" |
| 71 echo "Running gyp with GYP_DEFINES=$gyp_defines ..." | 69 echo "Running gyp with GYP_DEFINES=$gyp_defines ..." |
| 72 GYP_DEFINES="$gyp_defines" build/gyp_chromium mojo/mojo.gyp || exit 1 | 70 GYP_DEFINES="$gyp_defines" build/gyp_chromium mojo/mojo.gyp || exit 1 |
| 73 } | 71 } |
| 74 | 72 |
| 75 do_sync() { | 73 do_sync() { |
| 76 # Note: sync only (with hooks, but no gyp-ing). | 74 # Note: sync only (with hooks, but no gyp-ing). |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 107 options+=("component=shared_library") | 105 options+=("component=shared_library") |
| 108 ;; | 106 ;; |
| 109 static) | 107 static) |
| 110 options+=("component=static_library") | 108 options+=("component=static_library") |
| 111 ;; | 109 ;; |
| 112 esac | 110 esac |
| 113 echo ${options[*]} | 111 echo ${options[*]} |
| 114 } | 112 } |
| 115 | 113 |
| 116 # We're in src/mojo/tools. We want to get to src. | 114 # We're in src/mojo/tools. We want to get to src. |
| 117 cd "$(realpath "$(dirname "$0")")/../.." | 115 cd "$(realpath "$(dirname "$0")")/../.." |
|
Dirk Pranke
2014/04/17 23:08:06
Dunno if you guys care, but realpath doesn't work
| |
| 118 | 116 |
| 119 if [ $# -eq 0 ]; then | 117 if [ $# -eq 0 ]; then |
| 120 do_help | 118 do_help |
| 121 exit 0 | 119 exit 0 |
| 122 fi | 120 fi |
| 123 | 121 |
| 124 for arg in "$@"; do | 122 for arg in "$@"; do |
| 125 case "$arg" in | 123 case "$arg" in |
| 126 # Commands ----------------------------------------------------------------- | 124 # Commands ----------------------------------------------------------------- |
| 127 help|--help) | 125 help|--help) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 ;; | 177 ;; |
| 180 --static) | 178 --static) |
| 181 COMPONENT=static | 179 COMPONENT=static |
| 182 ;; | 180 ;; |
| 183 *) | 181 *) |
| 184 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." | 182 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." |
| 185 exit 1 | 183 exit 1 |
| 186 ;; | 184 ;; |
| 187 esac | 185 esac |
| 188 done | 186 done |
| OLD | NEW |