Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: mojo/tools/mojob.sh

Issue 639713002: mojo: Add python bindings tests to mojob.sh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 27 matching lines...) Expand all
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 python mojo/tools/run_mojo_python_tests.py || exit 1 69 python mojo/tools/run_mojo_python_tests.py || exit 1
70 if [ "$COMPONENT" = "static" ]; then
viettrungluu 2014/10/08 16:06:32 This is rather dubious, since the component flags
qsr 2014/10/08 16:16:07 Unfortunately, I do not have a good solution for t
71 python mojo/tools/run_mojo_python_bindings_tests.py \
72 "--build-dir=out/$1" || exit 1
viettrungluu 2014/10/08 16:06:33 And if it runs things out of a particular build di
qsr 2014/10/08 16:16:08 Done.
73 fi
70 } 74 }
71 75
72 do_gyp() { 76 do_gyp() {
73 local gyp_defines="$(make_gyp_defines)" 77 local gyp_defines="$(make_gyp_defines)"
74 echo "Running gyp for mojo with GYP_DEFINES=$gyp_defines ..." 78 echo "Running gyp for mojo with GYP_DEFINES=$gyp_defines ..."
75 GYP_DEFINES="$gyp_defines" build/gyp_chromium mojo/mojo.gyp || exit 1 79 GYP_DEFINES="$gyp_defines" build/gyp_chromium mojo/mojo.gyp || exit 1
76 } 80 }
77 81
78 do_gypall() { 82 do_gypall() {
79 local gyp_defines="$(make_gyp_defines)" 83 local gyp_defines="$(make_gyp_defines)"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 ;; 177 ;;
174 test) 178 test)
175 should_do_Debug && do_unittests Debug 179 should_do_Debug && do_unittests Debug
176 should_do_Release && do_unittests Release 180 should_do_Release && do_unittests Release
177 ;; 181 ;;
178 perftest) 182 perftest)
179 should_do_Debug && do_perftests Debug 183 should_do_Debug && do_perftests Debug
180 should_do_Release && do_perftests Release 184 should_do_Release && do_perftests Release
181 ;; 185 ;;
182 pytest) 186 pytest)
183 do_pytests 187 should_do_Debug && do_pytests Debug
188 should_do_Release && do_pytests Release
184 ;; 189 ;;
185 gyp) 190 gyp)
186 set_goma_dir_if_necessary 191 set_goma_dir_if_necessary
187 do_gyp 192 do_gyp
188 ;; 193 ;;
189 gypall) 194 gypall)
190 set_goma_dir_if_necessary 195 set_goma_dir_if_necessary
191 do_gypall 196 do_gypall
192 ;; 197 ;;
193 sync) 198 sync)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 ;; 234 ;;
230 --no-use-goma) 235 --no-use-goma)
231 GOMA=disabled 236 GOMA=disabled
232 ;; 237 ;;
233 *) 238 *)
234 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." 239 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"."
235 exit 1 240 exit 1
236 ;; 241 ;;
237 esac 242 esac
238 done 243 done
244
245 exit 0
viettrungluu 2014/10/08 16:06:32 Is there a reason for adding this?
qsr 2014/10/08 16:16:08 The script exit with 1 when called for debug. My
viettrungluu 2014/10/09 22:49:52 Sorry, what was the case (e.g., command-line) when
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698