diff --git a/run.py b/run.py index 3fe4de7..39b5d8c 100644 --- a/run.py +++ b/run.py @@ -28,8 +28,17 @@ for case in os.listdir(path): with open('Tasty/include/sta/tasty/config.hpp', 'w') as f: f.write(cfg_template.format(number)) + print(colored(f'Building case { number }...', 'blue')) + # Build the new project and upload it to the STM32. - subprocess.call(f'Tasty/flash.bat {case}', stdout=sys.stdout) + out = subprocess.run([r'Tasty\flash.bat', case]) + + # Check if the bash script was successfully executed. + if out.returncode != 0: + print('Building\t' + colored('[FAILED]', 'red')) + continue + else: + print('Building\t' + colored('[PASSED]', 'red')) print(colored(f'Running case { number }...', 'blue'))