Commit 157ddfdc by Shahbaz Youssefi Committed by Commit Bot

Build compiler_tests only if GLSL or ESSL build is enabled

Most of these tests use TranslatorGLSL or TranslatorESSL (often through ShaderCompileTreeTest). In specialized builds that disable GLSL and ESSL shader generation, disable these unit tests. Bug: chromium:1161513 Change-Id: Ib87e651706f141a41ffdaebfb0cbe5168582e341 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2613202Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent acdb63b8
...@@ -119,12 +119,11 @@ angle_test("angle_system_info_test") { ...@@ -119,12 +119,11 @@ angle_test("angle_system_info_test") {
angle_test("angle_unittests") { angle_test("angle_unittests") {
sources = angle_unittests_sources + [ "angle_unittest_main.cpp" ] sources = angle_unittests_sources + [ "angle_unittest_main.cpp" ]
if (angle_enable_essl) { # Compiler tests frequently require either TranslatorGLSL or TranslatorESSL. Build them only if
sources += angle_unittests_essl_sources # both are enabled.
} if (angle_enable_essl && angle_enable_glsl) {
sources += angle_unittests_compiler_tests_sources
if (angle_enable_glsl) {
sources += angle_unittests_glsl_sources
if (is_apple) { if (is_apple) {
sources += angle_unittests_glsl_mac_sources sources += angle_unittests_glsl_mac_sources
} }
......
...@@ -49,6 +49,33 @@ angle_unittests_sources = [ ...@@ -49,6 +49,33 @@ angle_unittests_sources = [
"../libANGLE/renderer/TransformFeedbackImpl_mock.h", "../libANGLE/renderer/TransformFeedbackImpl_mock.h",
"../libANGLE/renderer/serial_utils_unittest.cpp", "../libANGLE/renderer/serial_utils_unittest.cpp",
"angle_unittests_utils.h", "angle_unittests_utils.h",
"preprocessor_tests/MockDiagnostics.h",
"preprocessor_tests/MockDirectiveHandler.h",
"preprocessor_tests/PreprocessorTest.cpp",
"preprocessor_tests/PreprocessorTest.h",
"preprocessor_tests/char_test.cpp",
"preprocessor_tests/comment_test.cpp",
"preprocessor_tests/define_test.cpp",
"preprocessor_tests/error_test.cpp",
"preprocessor_tests/extension_test.cpp",
"preprocessor_tests/identifier_test.cpp",
"preprocessor_tests/if_test.cpp",
"preprocessor_tests/input_test.cpp",
"preprocessor_tests/location_test.cpp",
"preprocessor_tests/number_test.cpp",
"preprocessor_tests/operator_test.cpp",
"preprocessor_tests/pragma_test.cpp",
"preprocessor_tests/space_test.cpp",
"preprocessor_tests/token_test.cpp",
"preprocessor_tests/version_test.cpp",
"test_expectations/GPUTestExpectationsParser_unittest.cpp",
"test_utils/ShaderExtensionTest.h",
"test_utils/angle_test_instantiate.h",
"test_utils/compiler_test.cpp",
"test_utils/compiler_test.h",
]
angle_unittests_compiler_tests_sources = [
"compiler_tests/API_test.cpp", "compiler_tests/API_test.cpp",
"compiler_tests/APPLE_clip_distance_test.cpp", "compiler_tests/APPLE_clip_distance_test.cpp",
"compiler_tests/ARB_texture_rectangle_test.cpp", "compiler_tests/ARB_texture_rectangle_test.cpp",
...@@ -92,6 +119,8 @@ angle_unittests_sources = [ ...@@ -92,6 +119,8 @@ angle_unittests_sources = [
"compiler_tests/PruneUnusedFunctions_test.cpp", "compiler_tests/PruneUnusedFunctions_test.cpp",
"compiler_tests/QualificationOrderESSL31_test.cpp", "compiler_tests/QualificationOrderESSL31_test.cpp",
"compiler_tests/QualificationOrder_test.cpp", "compiler_tests/QualificationOrder_test.cpp",
"compiler_tests/RecordConstantPrecision_test.cpp",
"compiler_tests/RegenerateStructNames_test.cpp",
"compiler_tests/RemovePow_test.cpp", "compiler_tests/RemovePow_test.cpp",
"compiler_tests/RemoveUnreferencedVariables_test.cpp", "compiler_tests/RemoveUnreferencedVariables_test.cpp",
"compiler_tests/SamplerMultisample_test.cpp", "compiler_tests/SamplerMultisample_test.cpp",
...@@ -105,64 +134,33 @@ angle_unittests_sources = [ ...@@ -105,64 +134,33 @@ angle_unittests_sources = [
"compiler_tests/TypeTracking_test.cpp", "compiler_tests/TypeTracking_test.cpp",
"compiler_tests/Type_test.cpp", "compiler_tests/Type_test.cpp",
"compiler_tests/VariablePacker_test.cpp", "compiler_tests/VariablePacker_test.cpp",
"compiler_tests/VectorizeVectorScalarArithmetic_test.cpp",
"compiler_tests/WorkGroupSize_test.cpp", "compiler_tests/WorkGroupSize_test.cpp",
"preprocessor_tests/MockDiagnostics.h",
"preprocessor_tests/MockDirectiveHandler.h",
"preprocessor_tests/PreprocessorTest.cpp",
"preprocessor_tests/PreprocessorTest.h",
"preprocessor_tests/char_test.cpp",
"preprocessor_tests/comment_test.cpp",
"preprocessor_tests/define_test.cpp",
"preprocessor_tests/error_test.cpp",
"preprocessor_tests/extension_test.cpp",
"preprocessor_tests/identifier_test.cpp",
"preprocessor_tests/if_test.cpp",
"preprocessor_tests/input_test.cpp",
"preprocessor_tests/location_test.cpp",
"preprocessor_tests/number_test.cpp",
"preprocessor_tests/operator_test.cpp",
"preprocessor_tests/pragma_test.cpp",
"preprocessor_tests/space_test.cpp",
"preprocessor_tests/token_test.cpp",
"preprocessor_tests/version_test.cpp",
"test_expectations/GPUTestExpectationsParser_unittest.cpp",
"test_utils/ConstantFoldingTest.cpp", "test_utils/ConstantFoldingTest.cpp",
"test_utils/ConstantFoldingTest.h", "test_utils/ConstantFoldingTest.h",
"test_utils/ShaderCompileTreeTest.cpp", "test_utils/ShaderCompileTreeTest.cpp",
"test_utils/ShaderCompileTreeTest.h", "test_utils/ShaderCompileTreeTest.h",
"test_utils/ShaderExtensionTest.h",
"test_utils/angle_test_instantiate.h",
"test_utils/compiler_test.cpp",
"test_utils/compiler_test.h",
] ]
angle_unittests_essl_sources =
[ "compiler_tests/RecordConstantPrecision_test.cpp" ]
angle_unittests_glsl_sources =
[ "compiler_tests/VectorizeVectorScalarArithmetic_test.cpp" ]
angle_unittests_glsl_mac_sources = [ angle_unittests_glsl_mac_sources = [
"compiler_tests/RegenerateStructNames_test.cpp",
"compiler_tests/RewriteDoWhile_test.cpp", "compiler_tests/RewriteDoWhile_test.cpp",
"compiler_tests/UnfoldShortCircuitAST_test.cpp", "compiler_tests/UnfoldShortCircuitAST_test.cpp",
] ]
# TODO(jmadill): should probably call this windows sources # TODO(jmadill): should probably call this windows sources
angle_unittests_hlsl_sources = [ angle_unittests_hlsl_sources = [
"../tests/compiler_tests/HLSLOutput_test.cpp", "compiler_tests/HLSLOutput_test.cpp",
"../tests/compiler_tests/UnrollFlatten_test.cpp", "compiler_tests/UnrollFlatten_test.cpp",
] ]
if (is_android) { if (is_android) {
angle_unittests_sources += angle_unittests_sources +=
[ "../tests/compiler_tests/ImmutableString_test_ESSL_autogen.cpp" ] [ "compiler_tests/ImmutableString_test_ESSL_autogen.cpp" ]
} else { } else {
angle_unittests_sources += angle_unittests_sources +=
[ "../tests/compiler_tests/ImmutableString_test_autogen.cpp" ] [ "compiler_tests/ImmutableString_test_autogen.cpp" ]
} }
if (!is_android && !is_fuchsia) { if (!is_android && !is_fuchsia) {
angle_unittests_sources += angle_unittests_sources += [ "test_utils/runner/TestSuite_unittest.cpp" ]
[ "../tests/test_utils/runner/TestSuite_unittest.cpp" ]
} }
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "GLSLANG/ShaderLang.h" #include "GLSLANG/ShaderLang.h"
#include "angle_gl.h" #include "angle_gl.h"
#include "compiler/translator/BaseTypes.h" #include "compiler/translator/BaseTypes.h"
#include "compiler/translator/TranslatorESSL.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "tests/test_utils/ShaderCompileTreeTest.h" #include "tests/test_utils/ShaderCompileTreeTest.h"
#include "tests/test_utils/compiler_test.h" #include "tests/test_utils/compiler_test.h"
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "GLSLANG/ShaderLang.h" #include "GLSLANG/ShaderLang.h"
#include "angle_gl.h" #include "angle_gl.h"
#include "compiler/translator/TranslatorESSL.h"
#include "tests/test_utils/ShaderCompileTreeTest.h" #include "tests/test_utils/ShaderCompileTreeTest.h"
#include "tests/test_utils/compiler_test.h" #include "tests/test_utils/compiler_test.h"
......
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