Update autogen.py

This commit is contained in:
Leonardo Vencovsky committed 2020-06-23 22:09:09 -03:00
1 parent e1bb3542ee
commit c93f4bac6b
1 file changed
+8 -7
+8 -7
View File
@@ -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