A talking makefile

So, after learning how to use makefiles, then how to use makefiles for TDD and for code coverage report, now you need to annoy your whole team with a talking makefile. What could be better to notify everyone on your team when a test fails than a synthesized voice commanding you to fix your program?
test: $(TEST_SRCS)
	@for TEST in $(TEST_BINS); do 
		make "$$TEST"; 
		echo "Execute $(TEST)"; 
		if ! ./$$TEST; then 
			echo "Oh noes! I detected a failed test from $$TEST. Go and fix your program!" | festival --tts ; 
	done

Try it. You’ll love it.

Bonus chatter: when Valgrind detects over $MUCHOS errors it’ll print “Too many errors detected. Go and fix your program”, then it won’t print so much detail in the next backtraces.

Advertisements

One Comment on “A talking makefile”


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s