I am currently working on a bigger project where i want to test executable file with few different codes as input.
I call it like this ./test < code1
and after command echo $?
, it shows last returned value [0, 1, 2, ..]
I wanted to automate is, so i created call in makefile
like this :
#makefile
[...]
test :
./test < code1
@echo $$?
./test < code2
@echo $$?
[...]
[...]
So i can call make test
.
When program returns 0 as success, everything works fine. But when program has to return something else than 0, it shows me this :
./test < code3
Makefile:19: recipe for target 'test' failed
make: *** [test[ Error 2
Weird thing is, when i try to call program with code which made it crash in command line like :
./test < code3; echo $?
It works perfectly and shows me last exit status ( for exapmle 3 ).
I am confused now, because i thought it should work the same. Can someone help me out?
Thank you!