scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 6426c52005d61309b73634bf86fd3bcac624cacc
parent 83a44c0292f5ac37c809b3ac00600a831f97099c
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 17 Jan 2024 14:45:49 +0100

tests/make: Split 0006-iflag.sh

It is better to have only one test case per file instead
of sharing the script betwen different test cases.

Diffstat:
Mtests/make/execute/0006-iflag.sh | 26++------------------------
Atests/make/execute/0007-iflag.sh | 16++++++++++++++++
Atests/make/execute/0008-ignore.sh | 16++++++++++++++++
Atests/make/execute/0009-ignore.sh | 27+++++++++++++++++++++++++++
Rtests/make/execute/0007-kflag.sh -> tests/make/execute/0010-kflag.sh | 0
5 files changed, 61 insertions(+), 24 deletions(-)

diff --git a/tests/make/execute/0006-iflag.sh b/tests/make/execute/0006-iflag.sh @@ -1,38 +1,16 @@ #!/bin/sh -set -e - -trap 'rm -f $tmp1 $tmp2 $tmp3' EXIT INT QUIT HUP TERM +trap 'rm -f $tmp1 $tmp2' EXIT INT QUIT HUP TERM tmp1=tmp1.$$ tmp2=tmp2.$$ -tmp3=tmp3.$$ - -cat <<EOF > $tmp3 -.IGNORE: - -error: - no-valid-program -EOF cat <<EOF > $tmp2 sh: 1: no-valid-program: not found -i no-valid-program -sh: 1: no-valid-program: not found --i -no-valid-program -sh: 1: no-valid-program: not found -no-valid-program -sh: 1: no-valid-program: not found -no-valid-program -Hello World! EOF -(scc-make -if test.mk error print-makeflags - MAKEFLAGS=-i scc-make -f test.mk error print-makeflags - scc-make -f test.mk ignored-error - scc-make -f $tmp3 error - scc-make hello) > $tmp1 2>&1 +scc-make -if test.mk error print-makeflags > $tmp1 2>&1 diff $tmp1 $tmp2 diff --git a/tests/make/execute/0007-iflag.sh b/tests/make/execute/0007-iflag.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +trap 'rm -f $tmp1 $tmp2' EXIT INT QUIT HUP TERM + +tmp1=tmp1.$$ +tmp2=tmp2.$$ + +cat <<EOF > $tmp2 +sh: 1: no-valid-program: not found +-i +no-valid-program +EOF + +MAKEFLAGS=-i scc-make -f test.mk error print-makeflags > $tmp1 2>&1 + +diff -u $tmp1 $tmp2 diff --git a/tests/make/execute/0008-ignore.sh b/tests/make/execute/0008-ignore.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +trap 'rm -f $tmp1 $tmp2' EXIT INT QUIT HUP TERM + +tmp1=tmp1.$$ +tmp2=tmp2.$$ + +cat <<EOF > $tmp2 +sh: 1: no-valid-program: not found +Hello World! +no-valid-program +EOF + +scc-make -f test.mk ignored-error hello > $tmp1 2>&1 + +diff $tmp1 $tmp2 diff --git a/tests/make/execute/0009-ignore.sh b/tests/make/execute/0009-ignore.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +trap 'rm -f $tmp1 $tmp2 $tmp3' EXIT INT QUIT HUP TERM + +tmp1=tmp1.$$ +tmp2=tmp2.$$ +tmp3=tmp3.$$ + +cat <<EOF > $tmp2 +EOF + +cat <<EOF > $tmp3 +.IGNORE: + +error: + no-valid-program +EOF + +cat <<EOF > $tmp2 +sh: 1: no-valid-program: not found +make: error: don't know how to make hello +no-valid-program +EOF + +scc-make -f $tmp3 error hello > $tmp1 2>&1 + +diff $tmp1 $tmp2 diff --git a/tests/make/execute/0007-kflag.sh b/tests/make/execute/0010-kflag.sh