From 3f97fca40efca8a0e3e9291deed60ca366b0d79e Mon Sep 17 00:00:00 2001 From: Leonardo Vencovsky Date: Tue, 30 Jun 2020 23:57:58 -0300 Subject: [PATCH] Update autogen.py --- .travis.yml | 2 +- autogen.py | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index eb93d61..b001f94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,6 @@ script: - gcc --version - gcov --version - python --version - - python autogen.py -e -b -cv -r -nf + - python autogen.py -e -b -cv -r -nf -nt after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/autogen.py b/autogen.py index 5275234..2797375 100644 --- a/autogen.py +++ b/autogen.py @@ -359,6 +359,13 @@ def run_codecov(): ''' execute_command([full_path(f'{BIN_DIR}/{CODECOV}.exe')]) execute_command(['gcov'] + GCOV_FLAGS + [f'{CODECOV}.gcda']) + execute_command(['rm', '*.h.gcov']) + + +def tidy(): + ''' + Places files to their respective directory. + ''' execute_command(['mv', '*.gcov', GCOV_DIR]) @@ -376,7 +383,7 @@ if __name__ == '__main__': expand = p.add_argument_group('expand', 'For dealing with code generation and formatting for tests') task = p.add_argument_group('task', 'Specify a task (mutually exclusive)') - task_ = task.add_mutually_exclusive_group(required=True) + task_ = task.add_mutually_exclusive_group() action = p.add_argument_group('action', 'Actions on task') @@ -414,6 +421,11 @@ if __name__ == '__main__': default=False, action='store_true', dest='noformat') + expand.add_argument('-nt', '--no-tidy', + help='Don\'t move files around', + default=False, + action='store_true', + dest='notidy') action.add_argument('-b', '--build', help='Build task', @@ -439,6 +451,8 @@ if __name__ == '__main__': args = p.parse_args() + has_target = args.main or args.codecov or args.single + if args.config: print(CONFIG) exit(0) @@ -490,3 +504,6 @@ if __name__ == '__main__': elif args.single: require_file(f'{OUTPUT_DIR}/{SINGLE}.c') # TODO + + if not args.notidy and has_target: + tidy()