# Building and Running the Tests for the p≡p Engine
Work in progress... Currently have the debian build/run instructions in.
## Caveat, before you begin
Right now, the engine tests only function on \*nix-like systems (including MacOS). (Conversion to Windows will require, at the very least, looking at some of the file-handling code.) If you want to fix this, start by looking in Engine.cc in the test/src directory!
Right now, the engine tests only function on \*nix-like systems (including
*(Conversion to Windows will require, at the very least, looking at some of the
file-handling code. If you want to fix this, start by looking in Engine.cc
in the test/src directory!)*
In addition to the engine requirements, you will need:
* `cmake``python3``git` (for getting the `gtest-parallel` repository, unless
* you grab the tarball from somewhere)
## Building the prerequisites
The Engine test suite now requires (at least) two additional pieces to run:
How this proceeds depends on your platform and whether or not you use a packaged
These instructions do this with `cmake`. If you can manage it with `bazel`
instead, more power to you ;)
### Installing `googletest`
#### Packaged distributions
This is the currently preferred way to do this, because everyone was doing it
anyway and who am I to judge?
##### Debian and Ubuntu (and derivatives)
## Preparing to build
Thanks to Erik Smistad for this starting point (condensed from [Getting Started
The Engine test suite now requires (at least) two additional pieces to run - **googletest** and **gtest-parallel**. You will note that I give specific instructions about where to put these, because that is what I have tried and tested. That does NOT mean other things won’t work; I simply haven’t tried them. So without further ado…
1. Install the packages `cmake` and `libgtest-dev` from the repository. This
will install the gtest source files to `/usr/src/gtest`. You'll still need to
compile the code and link the library files to be able to use them.
2. Compile the source files:
sudo cmake CMakeLists.txt
**googletest** is an XUnit testing framework we are now using in place of cpptest. Unlike a lot of other testing frameworks, it’s recommended that you compile and link the test code directly within your project. These instructions do with with **cmake**. If you can manage it with **bazel** instead, more power to you ;)
3. Copy/symlink the libraries to the library location of your choice (here,
it's `/usr/lib`, hence the `sudo`, but as long as it's in your library path,
it shouldn't matter where you stick it):
sudo cp *.a /usr/lib
So. To get things started.
In the directory of your choice (default, if you don’t want to change **local.conf** - specifically **GTEST\_DIR** - is the test directory (this one, presumably)):
I am totally guessing for now - this is a placeholder - that
macports gtest install will do the same. Will need to find the directories this