|
42 | 42 | if __name__ == '__main__':
|
43 | 43 | # Parse Options
|
44 | 44 | parser = get_default_options_parser()
|
45 |
| - parser.add_option("-p", type="int", dest="program", |
| 45 | + parser.add_option("-p", type="int", dest="program", default=-1, |
46 | 46 | help="The index of the desired test program: [0-%d]" % (len(TESTS)-1))
|
47 | 47 | parser.add_option("-n", dest="program_name",
|
48 | 48 | help="The name of the desired test program")
|
49 | 49 | parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
|
50 | 50 | default=False, help="Verbose diagnostic output")
|
51 | 51 |
|
52 | 52 | # Local run
|
53 |
| - parser.add_option("--source", dest="input_dir", |
54 |
| - default=None, help="The source input directory") |
55 |
| - parser.add_option("--build", dest="output_dir", |
56 |
| - default=None, help="The binary output directory") |
| 53 | + parser.add_option("--automated", action="store_true", dest="automated", |
| 54 | + default=False, help="Automated test") |
| 55 | + parser.add_option("--host", dest="host_test", |
| 56 | + default=None, help="Host test") |
| 57 | + parser.add_option("--extra", dest="extra", |
| 58 | + default=None, help="Extra files") |
| 59 | + parser.add_option("--peripherals", dest="peripherals", |
| 60 | + default=None, help="Required peripherals") |
| 61 | + parser.add_option("--dep", dest="dependencies", |
| 62 | + default=None, help="Dependencies") |
| 63 | + parser.add_option("--source", dest="source_dir", |
| 64 | + default=None, help="The source (input) directory") |
| 65 | + parser.add_option("--duration", type="int", dest="duration", |
| 66 | + default=None, help="Duration of the test") |
| 67 | + parser.add_option("--build", dest="build_dir", |
| 68 | + default=None, help="The build (output) directory") |
57 | 69 | parser.add_option("-d", "--disk", dest="disk",
|
58 | 70 | default=None, help="The mbed disk")
|
59 | 71 | parser.add_option("-s", "--serial", dest="serial",
|
|
71 | 83 | default=None, help="use the specified linker script")
|
72 | 84 |
|
73 | 85 | (options, args) = parser.parse_args()
|
74 |
| - |
| 86 | + |
| 87 | + # force program to "0" if a source dir is specified |
| 88 | + if options.source_dir is not None: |
| 89 | + p = 0 |
| 90 | + n = None |
| 91 | + else: |
75 | 92 | # Program Number or name
|
76 |
| - p, n = options.program, options.program_name |
| 93 | + p, n = options.program, options.program_name |
| 94 | + |
77 | 95 | if n is not None and p is not None:
|
78 | 96 | args_error(parser, "[ERROR] specify either '-n' or '-p', not both")
|
79 | 97 | if n:
|
|
103 | 121 |
|
104 | 122 | # Test
|
105 | 123 | test = Test(p)
|
| 124 | + if options.automated is not None: |
| 125 | + test.automated = options.automated |
| 126 | + if options.dependencies is not None: |
| 127 | + test.dependencies = options.dependencies |
| 128 | + if options.host_test is not None: |
| 129 | + test.host_test = options.host_test; |
| 130 | + if options.peripherals is not None: |
| 131 | + test.peripherals = options.peripherals; |
| 132 | + if options.duration is not None: |
| 133 | + test.duration = options.duration; |
| 134 | + if options.extra is not None: |
| 135 | + test.extra_files = options.extra |
| 136 | + |
106 | 137 | if not test.is_supported(mcu, toolchain):
|
107 | 138 | print 'The selected test is not supported on target %s with toolchain %s' % (mcu, toolchain)
|
108 | 139 | sys.exit()
|
|
112 | 143 | test.dependencies.append(RTOS_LIBRARIES)
|
113 | 144 |
|
114 | 145 | build_dir = join(BUILD_DIR, "test", mcu, toolchain, test.id)
|
115 |
| - if options.input_dir is not None: |
116 |
| - test.source_dir = options.input_dir |
117 |
| - if options.output_dir is not None: |
118 |
| - build_dir = options.output_dir |
| 146 | + if options.source_dir is not None: |
| 147 | + test.source_dir = options.source_dir |
| 148 | + build_dir = options.source_dir |
| 149 | + |
| 150 | + if options.build_dir is not None: |
| 151 | + build_dir = options.build_dir |
119 | 152 |
|
120 | 153 | target = TARGET_MAP[mcu]
|
121 | 154 | try:
|
|
0 commit comments