Commit 0b3d56aa by Alexis Hetu Committed by Alexis Hétu

Vulkan unit tests

Added small Vulkan unit tests: 1) Checks that all API functions are present 2) Verifies a few Physical Device properties The tests are currently only for Visual Studio, but should be easily ported to other platforms, as the code is similar to the GLES unit tests. Change-Id: Idb45d26734be80e352ba91544e6331c1192f9f3e Reviewed-on: https://swiftshader-review.googlesource.com/c/21648Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent d16a5041
......@@ -260,6 +260,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Vulkan", "src\Vulkan\vulkan
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactorUnitTests", "src\Reactor\ReactorUnitTests.vcxproj", "{4EC107AB-89E8-4A0B-8366-B3E81085AE07}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VulkanUnitTests", "tests\VulkanUnitTests\VulkanUnitTests.vcxproj", "{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
......@@ -783,6 +785,18 @@ Global
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Release|Win32.Build.0 = Release|Win32
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Release|x64.ActiveCfg = Release|x64
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Release|x64.Build.0 = Release|x64
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Debug|Win32.ActiveCfg = Debug|Win32
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Debug|Win32.Build.0 = Debug|Win32
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Debug|x64.ActiveCfg = Debug|x64
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Debug|x64.Build.0 = Debug|x64
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Profile|Win32.ActiveCfg = Release|Win32
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Profile|Win32.Build.0 = Release|Win32
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Profile|x64.ActiveCfg = Release|x64
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Profile|x64.Build.0 = Release|x64
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Release|Win32.ActiveCfg = Release|Win32
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Release|Win32.Build.0 = Release|Win32
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Release|x64.ActiveCfg = Release|x64
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -825,6 +839,7 @@ Global
{CF8EBC89-8762-49DC-9440-6C82B3499913} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{FBDCFF88-0CE1-43C3-B694-8F45946FAFE3} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{4EC107AB-89E8-4A0B-8366-B3E81085AE07} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{16E1EBC1-BB6B-4A82-A1A3-5A69AC8D58FE} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4DF423D2-8425-48A7-9CEC-835C4C3CA957}
......
// Copyright 2017 The SwiftShader Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SWIFTSHADER_TEST_H_
#define SWIFTSHADER_TEST_H_
#include <gtest/gtest.h>
class SwiftShaderTestEnvironment : public testing::Environment {
public:
void SetUp() override {}
void TearDown() override {}
};
#endif // SWIFTSHADER_TEST_H_
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\third_party\googletest\googletest\src\gtest-all.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="unittests.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerEnvironment>PATH=$(SolutionDir)out\$(Configuration)_$(Platform)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>--gtest_break_on_failure --gtest_filter=*</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerEnvironment>PATH=$(SolutionDir)out\$(Configuration)_$(Platform)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerEnvironment>PATH=$(SolutionDir)out\$(Configuration)_$(Platform)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>--gtest_break_on_failure --gtest_filter=*</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerEnvironment>PATH=$(SolutionDir)out\$(Configuration)_$(Platform)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
// Copyright 2017 The SwiftShader Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "gtest/gtest.h"
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment