Commit eba396cc by Ben Clayton

Rename 'unittests' to 'gles-unittest'

Now that we have vk-unittests, it makes sense to prefix unittests by their API name. Fixes a couple of TODOs Change-Id: I57234d6b19c3dd4f130b211a0be4e604613b8cd8 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28399 Presubmit-Ready: Ben Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent edab510d
...@@ -22,7 +22,7 @@ script: ...@@ -22,7 +22,7 @@ script:
- mkdir -p build && cd build - mkdir -p build && cd build
- cmake -DREACTOR_BACKEND=$REACTOR_BACKEND .. - cmake -DREACTOR_BACKEND=$REACTOR_BACKEND ..
- make -j2 - make -j2
- ./unittests - ./gles-unittests
- ./ReactorUnitTests - ./ReactorUnitTests
notifications: notifications:
......
...@@ -2359,36 +2359,35 @@ if(BUILD_TESTS) ...@@ -2359,36 +2359,35 @@ if(BUILD_TESTS)
endif() endif()
endif() endif()
# GLES unit tests. TODO: Rename 'unittests' to 'gles-unittests'?
if(BUILD_TESTS) if(BUILD_TESTS)
set(UNITTESTS_LIST set(GLES_UNITTESTS_LIST
${CMAKE_CURRENT_SOURCE_DIR}/tests/GLESUnitTests/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/GLESUnitTests/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/GLESUnitTests/unittests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/GLESUnitTests/unittests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/src/gtest-all.cc ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/src/gtest-all.cc
) )
set(UNITTESTS_INCLUDE_DIR set(GLES_UNITTESTS_INCLUDE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/include/ ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/include/
${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googlemock/include/ ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googlemock/include/
${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/ ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/
${CMAKE_CURRENT_SOURCE_DIR}/include/ ${CMAKE_CURRENT_SOURCE_DIR}/include/
) )
add_executable(unittests ${UNITTESTS_LIST}) add_executable(gles-unittests ${GLES_UNITTESTS_LIST})
set_target_properties(unittests PROPERTIES set_target_properties(gles-unittests PROPERTIES
INCLUDE_DIRECTORIES "${UNITTESTS_INCLUDE_DIR}" INCLUDE_DIRECTORIES "${GLES_UNITTESTS_INCLUDE_DIR}"
FOLDER "Tests" FOLDER "Tests"
COMPILE_DEFINITIONS "STANDALONE" COMPILE_DEFINITIONS "STANDALONE"
) )
target_link_libraries(unittests libEGL libGLESv2 ${OS_LIBS}) target_link_libraries(gles-unittests libEGL libGLESv2 ${OS_LIBS})
if(ANDROID) if(ANDROID)
target_link_libraries(unittests -landroid) target_link_libraries(gles-unittests -landroid)
endif() endif()
endif() endif()
if(BUILD_TESTS AND BUILD_VULKAN) if(BUILD_TESTS AND BUILD_VULKAN)
set(UNITTESTS_LIST set(VK_UNITTESTS_LIST
${CMAKE_CURRENT_SOURCE_DIR}/tests/VulkanUnitTests/Device.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/VulkanUnitTests/Device.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/VulkanUnitTests/Driver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/VulkanUnitTests/Driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/VulkanUnitTests/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/VulkanUnitTests/main.cpp
...@@ -2396,7 +2395,7 @@ if(BUILD_TESTS AND BUILD_VULKAN) ...@@ -2396,7 +2395,7 @@ if(BUILD_TESTS AND BUILD_VULKAN)
${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/src/gtest-all.cc ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/src/gtest-all.cc
) )
set(UNITTESTS_INCLUDE_DIR set(VK_UNITTESTS_INCLUDE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/include/ ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/include/
${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googlemock/include/ ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googlemock/include/
${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/ ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/
...@@ -2404,9 +2403,9 @@ if(BUILD_TESTS AND BUILD_VULKAN) ...@@ -2404,9 +2403,9 @@ if(BUILD_TESTS AND BUILD_VULKAN)
${CMAKE_CURRENT_SOURCE_DIR}/include/ ${CMAKE_CURRENT_SOURCE_DIR}/include/
) )
add_executable(vk-unittests ${UNITTESTS_LIST}) add_executable(vk-unittests ${VK_UNITTESTS_LIST})
set_target_properties(vk-unittests PROPERTIES set_target_properties(vk-unittests PROPERTIES
INCLUDE_DIRECTORIES "${UNITTESTS_INCLUDE_DIR}" INCLUDE_DIRECTORIES "${VK_UNITTESTS_INCLUDE_DIR}"
FOLDER "Tests" FOLDER "Tests"
COMPILE_DEFINITIONS "STANDALONE" COMPILE_DEFINITIONS "STANDALONE"
) )
......
...@@ -25,7 +25,7 @@ Android and Chrome (OS) build environments are also supported. ...@@ -25,7 +25,7 @@ Android and Chrome (OS) build environments are also supported.
cmake .. cmake ..
make --jobs=8 make --jobs=8
./unittests ./gles-unittests
./OGLES2HelloAPI ./OGLES2HelloAPI
Usage Usage
......
...@@ -169,9 +169,9 @@ ...@@ -169,9 +169,9 @@
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<CopyToOutputDirectory>Never</CopyToOutputDirectory> <CopyToOutputDirectory>Never</CopyToOutputDirectory>
</ProjectReference> </ProjectReference>
<ProjectReference Include="$(SolutionDir)build\Visual Studio 15 2017 Win64\unittests.vcxproj"> <ProjectReference Include="$(SolutionDir)build\Visual Studio 15 2017 Win64\gles-unittests.vcxproj">
<Project>{BC5A59A0-B151-32E5-9090-B06A8D88F902}</Project> <Project>{BC5A59A0-B151-32E5-9090-B06A8D88F902}</Project>
<Name>unittests</Name> <Name>gles-unittests</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<CopyToOutputDirectory>Never</CopyToOutputDirectory> <CopyToOutputDirectory>Never</CopyToOutputDirectory>
</ProjectReference> </ProjectReference>
......
...@@ -193,7 +193,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spirv-tools-vimsyntax", "th ...@@ -193,7 +193,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spirv-tools-vimsyntax", "th
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unittests", "unittests.vcxproj", "{BC5A59A0-B151-32E5-9090-B06A8D88F902}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gles-unittests", "gles-unittests.vcxproj", "{BC5A59A0-B151-32E5-9090-B06A8D88F902}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{B81F13DD-ACFB-3AB7-A071-3AD849D68E5C} = {B81F13DD-ACFB-3AB7-A071-3AD849D68E5C} {B81F13DD-ACFB-3AB7-A071-3AD849D68E5C} = {B81F13DD-ACFB-3AB7-A071-3AD849D68E5C}
{2EA2C687-489E-32F2-8D89-B90620301359} = {2EA2C687-489E-32F2-8D89-B90620301359} {2EA2C687-489E-32F2-8D89-B90620301359} = {2EA2C687-489E-32F2-8D89-B90620301359}
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<Platform>x64</Platform> <Platform>x64</Platform>
<ProjectName>unittests</ProjectName> <ProjectName>gles-unittests</ProjectName>
<VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName> <VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
<PropertyGroup> <PropertyGroup>
<_ProjectFileVersion>10.0.20506.1</_ProjectFileVersion> <_ProjectFileVersion>10.0.20506.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)build\Visual Studio 15 2017 Win64\Debug\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)build\Visual Studio 15 2017 Win64\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">unittests.dir\Debug\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">gles-unittests.dir\Debug\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">unittests</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">gles-unittests</TargetName>
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.exe</TargetExt> <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.exe</TargetExt>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)build\Visual Studio 15 2017 Win64\Release\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)build\Visual Studio 15 2017 Win64\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">unittests.dir\Release\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">gles-unittests.dir\Release\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">unittests</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">gles-unittests</TargetName>
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.exe</TargetExt> <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.exe</TargetExt>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
<AdditionalOptions>%(AdditionalOptions) /machine:x64</AdditionalOptions> <AdditionalOptions>%(AdditionalOptions) /machine:x64</AdditionalOptions>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ImportLibrary>$(SolutionDir)build/Visual Studio 15 2017 Win64/Debug/unittests.lib</ImportLibrary> <ImportLibrary>$(SolutionDir)build/Visual Studio 15 2017 Win64/Debug/gles-unittests.lib</ImportLibrary>
<ProgramDataBaseFile>$(SolutionDir)build/Visual Studio 15 2017 Win64/Debug/unittests.pdb</ProgramDataBaseFile> <ProgramDataBaseFile>$(SolutionDir)build/Visual Studio 15 2017 Win64/Debug/gles-unittests.pdb</ProgramDataBaseFile>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
</Link> </Link>
<ProjectReference> <ProjectReference>
...@@ -136,8 +136,8 @@ ...@@ -136,8 +136,8 @@
<AdditionalOptions>%(AdditionalOptions) /machine:x64</AdditionalOptions> <AdditionalOptions>%(AdditionalOptions) /machine:x64</AdditionalOptions>
<GenerateDebugInformation>false</GenerateDebugInformation> <GenerateDebugInformation>false</GenerateDebugInformation>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ImportLibrary>$(SolutionDir)build/Visual Studio 15 2017 Win64/Release/unittests.lib</ImportLibrary> <ImportLibrary>$(SolutionDir)build/Visual Studio 15 2017 Win64/Release/gles-unittests.lib</ImportLibrary>
<ProgramDataBaseFile>$(SolutionDir)build/Visual Studio 15 2017 Win64/Release/unittests.pdb</ProgramDataBaseFile> <ProgramDataBaseFile>$(SolutionDir)build/Visual Studio 15 2017 Win64/Release/gles-unittests.pdb</ProgramDataBaseFile>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
</Link> </Link>
<ProjectReference> <ProjectReference>
......
...@@ -17,9 +17,8 @@ make --jobs=$(nproc) ...@@ -17,9 +17,8 @@ make --jobs=$(nproc)
# Run the reactor unit tests. # Run the reactor unit tests.
./ReactorUnitTests ./ReactorUnitTests
# Run the GLES unit tests. TODO(capn): rename. cd .. # Tests must be run from project root
./unittests
# Run the Vulkan unit tests. # Run the OpenGL ES and Vulkan unit tests.
cd .. # Must be run from project root build/gles-unittests
build/vk-unittests build/vk-unittests
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