Guest User

Untitled

a guest
Feb 14th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. ###############################################
  2. ## Filename: Makefile
  3. ## Author: Daniel Guenther
  4. ## Date: 2018-01-31
  5. ## Purpose: To quickly create and run test cases for a small program
  6. ###############################################
  7.  
  8. program=gcl -f lab3.cl
  9. testdir=Tests
  10.  
  11. # runs the newest test
  12. runNewTest: ${testdir} ${progname}
  13. ${program} < ${testdir}/`ls -t ${testdir} | head -1`
  14.  
  15. # runs program with each test case found in testing directory
  16. runTests: ${testdir} ${progname}
  17. echo; for testfile in `ls ${testdir}/`; do ${program} < ${testdir}/$$testfile; echo; done
  18.  
  19. # quickly create a new one-line test case (prompts user for test contents, generates new filename)
  20. newTest: ${testdir}
  21. i=0;while [ -f ${testdir}/test$$i ]; do i=$$(($$i+1)); done; read input && echo $$input > ${testdir}/test$$i
  22.  
  23. ${testdir}:
  24. mkdir -p ${testdir}
Add Comment
Please, Sign In to add comment