From c93f4bac6b7e5f859d125ba7c9560f11565a2cff Mon Sep 17 00:00:00 2001 From: Leonardo Vencovsky Date: Tue, 23 Jun 2020 22:09:09 -0300 Subject: [PATCH] Update autogen.py --- autogen.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/autogen.py b/autogen.py index 1073528..bb4bec0 100644 --- a/autogen.py +++ b/autogen.py @@ -28,7 +28,7 @@ from typing import List, Text # included: main.c, unt folder OUTPUT_DIR = './tests' # All libraries -ALL_LIBS = ['CMC', 'SAC', 'TSC'] +ALL_LIBS = ['CMC'] # Directory mapping DIR_MAP = {'HEADER': 'include', 'SOURCE': 'src'} # File extension mapping @@ -133,8 +133,9 @@ def full_path(path: Text) -> Text: def execute_command(commands: List[Text]): - print(' '.join(commands)) - cp = subprocess.run(commands, shell=True) + cmd = ' '.join(commands) + print(cmd) + subprocess.check_call(cmd, shell=True) # if cp.returncode != 0: # print('Error when executing the last command') @@ -184,9 +185,10 @@ def clean_build(cleanfull: bool): ''' Removes all files generated by compilation and code coverage along with folders. ''' - execute_command(['rm', '-r', f'{GCOV_DIR}/*.gcov']) - execute_command(['rm', TEST_EXE]) - execute_command(['rm', '-r', BUILD_DIR]) + # -f prevents 'rm' from failing + execute_command(['rm', '-r', '-f', f'{GCOV_DIR}/*.gcov']) + execute_command(['rm', '-f', TEST_EXE]) + execute_command(['rm', '-r', '-f', BUILD_DIR]) if cleanfull: execute_command(['rm', '-r', SRC_DIR]) @@ -280,7 +282,6 @@ def build_tests(with_coverage: bool): Build all object files and the main executable for tests ''' cflags = CFLAGS.copy() - lflags = CFLAGS.copy() if with_coverage: cflags += CVFLAGS