Skip to content
Chuck Walbourn edited this page Oct 14, 2024 · 35 revisions

This is a repository for the test suite for DirectX Tool Kit for DirectX 11 on GitHub.

Setup

  • Install git
  • Install and initialize git-LFS
  • Install CMake, Ninja, and MSVC or clang/LLVM for Windows
git clone https://github.com/Microsoft/DirectXTK.git
cd DirectXTK
git clone https://github.com/walbourn/directxtktest.git Tests
git clone https://github.com/Microsoft/DirectXTK.wiki.git wiki

Optionally some tests can also consume extra test image files from DirectXTex.

git clone https://github.com/walbourn/directxtexmedia.git  (requires git-LFS)

Create an environment variable DIRECTXTEX_MEDIA_PATH to point to the clone of directxtexmedia.

Running tests

CTest is supported

cd DirectXTK
cmake --preset=x64-Debug
cmake build out\build\x64-Debug
ctest --preset=x64-Debug

Coverage

DirectXTK_Tests_Desktop_2015, DirectXTK_Tests_Desktop_2017, DirectXTK_Tests_Desktop_2019

These cover the entire library for Windows desktop (aka Windows classic) including DirectXTK for Audio using XAudio 2.8.

DirectXTK_Tests_Desktop_2015_DXSDK, DirectXTK_Tests_Desktop_2017_DXSDK

These cover just DirectXTK for Audio using XAudio 2.7 for down-level support on Windows 7 which requires the legacy DirectX SDK to build, and the legacy DXSETUP to deploy the required DLL.

DirectXTK_Tests_Desktop_2015_Win10, DirectXTK_Tests_Desktop_2017_Win10, DirectXTK_Tests_Desktop_2019_Win10

This covers the GamePad component which uses the Windows 10 Windows.Gaming.Input WinRT API, as well as DirectXTK for Audio using XAudio 2.9 for Windows desktop (aka Windows classic).

DirectXTK_Tests_Windows10

This covers GamePad, Keyboard, and Mouse when using the WinRT APIs as well as graphics components for Universal Windows Platform (UWP) apps.

When using UWP on Xbox One, it's recommended you set the option Treat UWP apps as games by default in the Device Portal for your development & testing Xbox One consoles. See this blog post for more information.

Xbox One

This repo does contains the Xbox One XDK test artifacts, but building them requires access to the Xbox One XDK. See the wiki for details on building the required shaders.

They are built using individual x_XboxOneXDK_2015.sln / x_XboxOneXDK_2017.sln files. Note also that the 2015 and 2017 versions use the same intermediate file folders so you should only build one set or the other.

Command line options

The PC versions of the test suite support the following command-line switches:

  • -forcewarp Forces the use of the WARP software device. Normally this only gets used as a fallback if no hardware is found.

  • -minpower When run on Windows 10 April 2018 Update (Version 1803) and built using VS 2017 (15.7 update) with the Windows 10 SDK (17134), the test suite will prefer the use of DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE devices by default. If this switch is provided, then it will prefer the use of DXGI_GPU_PREFERENCE_MINIMUM_POWER instead. This primarily impacts hybrid graphics systems to force selection between AMD/NVIDIA and Intel Integrated devices.

  • -adapter:n Forces the use of a particular adapter at index n (0-based). If the adapter index is invalid, you'll end up with WARP.

Cleanup

The UWP tests are all deployed for testing, and will remain on your system until they are uninstalled. To remove them, you can use the following PowerShell script:

$directxtktests = @(
"db4076ae-14fb-4c16-95ea-b2894887ac6d",
"c8bf4ff0-2f8a-4254-9356-aa8f45ad8c7c",
"e18bb61b-c11e-4ac3-ba58-2d4abb4155fd",
"77504466-b4c0-44e3-a797-9bfc13334e85",
"ce2cb3e1-7586-4694-8623-672cc2988d7d",
"61adde96-80cc-4f86-95ae-40ac6659ac10",
"0978a727-17ec-42c5-b68d-8550f48717ea",
"8835D5FF-EA1B-40E0-A18E-5452E3E1EA69",
"64489900-f70d-4518-a754-30beeebc31cf",
"ff9f715c-e259-4e24-bdaa-bade5c02a44f",
"32F232AC-394B-4B7E-AF4E-F70084420491",
"3490dfd2-c964-4984-9a13-54d5697d971a",
"472ff739-cad7-4812-9a22-da579bfca412",
"251dee54-249d-41e0-8a41-90541f93dc40",
"2dc42269-b4ba-4b88-b7cf-6a8528a3792e",
"6eea623d-853c-4713-b7f2-22b44c877554",
"e3dbe4dc-54a3-4978-afe6-7bf1c27f0f41",
"eb13bc35-651b-406c-95bf-bc3c35c9b053",
"599ce94d-393a-471a-8511-4c6217ae6cc4"	
)
$directxtktests | % { Get-AppxPackage -Name $_ } | Remove-AppxPackage