Codebase list mozc / a18c39e
Deprecate --mozc_root_dir option in run_android_test.py That option has never been used. This is just an internal clean-up. No behavior change in production is intended. BUG=none TEST=compile git-svn-id: https://mozc.googlecode.com/svn/trunk@436 a6090854-d499-a067-5803-1114d4e51264 Tsuyoshi Matsuzaki authored 9 years ago Yohei Yukawa committed 9 years ago
2 changed file(s) with 17 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
3737
3838 __author__ = "hidehiko"
3939
40 from build_tools.test_tools import gtest_report
41 from build_tools import android_util
4240 import errno
4341 import logging
4442 import multiprocessing
4543 import optparse
4644 import os
4745 import subprocess
48 import sys
4946 import time
5047 from xml.etree import cElementTree as ElementTree
48 from build_tools import android_util
49 from build_tools.test_tools import gtest_report
5150
5251
5352 def FindTestBinaries(test_dir):
6867 def ParseArgs():
6968 """Parses command line options and returns them."""
7069 parser = optparse.OptionParser()
71 # Assume the parent directory is the Mozc root directory.
72 program_dir = os.path.dirname(sys.argv[0])
73 parent_dir = os.path.join(*os.path.split(program_dir)[:-1]) or '..'
7470 parser.add_option('--run_java_test', dest='run_java_test', default=False,
7571 action='store_true',
7672 help='Runs JUnit tests. [JAVA] options are used.')
9187 default='org.mozc.android.inputmethod.japanese',
9288 help='[JAVA] Testee project\'s package name. '
9389 'This is used to find test reporting XML file.')
94 parser.add_option('--mozc_root_dir', dest='mozc_root_dir', default=parent_dir,
95 help='[NATIVE] The root directory of Mozc project')
9690 parser.add_option('--remote_dir', dest='remote_dir',
9791 default='/sdcard/mozctest',
9892 help='[NATIVE] Working directory on '
111105 help='[JAVA][NATIVE] ABI of built test executables.')
112106 parser.add_option('--mozc_dictionary_data_file',
113107 dest='mozc_dictionary_data_file', default=None,
114 help='[NATIVE] The relative path from mozc_root_dir to '
115 'the system.dictionary file.')
108 help='[NATIVE] Path to system.dictionary file.')
116109 parser.add_option('--mozc_connection_data_file',
117110 dest='mozc_connection_data_file', default=None,
118 help='[NATIVE] The relative path from mozc_root_dir to '
119 'the connection.data file.')
111 help='[NATIVE] Path to connection.data file.')
120112 parser.add_option('--mozc_connection_text_data_file',
121113 dest='mozc_connection_text_data_file', default=None,
122 help='[NATIVE] The relative path from mozc_root_dir to '
123 'the connection_single_column.txt file.')
114 help='[NATIVE] Path to connection_single_column.txt file.')
124115 parser.add_option('--mozc_test_connection_data_file',
125116 dest='mozc_test_connection_data_file', default=None,
126 help='[NATIVE] The relative path from mozc_root_dir to '
127 'the test_connection.data file.')
117 help='[NATIVE] Path to test_connection.data file.')
128118 parser.add_option('--mozc_test_connection_text_data_file',
129119 dest='mozc_test_connection_text_data_file', default=None,
130 help='[NATIVE] The relative path from mozc_root_dir to '
131 'the connection_single_column.txt file.')
120 help='[NATIVE] Path to connection_single_column.txt file.')
132121 parser.add_option('--mozc_data_dir',
133122 dest='mozc_data_dir', default=None,
134 help='[NATIVE] The relative path from mozc_root_dir to '
135 'the data directory.')
123 help='[NATIVE] Path to data directory.')
136124 parser.add_option('--output_report_dir', dest='output_report_dir',
137125 default=None,
138126 help='[JAVA][NATIVE] Path to output gtest '
287275 if remote_report_path:
288276 self._RunCommand('rm', remote_report_path)
289277
290 def SetUpTest(self, device, mount_point, host_dir, remote_dir,
278 def SetUpTest(self, device, mount_point, remote_dir,
291279 dictionary_data, connection_data, connection_text_data,
292280 test_connection_data, test_connection_text_data,
293281 mozc_data_dir):
303291 # data is set at jni loading time, but it is necessary to somehow
304292 # set the data in native tests. So, copy the dictionary data to the
305293 # emulator.
306 self.CopyFile(host_path=os.path.join(host_dir, dictionary_data),
294 self.CopyFile(host_path=dictionary_data,
307295 remote_path=os.path.join(remote_dir,
308296 'embedded_data', 'dictionary_data'),
309297 operation='push')
310 self.CopyFile(host_path=os.path.join(host_dir, connection_data),
298 self.CopyFile(host_path=connection_data,
311299 remote_path=os.path.join(remote_dir,
312300 'embedded_data', 'connection_data'),
313301 operation='push')
314 self.CopyFile(host_path=os.path.join(host_dir, connection_text_data),
302 self.CopyFile(host_path=connection_text_data,
315303 remote_path=os.path.join(remote_dir,
316304 'data_manager', 'android',
317305 'connection_single_column.txt'),
318306 operation='push')
319 self.CopyFile(host_path=os.path.join(host_dir, test_connection_data),
307 self.CopyFile(host_path=test_connection_data,
320308 remote_path=os.path.join(remote_dir,
321309 'data_manager', 'testing',
322310 'connection_data.data'),
323311 operation='push')
324 self.CopyFile(host_path=os.path.join(host_dir, test_connection_text_data),
312 self.CopyFile(host_path=test_connection_text_data,
325313 remote_path=os.path.join(remote_dir,
326314 'data_manager', 'testing',
327315 'connection_single_column.txt'),
330318 # We want only test data and they are in mozc_data_dir/data.
331319 # TODO(matsuzakit): Split generated .h files and test data
332320 # into separate directories.
333 self.CopyFile(host_path=os.path.join(host_dir, mozc_data_dir, 'data'),
321 self.CopyFile(host_path=os.path.join(mozc_data_dir, 'data'),
334322 remote_path=os.path.join(remote_dir, 'data'),
335323 operation='push')
336324
349337 try:
350338 error_messages = []
351339 self.SetUpTest(options.remote_device, options.remote_mount_point,
352 options.mozc_root_dir, options.remote_dir,
340 options.remote_dir,
353341 options.mozc_dictionary_data_file,
354342 options.mozc_connection_data_file,
355343 options.mozc_connection_text_data_file,
00 MAJOR=2
11 MINOR=16
2 BUILD=1976
2 BUILD=1977
33 REVISION=102
44 # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
55 # downloaded by NaCl Mozc.