mirror of https://github.com/ARMmbed/mbed-os.git
added a check for existance of sources
I ran into this earlier today and yesterday: If you spelled something wrong/forgot to tab complete and had build succesfully before it woild silently and incorrectly build successfully
parent
3c08e7b7b3
commit
f44b8fc9bf
|
@ -21,7 +21,7 @@ TEST BUILD & RUN
|
||||||
import sys
|
import sys
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from shutil import copy
|
from shutil import copy
|
||||||
from os.path import join, abspath, dirname
|
from os.path import join, abspath, dirname, isfile, isdir
|
||||||
|
|
||||||
# Be sure that the tools directory is in the search path
|
# Be sure that the tools directory is in the search path
|
||||||
ROOT = abspath(join(dirname(__file__), ".."))
|
ROOT = abspath(join(dirname(__file__), ".."))
|
||||||
|
@ -46,7 +46,6 @@ try:
|
||||||
except:
|
except:
|
||||||
ps = object()
|
ps = object()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# Parse Options
|
# Parse Options
|
||||||
parser = get_default_options_parser()
|
parser = get_default_options_parser()
|
||||||
|
@ -167,6 +166,11 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
for path in options.source_dir :
|
||||||
|
if not isfile(path) and not isdir(path) :
|
||||||
|
args_error(parser, "[ERROR] you passed \"{}\" to --source, which does not exist".
|
||||||
|
format(path))
|
||||||
|
|
||||||
# Print available tests in order and exit
|
# Print available tests in order and exit
|
||||||
if options.list_tests is True:
|
if options.list_tests is True:
|
||||||
print '\n'.join(map(str, sorted(TEST_MAP.values())))
|
print '\n'.join(map(str, sorted(TEST_MAP.values())))
|
||||||
|
|
Loading…
Reference in New Issue