Skip to content

Commit

Permalink
tests: add 34_expr_error_in_rule
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Dec 15, 2023
1 parent 97f290b commit c0e95eb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/tests/34_expr_error_in_rule/EXPECTED_EXIT_CODE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
1 change: 1 addition & 0 deletions src/tests/34_expr_error_in_rule/EXPECTED_STDERR
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
laze: error: builder "single_builder": binary "single_app": module "single_app": rule "CC": while expanding cmd "echo ${LOCAL_VAR} ${GLOBAL_VAR} ${in} > ${out}": expression error: An operator expected 2 arguments, but got 1.
22 changes: 22 additions & 0 deletions src/tests/34_expr_error_in_rule/laze-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
builders:
- name: single_builder
rules:
- name: CC
in: 'c'
out: 'o'
cmd: 'echo ${LOCAL_VAR} ${GLOBAL_VAR} ${in} > ${out}'
- name: LINK
in: 'o'
cmd: 'cat ${in} > ${out}'

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

apps:
- name: single_app
sources:
- single_app.c

env:
local:
LOCAL_VAR: "result = $(1+)"
10 changes: 10 additions & 0 deletions src/tests/34_expr_error_in_rule/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

. ../test-common.sh

cleanup
build

echo TEST_OK

cleanup

0 comments on commit c0e95eb

Please sign in to comment.