This document explains how to install Google JS Test on your system. This is a one-time setup process; once you've taken care of this see Getting started for a guide to writing your first test.
Fast track for OS X
On OS X you can install Google JS Test more easily by using the Homebrew package manager.
Once you have installed Homebrew following the instructions at the link above, simply run the following to install Google JS Test:
brew install gjstest
Google JS Test is now installed on your system, and there is no need to follow the instructions below.
Fast track for FreeBSD
Fast track for Linux
Most of the prerequisites for Google JS Test can be installed from Ubuntu's
package repository with apt-get. Google JS Test does not yet have an
In order to build and install Google JS Test, you need the following:
OS X 10.6 or later, Linux, or some other Unix-like system. (Google JS Test has been tested on Ubuntu 11.04, but other versions and flavors will probably work.)
A working C++ compiler. On OS X, install Apple's free Xcode.
The libxml2 library. (This is built-in on OS X, so OS X users don't need to install it.)
The gflags library.
The glog library.
The protobuf library.
The re2 library.
The v8 library.
See the project pages for each of the prerequisite libraries to find out how to download and install them.
Downloading and installing
Follow the process below to download and install Google JS Test on your system:
Download a tarball of
HEADfrom the git repo and extract it to a temporary directory.
Enter the temporary directory and run
make. This will build the tool and all of its necessary data files.
sudo make install. This will install the tool and its necessary data files into the appropriate place on your system. (The default is
/usr/local, but you can control this by setting the
PREFIXvariable when running
makein both steps.)
That's it! Try running
gjstest to make sure the installation succeeded. You
should see a message like
No tests found..