icp/oer/courses/c-basics/sections/17-preprocessor/01-introduction/test.sh

34 lines
437 B
Bash
Raw Normal View History

2018-05-05 22:18:02 +00:00
#!/bin/bash
program1_out=$(./program)
program2_out=$(./program2)
pass=true
if [ "$program1_out" == "something was not defined" ]
then
test1="PASS Test1"
else
test1="FAIL Test1"
pass=false
fi
if [ "$program2_out" == "something was defined" ]
then
test2="PASS Test2"
else
test2="FAIL Test2"
pass=false
fi
if [ "$pass" == true ]
then
echo PASS
else
echo FAIL
fi
echo " " $test1
echo " " $test2