Running the tests

Shaun Mahood edited this page Mar 18, 2017 · 31 revisions

DEPRECATION NOTICE: Please do not edit this wiki. Instead submit pull requests to https://github.com/clojure/clojurescript-site

The up to date version of this page can be found at https://clojurescript.org/community/running-tests

Testing the Compiler Infrastructure

lein test

Will run the tests for the analyzer, compiler, and closure components.

Testing JavaScript Engines

How to setup the the four important JavaScript runtimes.

Google V8

Checkout the V8 project. Following the build instructions here

Set the V8_HOME environment variable to the path where d8 lives.

export V8_HOME="$HOME/v8/out/native"

Alternatively, you can install V8 via Homebrew:

brew install v8

And set V8_HOME as:

export V8_HOME="/usr/local/bin"

Spidermonkey

Get the jsshell from here http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/. Set your SPIDERMONKEY_HOME environment variable.

JavaScriptCore

On OS X download a WebKit nightly and put it in your Applications folder. Update your shell profile to include the following:

DYLD_FRAMEWORK_PATH=/Applications/WebKit.app/Contents/Frameworks/10.10/
export DYLD_FRAMEWORK_PATH
PATH=$PATH:/Applications/WebKit.app/Contents/Frameworks/10.10/JavaScriptCore.framework/Resources

NOTE: Sub in the correct OSX version if you're not running 10.10

Alternatively, there is a system version of JSC installed at /System/Library/Frameworks/JavaScriptCore.framework/Resources. You can include it on your path with

PATH=$PATH:/System/Library/Frameworks/JavaScriptCore.framework/Resources

Nashorn

Setup the $NASHORN_HOME environment variable so that

$NASHORN_HOME/jjs

prompts a JavaScript Console. Nashorn is usually under $JAVA_HOME/bin, so you can write:

export NASHORN_HOME="$JAVA_HOME/bin"

Setting up dependencies

./script/bootstrap

Running the tests

./script/test

Running bootstrapped ClojureScript tests

If you have Node.js installed, you can run the bootstrapped ClojureScript test suite (located at src/test/self/self_host/test.cljs):

./script/test-self-host

You can also build and run the ClojureScript compiler test suite in bootstrapped mode within Node.js by running

./script/test-self-parity

Don't forget

Besides the tests it's important to make sure that the Browser REPL hasn't accidentally been broken. Double-check using the sample found in the repository.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.