blob: d4916de7a08b6997a2423751927a8f5969a81596 [file] [log] [blame]
Chris Masonec80af5b2012-05-30 14:18:22 -07001#!/usr/bin/python
2#
3# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
Alex Miller9a1987a2013-08-21 15:51:16 -07007"""
8Deprecated tool for preprocessing tests to determine their DEPENDENCIES.
Chris Masonec80af5b2012-05-30 14:18:22 -07009"""
10
11import optparse, os, sys
12import common
Chris Masonec80af5b2012-05-30 14:18:22 -070013
Alex Miller9979b5a2012-11-01 17:36:12 -070014
Chris Masonec80af5b2012-05-30 14:18:22 -070015def parse_options():
beeps5cb8f912013-07-09 21:45:45 -070016 """Parse command line arguments."""
Chris Masonec80af5b2012-05-30 14:18:22 -070017 parser = optparse.OptionParser()
18 parser.add_option('-a', '--autotest_dir', dest='autotest_dir',
19 default=os.path.abspath(
20 os.path.join(os.path.dirname(__file__), '..')),
21 help="Directory under which to search for tests."\
22 " (e.g. /usr/local/autotest). Defaults to '..'")
23 parser.add_option('-o', '--output_file', dest='output_file',
24 default=None,
25 help='File into which to write collected test info.'\
26 ' Defaults to stdout.')
27 options, _ = parser.parse_args()
28 return options
29
30
Alex Miller9979b5a2012-11-01 17:36:12 -070031def main():
beeps5cb8f912013-07-09 21:45:45 -070032 """Main function."""
Alex Miller9979b5a2012-11-01 17:36:12 -070033 options = parse_options()
34
Alex Miller9a1987a2013-08-21 15:51:16 -070035 test_deps = {}
Chris Masonec80af5b2012-05-30 14:18:22 -070036
37 if options.output_file:
beeps5cb8f912013-07-09 21:45:45 -070038 with open(options.output_file, 'w') as file_obj:
39 file_obj.write('%r' % test_deps)
Chris Masonec80af5b2012-05-30 14:18:22 -070040 else:
41 print '%r' % test_deps
42
Alex Miller9979b5a2012-11-01 17:36:12 -070043
Chris Masonec80af5b2012-05-30 14:18:22 -070044if __name__ == "__main__":
45 sys.exit(main())