Skip to content

Instantly share code, notes, and snippets.

@textarcana
Created July 23, 2014 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save textarcana/6372a49c992b35a7d7e6 to your computer and use it in GitHub Desktop.
Save textarcana/6372a49c992b35a7d7e6 to your computer and use it in GitHub Desktop.
A simple test runner in bash and Perl.
perl -lwne 'BEGIN{$status=0;
print "tests running..."};
print qq{$_:};
$result = qx{curl -s -IL $_ | grep "200 OK"};
if ($result eq ""){print "FAIL\n"; $status=1} else {print $result};
END{if($status != 0){print "Some tests failed."} else {print "All done!"};
exit $status}' test.config
mtv.com
dailyshow.com
NOTAREALSITEcc.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment