Commit 2f7fc0f3 by Jamie Madill Committed by Commit Bot

Tests: Remove standalone duplication.

Also cleans up some compiler warnings that crept in because of how we structured the test sources in GN. We also no longer need special handling for the test "main" files. Must land after http://crrev.com/c/2495003 rolls into ANGLE. Bug: angleproject:5124 Change-Id: I43ff91b5c8f00214886cd8ac2403702e5026a840 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2495281Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 4953f03d
...@@ -193,21 +193,19 @@ set_defaults("angle_static_library") { ...@@ -193,21 +193,19 @@ set_defaults("angle_static_library") {
} }
set_defaults("angle_test") { set_defaults("angle_test") {
configs = []
# Gtest itself can't pass all the strict warning filters. # Gtest itself can't pass all the strict warning filters.
public_configs = angle_common_configs - [ configs = angle_common_configs - [
"$angle_root:constructor_and_destructor_warnings", "$angle_root:constructor_and_destructor_warnings",
"$angle_root:extra_warnings", "$angle_root:extra_warnings",
] ]
public_configs = []
public_deps = [] public_deps = []
sources = [] sources = []
data = [] data = []
defines = [] defines = []
deps = [] deps = []
data_deps = [] data_deps = []
main = ""
suppressed_configs = angle_remove_configs suppressed_configs = angle_remove_configs
} }
...@@ -291,102 +289,52 @@ template("angle_static_library") { ...@@ -291,102 +289,52 @@ template("angle_static_library") {
} }
template("angle_test") { template("angle_test") {
_lib = target_name + "_lib" test(target_name) {
angle_source_set(_lib) {
testonly = true
forward_variables_from(invoker, forward_variables_from(invoker,
"*", "*",
[ [
"deps", "configs",
"manifest", "data",
"use_xvfb", "public_deps",
]) ])
if (is_android) { configs += invoker.configs
public_configs += [ "$angle_root:build_id_config" ] configs -= invoker.suppressed_configs
}
public_deps += invoker.deps + [ public_deps = invoker.public_deps + [
"$angle_root:angle_common", "$angle_root:angle_common",
"$angle_root:includes", "$angle_root:includes",
"$angle_root/third_party/rapidjson:rapidjson",
"$angle_root/util:angle_test_utils", "$angle_root/util:angle_test_utils",
"$angle_root/third_party/rapidjson:rapidjson",
"//testing/gmock", "//testing/gmock",
"//testing/gtest", "//testing/gtest",
"//third_party/googletest:gmock", "//third_party/googletest:gmock",
"//third_party/googletest:gtest", "//third_party/googletest:gtest",
] ]
sources += [
"$angle_root/src/tests/test_utils/runner/TestSuite.cpp",
"$angle_root/src/tests/test_utils/runner/TestSuite.h",
]
}
# TODO(jmadill): Remove duplication. http://anglebug.com/5124
if (build_with_chromium) {
test("standalone_" + target_name) {
if ((is_linux && !is_chromeos) ||
(build_with_chromium && chromeos_is_browser_only)) {
use_xvfb = true
}
public_deps = [ ":${_lib}" ]
if (invoker.main != "") {
sources = [ "${invoker.main}.cpp" ]
}
data = invoker.data + [ data = invoker.data + [
"$angle_root/scripts/run_gtest_angle_test.py", "$angle_root/scripts/run_gtest_angle_test.py",
"//testing/scripts/common.py", "//testing/scripts/common.py",
"//testing/xvfb.py", "//testing/xvfb.py",
] ]
if ((is_linux || is_chromeos) && !is_component_build) { sources += [
# Set rpath to find shared libs in a non-component build. "$angle_root/src/tests/test_utils/runner/TestSuite.cpp",
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] "$angle_root/src/tests/test_utils/runner/TestSuite.h",
} ]
if (defined(invoker.manifest)) {
manifest = invoker.manifest
}
if (is_android) {
if (build_with_chromium) {
use_native_activity = true
configs -= [ "//build/config/android:hide_all_but_jni" ]
} else {
use_raw_android_executable = true
}
}
}
}
test(target_name) {
if ((is_linux && !is_chromeos) || if ((is_linux && !is_chromeos) ||
(build_with_chromium && chromeos_is_browser_only)) { (build_with_chromium && chromeos_is_browser_only)) {
use_xvfb = true use_xvfb = true
} }
public_deps = [ ":${_lib}" ]
if (invoker.main != "") {
sources = [ "${invoker.main}.cpp" ]
}
data = invoker.data + [
"$angle_root/scripts/run_gtest_angle_test.py",
"//testing/scripts/common.py",
"//testing/xvfb.py",
]
if ((is_linux || is_chromeos) && !is_component_build) { if ((is_linux || is_chromeos) && !is_component_build) {
# Set rpath to find shared libs in a non-component build. # Set rpath to find shared libs in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
} }
if (defined(invoker.manifest)) {
manifest = invoker.manifest
}
if (is_android) { if (is_android) {
public_configs += [ "$angle_root:build_id_config" ]
if (build_with_chromium) { if (build_with_chromium) {
use_native_activity = true use_native_activity = true
configs -= [ "//build/config/android:hide_all_but_jni" ] configs -= [ "//build/config/android:hide_all_but_jni" ]
......
...@@ -23,8 +23,6 @@ angle_test("test_utils_unittest_helper") { ...@@ -23,8 +23,6 @@ angle_test("test_utils_unittest_helper") {
"test_utils/angle_test_instantiate.h", "test_utils/angle_test_instantiate.h",
"test_utils/runner/TestSuite_unittest.cpp", "test_utils/runner/TestSuite_unittest.cpp",
] ]
deps = [ "$angle_root:angle_common" ]
} }
test_expectations_sources = [ test_expectations_sources = [
...@@ -118,8 +116,7 @@ angle_test("angle_system_info_test") { ...@@ -118,8 +116,7 @@ angle_test("angle_system_info_test") {
} }
angle_test("angle_unittests") { angle_test("angle_unittests") {
sources = angle_unittests_sources sources = angle_unittests_sources + [ "angle_unittest_main.cpp" ]
main = "angle_unittest_main"
if (angle_enable_hlsl) { if (angle_enable_hlsl) {
sources += angle_unittests_hlsl_sources sources += angle_unittests_hlsl_sources
...@@ -149,8 +146,7 @@ if (is_win || is_linux || is_chromeos || is_mac || is_android || is_fuchsia) { ...@@ -149,8 +146,7 @@ if (is_win || is_linux || is_chromeos || is_mac || is_android || is_fuchsia) {
angle_test("angle_end2end_tests") { angle_test("angle_end2end_tests") {
include_dirs = [ "." ] include_dirs = [ "." ]
sources = angle_end2end_tests_sources sources = angle_end2end_tests_sources + [ "angle_end2end_tests_main.cpp" ]
main = "angle_end2end_tests_main"
libs = [] libs = []
if (is_mac) { if (is_mac) {
...@@ -205,8 +201,7 @@ if (is_win || is_linux || is_chromeos || is_mac || is_android) { ...@@ -205,8 +201,7 @@ if (is_win || is_linux || is_chromeos || is_mac || is_android) {
angle_test("angle_white_box_tests") { angle_test("angle_white_box_tests") {
include_dirs = [ "." ] include_dirs = [ "." ]
sources = angle_white_box_tests_sources sources = angle_white_box_tests_sources + [ "angle_end2end_tests_main.cpp" ]
main = "angle_end2end_tests_main"
if (is_win && angle_enable_d3d11) { if (is_win && angle_enable_d3d11) {
sources += angle_white_box_tests_win_sources sources += angle_white_box_tests_win_sources
...@@ -270,8 +265,8 @@ if (is_win || is_linux || is_chromeos || is_android || is_mac) { ...@@ -270,8 +265,8 @@ if (is_win || is_linux || is_chromeos || is_android || is_mac) {
# This test suite is for perf tests that use ANGLE's internals in some direct way. # This test suite is for perf tests that use ANGLE's internals in some direct way.
angle_test("angle_white_box_perftests") { angle_test("angle_white_box_perftests") {
include_dirs = [ "." ] include_dirs = [ "." ]
sources = angle_white_box_perf_tests_sources sources =
main = "angle_perftests_main" angle_white_box_perf_tests_sources + [ "angle_perftests_main.cpp" ]
deps = [ deps = [
":angle_perftests_static", ":angle_perftests_static",
...@@ -321,8 +316,7 @@ if (build_angle_perftests) { ...@@ -321,8 +316,7 @@ if (build_angle_perftests) {
# This test suite is designed to run against a generic GL implementation. # This test suite is designed to run against a generic GL implementation.
angle_test("angle_perftests") { angle_test("angle_perftests") {
include_dirs = [ "." ] include_dirs = [ "." ]
sources = angle_perf_tests_sources sources = angle_perf_tests_sources + [ "angle_perftests_main.cpp" ]
main = "angle_perftests_main"
deps = [ deps = [
":angle_perftests_shared", ":angle_perftests_shared",
...@@ -572,11 +566,11 @@ if (build_angle_gles1_conform_tests) { ...@@ -572,11 +566,11 @@ if (build_angle_gles1_conform_tests) {
include_dirs = [ "." ] include_dirs = [ "." ]
sources = [ sources = [
"angle_end2end_tests_main.cpp",
"gles1_conformance_tests/ConformanceTests.cpp", "gles1_conformance_tests/ConformanceTests.cpp",
"test_utils/ANGLETest.cpp", "test_utils/ANGLETest.cpp",
"test_utils/ANGLETest.h", "test_utils/ANGLETest.h",
] ]
main = "angle_end2end_tests_main"
configs += [ configs += [
"${angle_root}:libANGLE_config", "${angle_root}:libANGLE_config",
...@@ -650,11 +644,11 @@ if (build_angle_gles1_conform_tests) { ...@@ -650,11 +644,11 @@ if (build_angle_gles1_conform_tests) {
sources = [ sources = [
"$gles1_conform_root/conform/covgl/shell.c", "$gles1_conform_root/conform/covgl/shell.c",
"angle_end2end_tests_main.cpp",
"gles1_conformance_tests/CovglTests.cpp", "gles1_conformance_tests/CovglTests.cpp",
"test_utils/ANGLETest.cpp", "test_utils/ANGLETest.cpp",
"test_utils/ANGLETest.h", "test_utils/ANGLETest.h",
] ]
main = "angle_end2end_tests_main"
configs += [ configs += [
":angle_gles1_conform_support", ":angle_gles1_conform_support",
...@@ -721,11 +715,11 @@ if (build_angle_gles1_conform_tests) { ...@@ -721,11 +715,11 @@ if (build_angle_gles1_conform_tests) {
include_dirs = [ "$gles1_conform_root/conform" ] include_dirs = [ "$gles1_conform_root/conform" ]
sources = [ sources = [
"angle_end2end_tests_main.cpp",
"gles1_conformance_tests/PrimtestTests.cpp", "gles1_conformance_tests/PrimtestTests.cpp",
"test_utils/ANGLETest.cpp", "test_utils/ANGLETest.cpp",
"test_utils/ANGLETest.h", "test_utils/ANGLETest.h",
] ]
main = "angle_end2end_tests_main"
configs += [ configs += [
":angle_gles1_conform_support", ":angle_gles1_conform_support",
...@@ -1184,8 +1178,10 @@ if (build_angle_deqp_tests && !is_fuchsia) { ...@@ -1184,8 +1178,10 @@ if (build_angle_deqp_tests && !is_fuchsia) {
] ]
# Must be included outside of the source set for the define # Must be included outside of the source set for the define
sources = [ "deqp_support/angle_deqp_gtest.cpp" ] sources = [
main = "angle_deqp_tests_main" "angle_deqp_tests_main.cpp",
"deqp_support/angle_deqp_gtest.cpp",
]
data = [ data = [
"deqp_support/deqp_${_api}_test_expectations.txt", "deqp_support/deqp_${_api}_test_expectations.txt",
......
...@@ -3772,7 +3772,7 @@ TEST_P(GLSLTest_ES31, ArrayStructArrayArraySampler) ...@@ -3772,7 +3772,7 @@ TEST_P(GLSLTest_ES31, ArrayStructArrayArraySampler)
{ {
for (int k = 0; k < 2; k++) for (int k = 0; k < 2; k++)
{ {
for (size_t l = 0; l < 2; l++) for (int l = 0; l < 2; l++)
{ {
// First generate the texture // First generate the texture
int textureUnit = l + 2 * (k + 2 * (j + 2 * i)); int textureUnit = l + 2 * (k + 2 * (j + 2 * i));
...@@ -3862,7 +3862,7 @@ TEST_P(GLSLTest_ES31, ComplexStructArraySampler) ...@@ -3862,7 +3862,7 @@ TEST_P(GLSLTest_ES31, ComplexStructArraySampler)
GLTexture *array = arrays[k]; GLTexture *array = arrays[k];
size_t arrayLength = arrayLengths[k]; size_t arrayLength = arrayLengths[k];
size_t arrayOffset = arrayOffsets[k]; size_t arrayOffset = arrayOffsets[k];
for (size_t l = 0; l < arrayLength; l++) for (int l = 0; l < static_cast<int>(arrayLength); l++)
{ {
// First generate the texture // First generate the texture
int textureUnit = arrayOffset + l + totalArrayLength * (j + 3 * i); int textureUnit = arrayOffset + l + totalArrayLength * (j + 3 * i);
......
...@@ -1365,7 +1365,7 @@ void ANGLEProcessTestArgs(int *argc, char *argv[]) ...@@ -1365,7 +1365,7 @@ void ANGLEProcessTestArgs(int *argc, char *argv[])
} }
else if (strncmp(argv[argIndex], kBatchId, strlen(kBatchId)) == 0) else if (strncmp(argv[argIndex], kBatchId, strlen(kBatchId)) == 0)
{ {
// TODO(jmadill): Remove this once default. http://anglebug.com/5124 // Enable display reuse when running under --bot-mode.
gReuseDisplays = true; gReuseDisplays = true;
} }
else if (strncmp(argv[argIndex], kEnableANGLEPerTestCaptureLabel, else if (strncmp(argv[argIndex], kEnableANGLEPerTestCaptureLabel,
......
...@@ -238,7 +238,7 @@ void VulkanExternalHelper::initialize(bool useSwiftshader, bool enableValidation ...@@ -238,7 +238,7 @@ void VulkanExternalHelper::initialize(bool useSwiftshader, bool enableValidation
/* .pNext = */ nullptr, /* .pNext = */ nullptr,
/* .flags = */ 0, /* .flags = */ 0,
/* .pApplicationInfo = */ &applicationInfo, /* .pApplicationInfo = */ &applicationInfo,
/* .enabledLayerCount = */ enabledLayerNames.size(), /* .enabledLayerCount = */ static_cast<uint32_t>(enabledLayerNames.size()),
/* .ppEnabledLayerNames = */ enabledLayerNames.data(), /* .ppEnabledLayerNames = */ enabledLayerNames.data(),
/* .enabledExtensionCount = */ enabledInstanceExtensionCount, /* .enabledExtensionCount = */ enabledInstanceExtensionCount,
/* .ppEnabledExtensionName = */ enabledInstanceExtensions.data(), /* .ppEnabledExtensionName = */ enabledInstanceExtensions.data(),
......
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