Skip to content

Commit

Permalink
tests: add 41_insights
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Jan 4, 2024
1 parent 39feb18 commit 572cde0
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/tests/41_insights/build_expected/build-global.ninja
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
builddir = build
build ALWAYS: phony
rule CC_6858609285403819907
command = echo ${in} > ${out}
description = CC

build build/objects/app.12070292612711521013.o: $
CC_6858609285403819907 $
app.c

rule CC_2200333248438117254
command = echo export_from_first_module ${in} > ${out}
description = CC

build build/objects/module.11950057073161860527.o: $
CC_2200333248438117254 $
module.c

rule CC_3607835224041131915
command = echo export_from_second_module ${in} > ${out}
description = CC

build build/objects/module.12888704424184336919.o: $
CC_3607835224041131915 $
module.c

rule LINK_5506617845631750009
command = cat ${in} > ${out}
description = LINK

build build/default/app2/app2.elf: $
LINK_5506617845631750009 $
build/objects/app.12070292612711521013.o $
build/objects/module.11950057073161860527.o $
build/objects/module.12888704424184336919.o

20 changes: 20 additions & 0 deletions src/tests/41_insights/build_expected/insights.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"builds": {
"default": {
"app2": {
"outfile": "build/default/app2/app2.elf",
"modules": {
"app2": {
"deps": [
"first_module",
"second_module",
"third_module"
]
},
"first_module": {},
"second_module": {}
}
}
}
}
}
69 changes: 69 additions & 0 deletions src/tests/41_insights/laze-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
builders:
- name: default
rules:
- name: CC
in: 'c'
out: 'o'
cmd: 'echo ${EXPORT_VAR} ${in} > ${out}'
- name: LINK
in: 'o'
cmd: 'cat ${in} > ${out}'
env:
bindir: build/${builder}/${app}


modules:
- name: first_module
sources:
- module.c
#disable:
#- second_module
env:
export:
EXPORT_VAR:
- export_from_first_module

- name: second_module
sources:
- module.c
conflicts:
- third_module
env:
export:
EXPORT_VAR:
- export_from_second_module

- name: third_module
sources:
- module.c
env:
export:
EXPORT_VAR:
- export_from_third_module

apps:
- name: app1
sources:
- app.c
selects:
- first_module
- ?second_module
- third_module

- name: app2
sources:
- app.c
disable:
- third_module
selects:
- first_module
- second_module
- ?third_module

- name: app3
sources:
- app.c
selects:
- first_module
- second_module
- third_module
13 changes: 13 additions & 0 deletions src/tests/41_insights/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

. ../test-common.sh

cleanup
build -i build/insights.json -G
clean_temp_files

diff -r build build_expected

echo TEST_OK

cleanup

0 comments on commit 572cde0

Please sign in to comment.