Commit 1478ec3c by Ancheng Qiao Committed by Commit Bot

Add gles1 primtest tests

Bug: angleproject:2303 Change-Id: Idece2eb2fb291799c9aae811ce63dafdd9333887 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2143029 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 868122c2
...@@ -397,6 +397,29 @@ if (build_angle_gles1_conform_tests) { ...@@ -397,6 +397,29 @@ if (build_angle_gles1_conform_tests) {
} }
# This source set is a bit special so we don't use angle_source_set. # This source set is a bit special so we don't use angle_source_set.
angle_gles1_conform_common_source = [
"$gles1_conform_root/ctk/ctk.h",
"$gles1_conform_root/ctk/ctkn.c",
"$gles1_conform_root/ctk/glext.c",
"$gles1_conform_root/fixed/fixed.c",
"$gles1_conform_root/fixed/float64.c",
"$gles1_conform_root/fixed/int32.c",
"$gles1_conform_root/fixed/int64.c",
"$gles1_conform_root/platform/gl_fixed_point.h",
"$gles1_conform_root/platform/gl_single_precision.h",
"$gles1_conform_root/platform/math_fixed.h",
"$gles1_conform_root/platform/math_float.h",
"$gles1_conform_root/platform/platform.h",
"$gles1_conform_root/platform/platform_gl.h",
"$gles1_conform_root/platform/platform_random.h",
"$gles1_conform_root/platform/platform_stdlib.h",
"$gles1_conform_root/platform/platform_types.h",
"$gles1_conform_root/platform/printf_fixed.h",
"$gles1_conform_root/platform/printf_float.h",
"$gles1_conform_root/platform/random.c",
"$gles1_conform_root/platform/stdlib_ansi.h",
]
source_set("angle_gles1_conformance_no_gtest") { source_set("angle_gles1_conformance_no_gtest") {
configs += [ configs += [
":angle_gles1_conform_support", ":angle_gles1_conform_support",
...@@ -524,27 +547,9 @@ if (build_angle_gles1_conform_tests) { ...@@ -524,27 +547,9 @@ if (build_angle_gles1_conform_tests) {
"$gles1_conform_root/conform/conformshell/utils.h", "$gles1_conform_root/conform/conformshell/utils.h",
"$gles1_conform_root/conform/conformshell/utilt.c", "$gles1_conform_root/conform/conformshell/utilt.c",
"$gles1_conform_root/conform/conformshell/utilt.h", "$gles1_conform_root/conform/conformshell/utilt.h",
"$gles1_conform_root/ctk/ctk.h",
"$gles1_conform_root/ctk/ctkn.c",
"$gles1_conform_root/ctk/glext.c",
"$gles1_conform_root/fixed/fixed.c",
"$gles1_conform_root/fixed/float64.c",
"$gles1_conform_root/fixed/int32.c",
"$gles1_conform_root/fixed/int64.c",
"$gles1_conform_root/platform/gl_fixed_point.h",
"$gles1_conform_root/platform/gl_single_precision.h",
"$gles1_conform_root/platform/math_fixed.h",
"$gles1_conform_root/platform/math_float.h",
"$gles1_conform_root/platform/platform.h",
"$gles1_conform_root/platform/platform_gl.h",
"$gles1_conform_root/platform/platform_random.h",
"$gles1_conform_root/platform/platform_stdlib.h",
"$gles1_conform_root/platform/platform_types.h",
"$gles1_conform_root/platform/printf_fixed.h",
"$gles1_conform_root/platform/printf_float.h",
"$gles1_conform_root/platform/random.c",
"$gles1_conform_root/platform/stdlib_ansi.h",
] ]
sources += angle_gles1_conform_common_source
} }
angle_test("angle_gles1_conformance_tests") { angle_test("angle_gles1_conformance_tests") {
...@@ -617,28 +622,10 @@ if (build_angle_gles1_conform_tests) { ...@@ -617,28 +622,10 @@ if (build_angle_gles1_conform_tests) {
"$gles1_conform_root/conform/covgl/t.c", "$gles1_conform_root/conform/covgl/t.c",
"$gles1_conform_root/conform/covgl/v.c", "$gles1_conform_root/conform/covgl/v.c",
"$gles1_conform_root/conform/covgl/w.c", "$gles1_conform_root/conform/covgl/w.c",
"$gles1_conform_root/ctk/ctk.h",
"$gles1_conform_root/ctk/ctkn.c",
"$gles1_conform_root/ctk/glext.c",
"$gles1_conform_root/fixed/fixed.c",
"$gles1_conform_root/fixed/float64.c",
"$gles1_conform_root/fixed/int32.c",
"$gles1_conform_root/fixed/int64.c",
"$gles1_conform_root/platform/gl_fixed_point.h",
"$gles1_conform_root/platform/gl_single_precision.h",
"$gles1_conform_root/platform/math_fixed.h",
"$gles1_conform_root/platform/math_float.h",
"$gles1_conform_root/platform/platform.h",
"$gles1_conform_root/platform/platform_gl.h",
"$gles1_conform_root/platform/platform_random.h",
"$gles1_conform_root/platform/platform_stdlib.h",
"$gles1_conform_root/platform/platform_types.h",
"$gles1_conform_root/platform/printf_fixed.h",
"$gles1_conform_root/platform/printf_float.h",
"$gles1_conform_root/platform/random.c",
"$gles1_conform_root/platform/stdlib_ansi.h",
] ]
sources += angle_gles1_conform_common_source
defines = [ "ProbeEnum=ProbeEnumANGLE" ] defines = [ "ProbeEnum=ProbeEnumANGLE" ]
} }
...@@ -665,6 +652,79 @@ if (build_angle_gles1_conform_tests) { ...@@ -665,6 +652,79 @@ if (build_angle_gles1_conform_tests) {
] ]
} }
} }
source_set("angle_gles1_primtest_no_gtest") {
configs += [
":angle_gles1_conform_support",
"$angle_root:internal_config",
]
public_configs = [
"$angle_root/util:angle_util_config",
"$angle_root:angle_static",
"$angle_root:gl_prototypes",
]
testonly = true
public_deps = [
"$angle_root:angle_common",
"$angle_root:libEGL_static",
"$angle_root:libGLESv1_CM_static",
"$angle_root:libGLESv2_static",
"$angle_root:preprocessor",
"$angle_root:translator",
"$angle_root/util:angle_util_static",
]
sources = [
"$gles1_conform_root/conform/primtest/alias.c",
"$gles1_conform_root/conform/primtest/alpha.c",
"$gles1_conform_root/conform/primtest/blend.c",
"$gles1_conform_root/conform/primtest/depth.c",
"$gles1_conform_root/conform/primtest/dither.c",
"$gles1_conform_root/conform/primtest/driver.c",
"$gles1_conform_root/conform/primtest/driver.h",
"$gles1_conform_root/conform/primtest/fog.c",
"$gles1_conform_root/conform/primtest/hint.c",
"$gles1_conform_root/conform/primtest/light.c",
"$gles1_conform_root/conform/primtest/logic.c",
"$gles1_conform_root/conform/primtest/prim.c",
"$gles1_conform_root/conform/primtest/scissor.c",
"$gles1_conform_root/conform/primtest/shade.c",
"$gles1_conform_root/conform/primtest/shell.c",
"$gles1_conform_root/conform/primtest/shell.h",
"$gles1_conform_root/conform/primtest/stencil.c",
"$gles1_conform_root/conform/primtest/texture.c",
"$gles1_conform_root/conform/primtest/tproto.h",
]
sources += angle_gles1_conform_common_source
}
angle_test("angle_gles1_primtest_tests") {
deps = [
":angle_common_test_utils_static",
":angle_gles1_primtest_no_gtest",
]
include_dirs = [
".",
"$gles1_conform_root/conform",
]
sources = [
"gles1_conformance_tests/PrimtestTests.cpp",
"test_utils/ANGLETest.cpp",
"test_utils/ANGLETest.h",
]
main = "angle_end2end_tests_main"
configs += [
":angle_gles1_conform_support",
"${angle_root}:libANGLE_config",
"${angle_root}:angle_backend_config",
]
}
} }
###----------------------------------------------------- ###-----------------------------------------------------
...@@ -1175,7 +1235,10 @@ group("angle_tests") { ...@@ -1175,7 +1235,10 @@ group("angle_tests") {
} }
} }
if (build_angle_gles1_conform_tests) { if (build_angle_gles1_conform_tests) {
deps += [ ":angle_gles1_conformance_tests" ] deps += [
":angle_gles1_conformance_tests",
":angle_gles1_primtest_tests",
]
if (!is_win && !is_mac) { if (!is_win && !is_mac) {
deps += [ ":angle_gles1_covgl_tests" ] deps += [ ":angle_gles1_covgl_tests" ]
} }
......
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// PrimtestTests.cpp:
// GLES1 conformance primtest tests.
//
#include "GLES/gl.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
#ifdef __cplusplus
extern "C" {
#endif
// ES 1.0
extern void DrawPrims(void);
#include "primtest/driver.h"
#include "primtest/tproto.h"
#ifdef __cplusplus
}
#endif
namespace angle
{
class GLES1PrimtestTest : public ANGLETest
{
protected:
GLES1PrimtestTest()
{
setWindowWidth(48);
setWindowHeight(48);
setConfigRedBits(8);
setConfigGreenBits(8);
setConfigBlueBits(8);
setConfigAlphaBits(8);
setConfigDepthBits(24);
setConfigStencilBits(8);
}
void testTearDown() override
{
if (mTestData != nullptr)
{
free(mTestData);
}
}
void execTest(long test)
{
long i;
for (i = 0; driver[i].test != TEST_NULL; i++)
{
if (driver[i].test == test)
{
break;
}
}
ASSERT_NE(TEST_NULL, driver[i].test);
driverRec &op = driver[i];
op.funcInit((void *)&mTestData);
op.finish = 0;
ASSERT_GL_NO_ERROR();
for (;;)
{
op.funcStatus(1, mTestData);
ASSERT_GL_NO_ERROR();
op.funcSet(1, mTestData);
ASSERT_GL_NO_ERROR();
DrawPrims();
ASSERT_GL_NO_ERROR();
long finish = op.funcUpdate(mTestData);
ASSERT_GL_NO_ERROR();
if (finish)
{
break;
}
};
}
protected:
void *mTestData;
};
TEST_P(GLES1PrimtestTest, Hint)
{
execTest(TEST_HINT);
}
TEST_P(GLES1PrimtestTest, Alias)
{
execTest(TEST_ALIAS);
}
TEST_P(GLES1PrimtestTest, Alpha)
{
execTest(TEST_ALPHA);
}
TEST_P(GLES1PrimtestTest, Blend)
{
execTest(TEST_BLEND);
}
TEST_P(GLES1PrimtestTest, Depth)
{
execTest(TEST_DEPTH);
}
TEST_P(GLES1PrimtestTest, Dither)
{
execTest(TEST_DITHER);
}
TEST_P(GLES1PrimtestTest, Fog)
{
execTest(TEST_FOG);
}
TEST_P(GLES1PrimtestTest, Light)
{
execTest(TEST_LIGHT);
}
TEST_P(GLES1PrimtestTest, Logic)
{
execTest(TEST_LOGICOP);
}
TEST_P(GLES1PrimtestTest, Scissor)
{
execTest(TEST_SCISSOR);
}
TEST_P(GLES1PrimtestTest, Shade)
{
execTest(TEST_SHADE);
}
TEST_P(GLES1PrimtestTest, Stencil)
{
execTest(TEST_STENCIL);
}
TEST_P(GLES1PrimtestTest, Texture)
{
execTest(TEST_TEXTURE);
}
ANGLE_INSTANTIATE_TEST(GLES1PrimtestTest, ES1_OPENGL(), ES1_VULKAN());
} // namespace angle
// Included here to fix a compile error due to white box tests using angle_end2end_tests_main.
void RegisterContextCompatibilityTests() {}
\ No newline at end of file
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