#!/usr/bin/env emacs --script

(let ((current-directory (file-name-directory load-file-name)))
  (setq projectile-test-path (expand-file-name "." current-directory))
  (setq projectile-root-path (expand-file-name ".." current-directory)))

(add-to-list 'load-path projectile-root-path)
(add-to-list 'load-path projectile-test-path)

(require 'projectile)
(require 'noflet)

(dolist (test-file (or argv (directory-files projectile-test-path t "-test.el$")))
  (load test-file nil t))

;; setup test environment
;; and run tests

(ert-run-tests-batch-and-exit t)
