Skip to content

Commit

Permalink
tests: add 29_ninja_args
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Dec 5, 2022
1 parent 1209b84 commit d3fb09e
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 2 deletions.
21 changes: 21 additions & 0 deletions src/tests/29_ninja_args/build_expected/build-global.ninja
@@ -0,0 +1,21 @@
builddir = build
build ALWAYS: phony
rule CC_7950216292150676175
command = cat ${in} > ${out}
description = CC
pool = console

build build/objects/single_app.8352856137977294963.o: $
CC_7950216292150676175 $
single_app.c

rule LINK_7531752039969474517
command = cat $$(cat ${out}.rsp) > ${out}
description = LINK
rspfile = $out.rsp
rspfile_content = $in

build build/single_builder/single_app/single_app.elf: $
LINK_7531752039969474517 $
build/objects/single_app.8352856137977294963.o

@@ -0,0 +1 @@
content of single_builder.c
@@ -0,0 +1 @@
content of single_builder.c
21 changes: 21 additions & 0 deletions src/tests/29_ninja_args/laze-project.yml
@@ -0,0 +1,21 @@
builders:
- name: single_builder
rules:
- name: CC
in: 'c'
out: 'o'
cmd: 'cat ${in} > ${out}'
pool: console
- name: LINK
in: 'o'
rspfile: $out.rsp
rspfile_content: $in
cmd: 'cat $$(cat ${out}.rsp) > ${out}'

env:
bindir: build/${builder}/${app}

apps:
- name: single_app
sources:
- single_app.c
1 change: 1 addition & 0 deletions src/tests/29_ninja_args/single_app.c
@@ -0,0 +1 @@
content of single_builder.c
13 changes: 13 additions & 0 deletions src/tests/29_ninja_args/test.sh
@@ -0,0 +1,13 @@
#!/bin/sh

. ../test-common.sh

cleanup
build -j4 -v -c
clean_temp_files

diff -r build build_expected

echo TEST_OK

cleanup
5 changes: 3 additions & 2 deletions src/tests/test-common.sh
Expand Up @@ -4,14 +4,15 @@ cleanup() {
}

build() {
${LAZE} build -g
${LAZE} build -g "$@"
}

clean_temp_files() {
rm -rf \
build/.ninja_log build/.ninja_deps \
build/laze-cache-local.bincode \
build/laze-cache-global.bincode
build/laze-cache-global.bincode \
compile_commands.json
}

: "${LAZE:=laze}"
Expand Down

0 comments on commit d3fb09e

Please sign in to comment.