Skip to content

How to Use ClojureC

uvtc edited this page Jul 25, 2012 · 1 revision

At the moment, probably the easiest way to get started using ClojureC is to emulate what the existing tests are doing by creating your own test file. For example, make your own test/clojurec/my_test.clj file containing something like:

(ns clojurec.my-test
  (:require [clojure.test :as test]
            clojurec.core))

(defn- core-run [x]
  (clojurec.core/run-expr 'clojurec.my-test true x))

(test/deftest basic
  (test/is (= (core-run '(pr "hello"))
              ['hello])))

then run the test from the top-level ClojureC project directory like so:

$ lein test clojurec.my-test

You should get output that looks like:

lein test clojurec.my-test

Ran 1 tests containing 1 assertions.
0 failures, 0 errors.
Clone this wiki locally