Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###############################################
- ## Filename: Makefile
- ## Author: Daniel Guenther
- ## Date: 2018-01-31
- ## Purpose: To quickly create and run test cases for a small program
- ###############################################
- program=gcl -f lab3.cl
- testdir=Tests
- # runs the newest test
- runNewTest: ${testdir} ${progname}
- ${program} < ${testdir}/`ls -t ${testdir} | head -1`
- # runs program with each test case found in testing directory
- runTests: ${testdir} ${progname}
- echo; for testfile in `ls ${testdir}/`; do ${program} < ${testdir}/$$testfile; echo; done
- # quickly create a new one-line test case (prompts user for test contents, generates new filename)
- newTest: ${testdir}
- i=0;while [ -f ${testdir}/test$$i ]; do i=$$(($$i+1)); done; read input && echo $$input > ${testdir}/test$$i
- ${testdir}:
- mkdir -p ${testdir}
Add Comment
Please, Sign In to add comment