Skip to content
mogemimi edited this page Aug 19, 2018 · 13 revisions

⚠️ This is the documentation for older version. Please see the new documentation Running the Tests instead.

Prerequisites

Build requirements

  • Git
  • Python 2.7
  • Xcode 8.3+ (Mac OS X)
  • Visual Studio 2017 (Windows)
  • Clang 3.8 (Linux)

Cloning unit testing framework

First, you need to download build dependencies and unit testing framework.

cd path/to/pomdog
python tools/download_dependencies.py

Please see Download Build Dependencies for more details.

Build and run the unit tests on Linux

# Generate Makefiles
python tools/gyp.py test/FrameworkTest/unittest.gyp -f make

# Compiling source code
export CC=clang
export CXX=clang++
export LINK=clang++
export CXXFLAGS="-std=c++14 -stdlib=libc++"
export LDFLAGS="-stdlib=libc++"
make -C build.makefiles

# Run the unit tests
build.makefiles/out/Release/unittest

Build and run the unit tests on Mac OS X

To run all unit tests, use:

# Generating Xcode project files
python tools/gyp.py test/FrameworkTest/unittest.gyp -f xcode

# Compiling source code
xcodebuild -project build.xcodefiles/test/FrameworkTest/unittest.xcodeproj

# Run the unit tests
test/FrameworkTest/build/Release/unittest

Build and run the unit tests on Windows

1. Generate project files

PowerShell

python tools\gyp\gyp_main.py test/FrameworkTest/unittest.gyp `
  --depth=. -f msvs -G msvs_version=2017 --generator-output=build.msvs

Git Bash (MinGW)

python tools/gyp/gyp_main.py test/FrameworkTest/unittest.gyp \
  --depth=. -f msvs -G msvs_version=2017 --generator-output=build.msvs

2. Build using MSBuild

PowerShell

$msbuild = "${env:ProgramFiles(x86)}\MSBuild\15.0\Bin\MSBuild.exe"
$solution = 'build.msvs\test\FrameworkTest\unittest.sln'
$options = '/t:Build', '/p:Configuration=Release'
& $msbuild $solution $options

Git Bash (MinGW)

export MSBUILD="/c/Program Files (x86)/MSBuild/15.0/Bin/MSBuild.exe"
"$MSBUILD" build.msvs/test/FrameworkTest/unittest.sln -t:Build -p:Configuration=Release

3. Run

To run all unit tests, use:

PowerShell

build.msvs\test\FrameworkTest\Release\unittest

Git Bash (MinGW)

build.msvs/test/FrameworkTest/Release/unittest.exe