#!/bin/bash

# Convenience script for test-driven development (TDD). This compiles your code,
# runs it, and compares its output with your expected output in test_mintf.txt
#
# For instructions, see README-go.txt (on the 'Schedule' page under 9/22/2017).

# COMPILE
gcc -std=c99 -g -Wall -Wshadow -pedantic -Wvla -Werror test_mintf.c mintf.c -o test_mintf
if [[ $? != 0 ]]; then exit $?; fi  # if gcc failed, then quit

# RUN and store output in actual.txt.
./test_mintf > actual.txt
# To see output as it runs, change to this:   ./test_mintf | tee actual.txt

# COMPARE actual output with your expected output
diff -B actual.txt test_mintf.txt

© Copyright 2017 Alexander J. Quinn         This content is protected and may not be shared, uploaded, or distributed.