davidsantiago/perforate — pull request #9 by harrigan (2014-10-10 15:39:39+00:00)
Title: Make sure than cleanup runs last

The for-comprehension is lazy, so the cleanup function is evaluated before the cases. For example:

```clj
(ns test-benchmarks
(:require [perforate.core :refer [defcase defgoal]]))

(defgoal test-benchmark
"A test benchmark."
:setup (fn []
(println "Running setup...")
[])
:cleanup (fn [_]
(println "Running cleanup...")))

(defcase test-benchmark
:default
[_]
(println "Running case..."))
```

produces:

```zsh
% lein perforate
Benchmarking profiles: [:dev]
======================
Benchmarking the following goals:
test-benchmark
Running setup...
Running cleanup...
WARNING: Final GC required 2.782969637340718 % of runtime
Running case...
Running case...
Running case...
...
```