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") {
}
set_defaults("angle_test") {
configs = []
# Gtest itself can't pass all the strict warning filters.
public_configs = angle_common_configs - [
"$angle_root:constructor_and_destructor_warnings",
"$angle_root:extra_warnings",
]
configs = angle_common_configs - [
"$angle_root:constructor_and_destructor_warnings",
"$angle_root:extra_warnings",
]
public_configs = []
public_deps = []
sources = []
data = []
defines = []
deps = []
data_deps = []
main = ""
suppressed_configs = angle_remove_configs
}
......@@ -291,102 +289,52 @@ template("angle_static_library") {
}
template("angle_test") {
_lib = target_name + "_lib"
angle_source_set(_lib) {
testonly = true
test(target_name) {
forward_variables_from(invoker,
"*",
[
"deps",
"manifest",
"use_xvfb",
"configs",
"data",
"public_deps",
])
if (is_android) {
public_configs += [ "$angle_root:build_id_config" ]
}
configs += invoker.configs
configs -= invoker.suppressed_configs
public_deps += invoker.deps + [
"$angle_root:angle_common",
"$angle_root:includes",
"$angle_root/third_party/rapidjson:rapidjson",
"$angle_root/util:angle_test_utils",
"//testing/gmock",
"//testing/gtest",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
public_deps = invoker.public_deps + [
"$angle_root:angle_common",
"$angle_root:includes",
"$angle_root/util:angle_test_utils",
"$angle_root/third_party/rapidjson:rapidjson",
"//testing/gmock",
"//testing/gtest",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
data = invoker.data + [
"$angle_root/scripts/run_gtest_angle_test.py",
"//testing/scripts/common.py",
"//testing/xvfb.py",
]
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 + [
"$angle_root/scripts/run_gtest_angle_test.py",
"//testing/scripts/common.py",
"//testing/xvfb.py",
]
if ((is_linux || is_chromeos) && !is_component_build) {
# Set rpath to find shared libs in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
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) ||
(build_with_chromium && chromeos_is_browser_only)) {
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) {
# Set rpath to find shared libs in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (defined(invoker.manifest)) {
manifest = invoker.manifest
}
if (is_android) {
public_configs += [ "$angle_root:build_id_config" ]
if (build_with_chromium) {
use_native_activity = true
configs -= [ "//build/config/android:hide_all_but_jni" ]
......
......@@ -23,8 +23,6 @@ angle_test("test_utils_unittest_helper") {
"test_utils/angle_test_instantiate.h",
"test_utils/runner/TestSuite_unittest.cpp",
]
deps = [ "$angle_root:angle_common" ]
}
test_expectations_sources = [
......@@ -118,8 +116,7 @@ angle_test("angle_system_info_test") {
}
angle_test("angle_unittests") {
sources = angle_unittests_sources
main = "angle_unittest_main"
sources = angle_unittests_sources + [ "angle_unittest_main.cpp" ]
if (angle_enable_hlsl) {
sources += angle_unittests_hlsl_sources
......@@ -149,8 +146,7 @@ if (is_win || is_linux || is_chromeos || is_mac || is_android || is_fuchsia) {
angle_test("angle_end2end_tests") {
include_dirs = [ "." ]
sources = angle_end2end_tests_sources
main = "angle_end2end_tests_main"
sources = angle_end2end_tests_sources + [ "angle_end2end_tests_main.cpp" ]
libs = []
if (is_mac) {
......@@ -205,8 +201,7 @@ if (is_win || is_linux || is_chromeos || is_mac || is_android) {
angle_test("angle_white_box_tests") {
include_dirs = [ "." ]
sources = angle_white_box_tests_sources
main = "angle_end2end_tests_main"
sources = angle_white_box_tests_sources + [ "angle_end2end_tests_main.cpp" ]
if (is_win && angle_enable_d3d11) {
sources += angle_white_box_tests_win_sources
......@@ -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.
angle_test("angle_white_box_perftests") {
include_dirs = [ "." ]
sources = angle_white_box_perf_tests_sources
main = "angle_perftests_main"
sources =
angle_white_box_perf_tests_sources + [ "angle_perftests_main.cpp" ]
deps = [
":angle_perftests_static",
......@@ -321,8 +316,7 @@ if (build_angle_perftests) {
# This test suite is designed to run against a generic GL implementation.
angle_test("angle_perftests") {
include_dirs = [ "." ]
sources = angle_perf_tests_sources
main = "angle_perftests_main"
sources = angle_perf_tests_sources + [ "angle_perftests_main.cpp" ]
deps = [
":angle_perftests_shared",
......@@ -572,11 +566,11 @@ if (build_angle_gles1_conform_tests) {
include_dirs = [ "." ]
sources = [
"angle_end2end_tests_main.cpp",
"gles1_conformance_tests/ConformanceTests.cpp",
"test_utils/ANGLETest.cpp",
"test_utils/ANGLETest.h",
]
main = "angle_end2end_tests_main"
configs += [
"${angle_root}:libANGLE_config",
......@@ -650,11 +644,11 @@ if (build_angle_gles1_conform_tests) {
sources = [
"$gles1_conform_root/conform/covgl/shell.c",
"angle_end2end_tests_main.cpp",
"gles1_conformance_tests/CovglTests.cpp",
"test_utils/ANGLETest.cpp",
"test_utils/ANGLETest.h",
]
main = "angle_end2end_tests_main"
configs += [
":angle_gles1_conform_support",
......@@ -721,11 +715,11 @@ if (build_angle_gles1_conform_tests) {
include_dirs = [ "$gles1_conform_root/conform" ]
sources = [
"angle_end2end_tests_main.cpp",
"gles1_conformance_tests/PrimtestTests.cpp",
"test_utils/ANGLETest.cpp",
"test_utils/ANGLETest.h",
]
main = "angle_end2end_tests_main"
configs += [
":angle_gles1_conform_support",
......@@ -1184,8 +1178,10 @@ if (build_angle_deqp_tests && !is_fuchsia) {
]
# Must be included outside of the source set for the define
sources = [ "deqp_support/angle_deqp_gtest.cpp" ]
main = "angle_deqp_tests_main"
sources = [
"angle_deqp_tests_main.cpp",
"deqp_support/angle_deqp_gtest.cpp",
]
data = [
"deqp_support/deqp_${_api}_test_expectations.txt",
......
......@@ -3772,7 +3772,7 @@ TEST_P(GLSLTest_ES31, ArrayStructArrayArraySampler)
{
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
int textureUnit = l + 2 * (k + 2 * (j + 2 * i));
......@@ -3862,7 +3862,7 @@ TEST_P(GLSLTest_ES31, ComplexStructArraySampler)
GLTexture *array = arrays[k];
size_t arrayLength = arrayLengths[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
int textureUnit = arrayOffset + l + totalArrayLength * (j + 3 * i);
......
......@@ -1365,7 +1365,7 @@ void ANGLEProcessTestArgs(int *argc, char *argv[])
}
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;
}
else if (strncmp(argv[argIndex], kEnableANGLEPerTestCaptureLabel,
......
......@@ -238,7 +238,7 @@ void VulkanExternalHelper::initialize(bool useSwiftshader, bool enableValidation
/* .pNext = */ nullptr,
/* .flags = */ 0,
/* .pApplicationInfo = */ &applicationInfo,
/* .enabledLayerCount = */ enabledLayerNames.size(),
/* .enabledLayerCount = */ static_cast<uint32_t>(enabledLayerNames.size()),
/* .ppEnabledLayerNames = */ enabledLayerNames.data(),
/* .enabledExtensionCount = */ enabledInstanceExtensionCount,
/* .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