• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/python2
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
7"""
8Deprecated tool for preprocessing tests to determine their DEPENDENCIES.
9"""
10
11from __future__ import absolute_import
12from __future__ import division
13from __future__ import print_function
14import optparse, os, sys
15import common
16
17
18def parse_options():
19    """Parse command line arguments."""
20    parser = optparse.OptionParser()
21    parser.add_option('-a', '--autotest_dir', dest='autotest_dir',
22                      default=os.path.abspath(
23                          os.path.join(os.path.dirname(__file__), '..')),
24                      help="Directory under which to search for tests."\
25                           " (e.g. /usr/local/autotest).  Defaults to '..'")
26    parser.add_option('-o', '--output_file', dest='output_file',
27                      default=None,
28                      help='File into which to write collected test info.'\
29                           '  Defaults to stdout.')
30    parser.add_option('-e', '--extra_autotest_dirs',
31                      dest='extra_autotest_dirs', default=None,
32                      help="A list of directories under which to search for "
33                           "extra Autotest tests. Defaults to None.")
34    options, _ = parser.parse_args()
35    return options
36
37
38def main():
39    """Main function."""
40    options = parse_options()
41
42    test_deps = {}
43
44    if options.output_file:
45        with open(options.output_file, 'w') as file_obj:
46            file_obj.write('%r' % test_deps)
47    else:
48        print('%r' % test_deps)
49
50
51if __name__ == "__main__":
52    sys.exit(main())
53