Installing

Aaron Jacobs edited this page Sep 3, 2015 · 3 revisions

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

On FreeBSD the easiest way to install Google JS Test is to use the gjstest port. See the Installing Applications section of the FreeBSD Handbook for more info on using ports.

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 appropriate apt-get package.

Prerequisites

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:

  1. Download a tarball of HEAD from the git repo and extract it to a temporary directory.

  2. Enter the temporary directory and run make. This will build the tool and all of its necessary data files.

  3. Run 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 PREFIX variable when running make in both steps.)

That's it! Try running gjstest to make sure the installation succeeded. You should see a message like No tests found..