File tree Expand file tree Collapse file tree 4 files changed +24
-6
lines changed Expand file tree Collapse file tree 4 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 36
36
from tools .build_api import static_analysis_scan , static_analysis_scan_lib , static_analysis_scan_library
37
37
from tools .build_api import print_build_results
38
38
from tools .settings import CPPCHECK_CMD , CPPCHECK_MSG_FORMAT
39
- from utils import argparse_filestring_type
39
+ from utils import argparse_filestring_type , args_error
40
40
from tools .settings import CPPCHECK_CMD , CPPCHECK_MSG_FORMAT , CLI_COLOR_MAP
41
41
from utils import argparse_filestring_type , argparse_dir_not_parent
42
42
167
167
# Get toolchains list
168
168
toolchains = options .tool if options .tool else TOOLCHAINS
169
169
170
+ if options .source_dir and not options .build_dir :
171
+ args_error (parser , "argument --build is required by argument --source" )
172
+
170
173
if options .color :
171
174
# This import happens late to prevent initializing colorization when we don't need it
172
175
import colorize
Original file line number Diff line number Diff line change 212
212
213
213
# Toolchain
214
214
if options .tool is None :
215
- args_error (parser , "argument -t/--toolchain is required" )
215
+ args_error (parser , "argument -t/--tool is required" )
216
216
toolchain = options .tool [0 ]
217
217
218
+ if (options .program is None ) and (not options .source_dir ):
219
+ args_error (parser , "one of -p, -n, or --source is required" )
220
+
221
+ if options .source_dir and not options .build_dir :
222
+ args_error (parser , "argument --build is required when argument --source is provided" )
223
+
218
224
if options .color :
219
225
# This import happens late to prevent initializing colorization when we don't need it
220
226
import colorize
Original file line number Diff line number Diff line change 13
13
from tools .tests import test_known , test_name_known
14
14
from tools .targets import TARGET_NAMES
15
15
from tools .libraries import LIBRARIES
16
- from utils import argparse_filestring_type , argparse_many
16
+ from utils import argparse_filestring_type , argparse_many , args_error
17
17
from utils import argparse_force_lowercase_type , argparse_force_uppercase_type , argparse_dir_not_parent
18
18
from project_api import setup_project , perform_export , print_results , get_lib_symbols
19
19
131
131
132
132
# source_dir = use relative paths, otherwise sources are copied
133
133
sources_relative = True if options .source_dir else False
134
+ # Target
135
+ if not options .mcu :
136
+ args_error (parser , "argument -m/--mcu is required" )
137
+
138
+ # Toolchain
139
+ if not options .ide :
140
+ args_error (parser , "argument -i is required" )
141
+
142
+ if (options .program is None ) and (not options .source_dir ):
143
+ args_error (parser , "one of -p, -n, or --source is required" )
134
144
135
145
for mcu in options .mcu :
136
146
# Program Number or name
Original file line number Diff line number Diff line change 112
112
113
113
# Toolchain
114
114
if options .tool is None :
115
- args_error (parser , "argument -t/--toolchain is required" )
115
+ args_error (parser , "argument -t/--tool is required" )
116
116
toolchain = options .tool [0 ]
117
117
118
118
# Find all tests in the relevant paths
152
152
else :
153
153
# Build all tests
154
154
if not options .build_dir :
155
- print "[ERROR] You must specify a build path"
156
- sys .exit (1 )
155
+ args_error (parser , "argument --build is required" )
157
156
158
157
base_source_paths = options .source_dir
159
158
You can’t perform that action at this time.
0 commit comments