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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 echo "Running unit tests in out/$1 ..." | 61 echo "Running unit tests in out/$1 ..." |
62 mojo/tools/test_runner.py mojo/tools/data/unittests "out/$1" \ | 62 mojo/tools/test_runner.py mojo/tools/data/unittests "out/$1" \ |
63 mojob_test_successes || exit 1 | 63 mojob_test_successes || exit 1 |
64 } | 64 } |
65 | 65 |
66 do_perftests() { | 66 do_perftests() { |
67 echo "Running perf tests in out/$1 ..." | 67 echo "Running perf tests in out/$1 ..." |
68 "out/$1/mojo_public_system_perftests" || exit 1 | 68 "out/$1/mojo_public_system_perftests" || exit 1 |
69 } | 69 } |
70 | 70 |
71 do_pytests() { | |
72 echo "Running python tests in out/$1 ..." | |
73 python mojo/tools/run_mojo_python_tests.py || exit 1 | |
74 python mojo/tools/run_mojo_python_bindings_tests.py "--build-dir=out/$1" || \ | |
75 exit 1 | |
76 } | |
77 | |
78 do_gn() { | 71 do_gn() { |
79 local gn_args="$(make_gn_args $1)" | 72 local gn_args="$(make_gn_args $1)" |
80 echo "Running gn with --args=\"${gn_args}\" ..." | 73 echo "Running gn with --args=\"${gn_args}\" ..." |
81 gn gen --args="${gn_args}" "out/$1" | 74 gn gen --args="${gn_args}" "out/$1" |
82 } | 75 } |
83 | 76 |
84 do_sync() { | 77 do_sync() { |
85 # Note: sync only (with hooks, but no gyp-ing). | 78 # Note: sync only (with hooks, but no gyp-ing). |
86 GYP_CHROMIUM_NO_ACTION=1 gclient sync || exit 1 | 79 GYP_CHROMIUM_NO_ACTION=1 gclient sync || exit 1 |
87 } | 80 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 should_do_Release && do_build Release | 150 should_do_Release && do_build Release |
158 ;; | 151 ;; |
159 test) | 152 test) |
160 should_do_Debug && do_unittests Debug | 153 should_do_Debug && do_unittests Debug |
161 should_do_Release && do_unittests Release | 154 should_do_Release && do_unittests Release |
162 ;; | 155 ;; |
163 perftest) | 156 perftest) |
164 should_do_Debug && do_perftests Debug | 157 should_do_Debug && do_perftests Debug |
165 should_do_Release && do_perftests Release | 158 should_do_Release && do_perftests Release |
166 ;; | 159 ;; |
167 pytest) | |
168 should_do_Debug && do_pytests Debug | |
169 should_do_Release && do_pytests Release | |
170 ;; | |
171 gn) | 160 gn) |
172 should_do_Debug && do_gn Debug | 161 should_do_Debug && do_gn Debug |
173 should_do_Release && do_gn Release | 162 should_do_Release && do_gn Release |
174 ;; | 163 ;; |
175 sync) | 164 sync) |
176 do_sync | 165 do_sync |
177 ;; | 166 ;; |
178 show-bash-alias) | 167 show-bash-alias) |
179 # You want to type something like: | 168 # You want to type something like: |
180 # alias mojob=\ | 169 # alias mojob=\ |
(...skipping 26 matching lines...) Expand all Loading... |
207 GOMA=disabled | 196 GOMA=disabled |
208 ;; | 197 ;; |
209 *) | 198 *) |
210 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." | 199 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." |
211 exit 1 | 200 exit 1 |
212 ;; | 201 ;; |
213 esac | 202 esac |
214 done | 203 done |
215 | 204 |
216 exit 0 | 205 exit 0 |
OLD | NEW |