You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve automation: use exit codes to determine success or fail.
1. Run in terminal 1:
$PORT=3100 node app.js
2. Run in terminal 2:
$( ./verifyscript.sh && if [ $? -lt 0 ]; then echo "failure, exit code -1"; elif [ $? -eq 0 ]; then echo "success, exit code 0"; elif [ $? -lt 0 ]; then echo "failure, exit code less than 1"; elif [ $? -gt 1 ]; then echo "exit code greater than 1"; fi )
3. Result in terminal 2: expected output:
radsauce
success, child process exit code 0: OUTPUT is radsauce
4. Result in termimal 1: expected output:
radsauce
5. Note: the $? -lt 0 logic, meaning if process' exit code is less than 0, was used on the
command line, in addition to logic of string comparison within verifyscript.sh.
Which is most effective?
0 commit comments