Added test for ibom in makefile

This commit is contained in:
Salvador E. Tropea 2021-01-29 09:07:17 -03:00
parent f29c0c5361
commit 6965d73c4e
2 changed files with 16 additions and 3 deletions

View File

@ -52,7 +52,7 @@ from kibot.gs import GS
POS_DIR = 'positiondir' POS_DIR = 'positiondir'
MK_TARGETS = ['position', 'archive'] MK_TARGETS = ['position', 'archive', 'interactive_bom']
cov = coverage.Coverage() cov = coverage.Coverage()
@ -555,7 +555,7 @@ def test_makefile_1():
prj = 'test_v5' prj = 'test_v5'
ctx = context.TestContext('test_makefile_1', prj, 'makefile_1', '') ctx = context.TestContext('test_makefile_1', prj, 'makefile_1', '')
mkfile = ctx.get_out_path('Makefile') mkfile = ctx.get_out_path('Makefile')
ctx.run() ctx.run(extra=['archive'])
ctx.run(extra=['-m', mkfile]) ctx.run(extra=['-m', mkfile])
ctx.expect_out_file('Makefile') ctx.expect_out_file('Makefile')
targets = ctx.read_mk_targets(mkfile) 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 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 assert os.path.abspath(targets[targets['position']]) == ctx.board_file
logging.debug('- Target `position` OK') 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 # archive target
deps = targets['archive'].split(' ') deps = targets['archive'].split(' ')
assert len(deps) == 1, deps assert len(deps) == 1, deps
assert ctx.get_out_path(prj+'-archive.zip') in deps assert ctx.get_out_path(prj+'-archive.zip') in deps
deps = targets[targets['archive']].split(' ') deps = targets[targets['archive']].split(' ')
assert len(deps) == 5, deps assert len(deps) == 7, deps
assert 'position' in deps assert 'position' in deps
assert 'interactive_bom' in deps
assert ctx.get_out_path('error.txt') 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('output.txt') in deps
assert ctx.get_out_path('Makefile') in deps assert ctx.get_out_path('Makefile') in deps
assert ctx.get_out_path('positiondir') in deps assert ctx.get_out_path('positiondir') in deps
assert ctx.get_out_path('ibom') in deps
logging.debug('- Target `archive` OK') logging.debug('- Target `archive` OK')
ctx.clean_up() ctx.clean_up()

View File

@ -11,11 +11,16 @@ outputs:
separate_files_for_front_and_back: true separate_files_for_front_and_back: true
only_smd: true only_smd: true
- name: 'interactive_bom'
type: ibom
dir: ibom
- name: 'archive' - name: 'archive'
type: compress type: compress
options: options:
files: files:
- from_output: 'position' - from_output: 'position'
- from_output: 'interactive_bom'
- source: '*' - source: '*'
dest: AnotherCopy dest: AnotherCopy