<commit_before># Running the Tests

## Build and run the unit tests on Linux

```sh
cd path/to/pomdog

# Creating a build directory
mkdir -p build.cmake && cd build.cmake

# Generate Makefile
export CC=clang
export CXX=clang++
export LINK=clang++
export CXXFLAGS="-std=c++17 -stdlib=libc++"
export LDFLAGS="-stdlib=libc++"
cmake -DCMAKE_BUILD_TYPE=Release ../build/PomdogTest/

# Compiling source code
make

# Run the unit tests
./PomdogTest        
```

## Build and run the unit tests on Mac OS X

To run all unit tests, use:

```sh
cd path/to/pomdog

# Creating a build directory
mkdir -p build.cmake && cd build.cmake

# Generating Xcode project files
cmake -G Xcode ../build/PomdogTest/

# Compiling source code
xcodebuild -project PomdogTest.xcodeproj -configuration Release

# Run the unit tests
./Release/PomdogTest
```

## Build and run the unit tests on Windows

```sh
cd path/to/pomdog

# Creating a build directory
mkdir build.cmake
cd build.cmake<commit_msg>Update documentation about building on Linux<commit_after># Running the Tests

## Build and run the unit tests on Linux

```sh
cd path/to/pomdog

# Creating a build directory
mkdir -p build.cmake && cd build.cmake

# Generate Makefile
cmake \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DCMAKE_BUILD_TYPE=Release \
    ../build/PomdogTest/

# Compiling source code
make -j4

# Run the unit tests
./PomdogTest        
```

### Building with a custom toolchain

To compile with GCC, run the following command:

```sh
cmake \
    -DCMAKE_C_COMPILER=gcc \
    -DCMAKE_CXX_COMPILER=g++ \
    -DCMAKE_BUILD_TYPE=Release \
    ../build/PomdogTest/
```

You can also override the compiler options by setting the environment variables such as `expor CXX=...` or `export CXXFLAGS=...`.

```sh
export CC=clang
export CXX=clang++
export LINK=clang++
export CXXFLAGS="-std=c++17 -stdlib=libc++"
export LDFLAGS="-stdlib=libc++"
cmake -DCMAKE_BUILD_TYPE=Release ../build/PomdogTest/
```

### Building with Ninja instead of GNU Make

To build with Ninja, run the following command:

```sh
# Generate Ninja file
cmake \
    -G Ninja \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DCMAKE_BUILD_TYPE=Release \
    ../build/PomdogTest/

# Build with Ninja
ninja
```

## Build and run the unit tests on Mac OS X

To run all unit tests, use:

```sh
cd path/to/pomdog

# Creating a build directory
mkdir -p build.cmake && cd build.cmake

# Generating Xcode project files
cmake -G Xcode ../build/PomdogTest/

# Compiling source code
xcodebuild -project PomdogTest.xcodeproj -configuration Release

# Run the unit tests
./Release/PomdogTest
```

## Build and run the unit tests on Windows

```sh
cd path/to/pomdog

# Creating a build directory
mkdir build.cmake
cd build.cmake
{'fraction_non_alphanumeric': 0.10702702702702703, 'fraction_numerical': 0.0018018018018018018, 'mean_word_length': 3.6734006734006734, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4300287', 'n_tokens_mistral': 1002, 'n_tokens_neox': 942, 'n_words': 313}