Skip to content

Instantly share code, notes, and snippets.

@juxtin
Created March 3, 2015 22:03
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 juxtin/ced3f7eb5d5684a201f9 to your computer and use it in GitHub Desktop.
Save juxtin/ced3f7eb5d5684a201f9 to your computer and use it in GitHub Desktop.
lt: wrapper around "lein test"
#!/bin/bash
#### lt -- a wrapper around "lein test"
# The purpose of this script is to provide some conveniences around
# running Leiningen tests. Specifically, it does the following:
# 1) fails if there any unsaved Emacs buffers
# 2) prints out any lines containing "DEBUG" or Spyscope statements
# 3) runs the test with the supplied arguments
#
# unofficial strict mode
set -euo pipefail
IFS=$'\n\t'
# First, see if there are any unsaved Emacs buffers
test "$(find . -name '#*#')" && (echo there are unsaved files: $(find . -name '#*#')) && exit 1
# Next, grep for debug symbols
ag 'DEBUG|#spy/[tdp]' src/ || :
# Ok, now run the test with whatever arguments were supplied
lein test $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment