makefile - How to have GNU make explicitly test for failure? -
After not using the make for many years, I think it needs again, GNU version now. I'm pretty sure what I should do, but I do not know how, or got an answer with Google, etc.
I am trying to create a test target which executes my program multiple times, save the result in the log file. Due to some trials my program should be canceled Unfortunately, my messayee first closes on the test which leads to an error. I have something like this:
#makefile #search: myProg -h & gt; Test.log # Display myProg good_input & gt; & Gt; Test.log # should run ok myProg bad_input1 & gt; & Gt; Test.log # Error 1 myProg bad_input2 & gt; & Gt; Test_log # Error 2
With the above, after bad_input1 run ends, bad_input2 is never running.
If you want to achieve the goal of failing, then the proper solution is to reject its exit code.
# Makefile # test: myProg - H & gt; Test.log # Display myProg good_input & gt; & Gt; Test.log # should run properly! MyProg bad_input1 & gt; & Gt; Test.log # Error 1! MyProg bad_input2 & gt; & Gt; Test.log # Error 2
Now, it is an error to succeed in those two cases.
Comments
Post a Comment