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

34 lines
437 B
Bash
Executable File

#!/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