| 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. |
| 11 # TODO(vtl) Maybe also provide a way to pass command-line arguments to the test | 11 # TODO(vtl) Maybe also provide a way to pass command-line arguments to the test |
| 12 # binaries. | 12 # binaries. |
| 13 | 13 |
| 14 do_help() { | 14 do_help() { |
| 15 cat << EOF | 15 cat << EOF |
| 16 Usage: $(basename "$0") [command|option ...] | 16 Usage: $(basename "$0") [command|option ...] |
| 17 | 17 |
| 18 command should be one of: | 18 command should be one of: |
| 19 build - Build. | 19 build - Build. |
| 20 test - Run unit tests (does not build). | 20 test - Run unit tests (does not build). |
| 21 perftest - Run perf tests (does not build). | 21 perftest - Run perf tests (does not build). |
| 22 pytest - Run Python unit tests. | 22 pytest - Run Python unit tests (does not build). |
| 23 gyp - Run gyp for mojo (does not sync). | 23 gyp - Run gyp for mojo (does not sync). |
| 24 gypall - Run gyp for all of chromium (does not sync). | 24 gypall - Run gyp for all of chromium (does not sync). |
| 25 sync - Sync using gclient (does not run gyp). | 25 sync - Sync using gclient (does not run gyp). |
| 26 show-bash-alias - Outputs an appropriate bash alias for mojob. In bash do: | 26 show-bash-alias - Outputs an appropriate bash alias for mojob. In bash do: |
| 27 \$ eval \`mojo/tools/mojob.sh show-bash-alias\` | 27 \$ eval \`mojo/tools/mojob.sh show-bash-alias\` |
| 28 | 28 |
| 29 option (which will only apply to following commands) should be one of: | 29 option (which will only apply to following commands) should be one of: |
| 30 Build/test options (specified before build/test/perftest): | 30 Build/test options (specified before build/test/perftest): |
| 31 --debug - Build/test in Debug mode. | 31 --debug - Build/test in Debug mode. |
| 32 --release - Build/test in Release mode. | 32 --release - Build/test in Release mode. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 59 mojo/tools/test_runner.py mojo/tools/data/unittests "out/$1" \ | 59 mojo/tools/test_runner.py mojo/tools/data/unittests "out/$1" \ |
| 60 mojob_test_successes || exit 1 | 60 mojob_test_successes || exit 1 |
| 61 } | 61 } |
| 62 | 62 |
| 63 do_perftests() { | 63 do_perftests() { |
| 64 echo "Running perf tests in out/$1 ..." | 64 echo "Running perf tests in out/$1 ..." |
| 65 "out/$1/mojo_public_system_perftests" || exit 1 | 65 "out/$1/mojo_public_system_perftests" || exit 1 |
| 66 } | 66 } |
| 67 | 67 |
| 68 do_pytests() { | 68 do_pytests() { |
| 69 echo "Running python tests in out/$1 ..." |
| 69 python mojo/tools/run_mojo_python_tests.py || exit 1 | 70 python mojo/tools/run_mojo_python_tests.py || exit 1 |
| 71 # TODO(qsr) Remove this test when the component build is not supported |
| 72 # anymore. |
| 73 if [ -f "out/$1/python/mojo/system.so" ]; then |
| 74 python mojo/tools/run_mojo_python_bindings_tests.py \ |
| 75 "--build-dir=out/$1" || exit 1 |
| 76 fi |
| 70 } | 77 } |
| 71 | 78 |
| 72 do_gyp() { | 79 do_gyp() { |
| 73 local gyp_defines="$(make_gyp_defines)" | 80 local gyp_defines="$(make_gyp_defines)" |
| 74 echo "Running gyp for mojo with GYP_DEFINES=$gyp_defines ..." | 81 echo "Running gyp for mojo with GYP_DEFINES=$gyp_defines ..." |
| 75 GYP_DEFINES="$gyp_defines" build/gyp_chromium mojo/mojo.gyp || exit 1 | 82 GYP_DEFINES="$gyp_defines" build/gyp_chromium mojo/mojo.gyp || exit 1 |
| 76 } | 83 } |
| 77 | 84 |
| 78 do_gypall() { | 85 do_gypall() { |
| 79 local gyp_defines="$(make_gyp_defines)" | 86 local gyp_defines="$(make_gyp_defines)" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 ;; | 180 ;; |
| 174 test) | 181 test) |
| 175 should_do_Debug && do_unittests Debug | 182 should_do_Debug && do_unittests Debug |
| 176 should_do_Release && do_unittests Release | 183 should_do_Release && do_unittests Release |
| 177 ;; | 184 ;; |
| 178 perftest) | 185 perftest) |
| 179 should_do_Debug && do_perftests Debug | 186 should_do_Debug && do_perftests Debug |
| 180 should_do_Release && do_perftests Release | 187 should_do_Release && do_perftests Release |
| 181 ;; | 188 ;; |
| 182 pytest) | 189 pytest) |
| 183 do_pytests | 190 should_do_Debug && do_pytests Debug |
| 191 should_do_Release && do_pytests Release |
| 184 ;; | 192 ;; |
| 185 gyp) | 193 gyp) |
| 186 set_goma_dir_if_necessary | 194 set_goma_dir_if_necessary |
| 187 do_gyp | 195 do_gyp |
| 188 ;; | 196 ;; |
| 189 gypall) | 197 gypall) |
| 190 set_goma_dir_if_necessary | 198 set_goma_dir_if_necessary |
| 191 do_gypall | 199 do_gypall |
| 192 ;; | 200 ;; |
| 193 sync) | 201 sync) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 ;; | 237 ;; |
| 230 --no-use-goma) | 238 --no-use-goma) |
| 231 GOMA=disabled | 239 GOMA=disabled |
| 232 ;; | 240 ;; |
| 233 *) | 241 *) |
| 234 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." | 242 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." |
| 235 exit 1 | 243 exit 1 |
| 236 ;; | 244 ;; |
| 237 esac | 245 esac |
| 238 done | 246 done |
| 247 |
| 248 exit 0 |
| OLD | NEW |