From 6965d73c4e0c4e1840f3054e6786125fbac31b7d Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 29 Jan 2021 09:07:17 -0300 Subject: [PATCH] Added test for ibom in makefile --- tests/test_plot/test_misc.py | 14 +++++++++++--- tests/yaml_samples/makefile_1.kibot.yaml | 5 +++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/test_plot/test_misc.py b/tests/test_plot/test_misc.py index a4e44737..036f87ba 100644 --- a/tests/test_plot/test_misc.py +++ b/tests/test_plot/test_misc.py @@ -52,7 +52,7 @@ from kibot.gs import GS POS_DIR = 'positiondir' -MK_TARGETS = ['position', 'archive'] +MK_TARGETS = ['position', 'archive', 'interactive_bom'] cov = coverage.Coverage() @@ -555,7 +555,7 @@ def test_makefile_1(): prj = 'test_v5' ctx = context.TestContext('test_makefile_1', prj, 'makefile_1', '') mkfile = ctx.get_out_path('Makefile') - ctx.run() + ctx.run(extra=['archive']) ctx.run(extra=['-m', mkfile]) ctx.expect_out_file('Makefile') targets = ctx.read_mk_targets(mkfile) @@ -573,17 +573,25 @@ def test_makefile_1(): assert ctx.get_out_path(os.path.join(POS_DIR, prj+'-bottom_pos.csv')) in deps assert os.path.abspath(targets[targets['position']]) == ctx.board_file logging.debug('- Target `position` OK') + # interactive_bom target + deps = targets['interactive_bom'].split(' ') + assert len(deps) == 1, deps + assert ctx.get_out_path(os.path.join('ibom', prj+'-ibom.html')) in deps + assert os.path.abspath(targets[targets['interactive_bom']]) == ctx.board_file + logging.debug('- Target `interactive_bom` OK') # archive target deps = targets['archive'].split(' ') assert len(deps) == 1, deps assert ctx.get_out_path(prj+'-archive.zip') in deps deps = targets[targets['archive']].split(' ') - assert len(deps) == 5, deps + assert len(deps) == 7, deps assert 'position' in deps + assert 'interactive_bom' in deps assert ctx.get_out_path('error.txt') in deps assert ctx.get_out_path('output.txt') in deps assert ctx.get_out_path('Makefile') in deps assert ctx.get_out_path('positiondir') in deps + assert ctx.get_out_path('ibom') in deps logging.debug('- Target `archive` OK') ctx.clean_up() diff --git a/tests/yaml_samples/makefile_1.kibot.yaml b/tests/yaml_samples/makefile_1.kibot.yaml index b27e12cf..7c6c7608 100644 --- a/tests/yaml_samples/makefile_1.kibot.yaml +++ b/tests/yaml_samples/makefile_1.kibot.yaml @@ -11,11 +11,16 @@ outputs: separate_files_for_front_and_back: true only_smd: true + - name: 'interactive_bom' + type: ibom + dir: ibom + - name: 'archive' type: compress options: files: - from_output: 'position' + - from_output: 'interactive_bom' - source: '*' dest: AnotherCopy