Commit 68d4e392 by Jamie Madill Committed by Angle LUCI CQ

Trace Tests: Add option for ASAN builds.

ASAN builds can detect OOB memory accesses. This is very useful for diagnosing some kinds of flaky OOB crashes. Removes a test that was calling BufferSubData with a null data argument. This behaviour is undefined and we shouldn't be testing it. Also includes some minor refactorings and script changes. Bug: angleproject:5133 Change-Id: I5a7d9a5500c50a51f6369e944a5f0a533709f00d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3002510Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGert Wollny <gert.wollny@collabora.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent f7c3c5b6
...@@ -258,10 +258,13 @@ class ChildProcessesManager(): ...@@ -258,10 +258,13 @@ class ChildProcessesManager():
return count return count
def RunGNGen(self, args, build_dir, pipe_stdout, extra_gn_args=[]): def RunGNGen(self, args, build_dir, pipe_stdout, extra_gn_args=[]):
gn_args = [("use_goma", str(args.use_goma).lower()), gn_args = [('use_goma', str(args.use_goma).lower()),
("angle_with_capture_by_default", "true")] + extra_gn_args ('angle_with_capture_by_default', 'true'),
('is_debug', 'false')] + extra_gn_args
if args.goma_dir: if args.goma_dir:
gn_args.append(('goma_dir', '"%s"' % args.goma_dir)) gn_args.append(('goma_dir', '"%s"' % args.goma_dir))
if args.asan:
gn_args.append(('is_asan', 'true'))
debug('Calling GN gen with %s' % str(gn_args)) debug('Calling GN gen with %s' % str(gn_args))
args_str = ' '.join(['%s=%s' % (k, v) for (k, v) in gn_args]) args_str = ' '.join(['%s=%s' % (k, v) for (k, v) in gn_args])
cmd = [self._gn_path, 'gen', '--args=%s' % args_str, build_dir] cmd = [self._gn_path, 'gen', '--args=%s' % args_str, build_dir]
...@@ -552,9 +555,9 @@ class TestBatch(): ...@@ -552,9 +555,9 @@ class TestBatch():
# CaptureReplayTests.cpp # CaptureReplayTests.cpp
self.CreateTestsCompositeFiles(composite_file_id, tests) self.CreateTestsCompositeFiles(composite_file_id, tests)
gn_args = [("angle_build_capture_replay_tests", "true"), ("symbol_level", "1"), gn_args = [('angle_build_capture_replay_tests', 'true'), ('symbol_level', '1'),
("angle_capture_replay_test_trace_dir", '"%s"' % self.trace_dir), ('angle_capture_replay_test_trace_dir', '"%s"' % self.trace_dir),
("angle_capture_replay_composite_file_id", str(composite_file_id))] ('angle_capture_replay_composite_file_id', str(composite_file_id))]
returncode, output = child_processes_manager.RunGNGen(self.args, replay_build_dir, True, returncode, output = child_processes_manager.RunGNGen(self.args, replay_build_dir, True,
gn_args) gn_args)
if returncode != 0: if returncode != 0:
...@@ -1031,6 +1034,7 @@ if __name__ == "__main__": ...@@ -1031,6 +1034,7 @@ if __name__ == "__main__":
# TODO(jmadill): Remove this argument. http://anglebug.com/6102 # TODO(jmadill): Remove this argument. http://anglebug.com/6102
parser.add_argument('--depot-tools-path', default=None, help='Path to depot tools') parser.add_argument('--depot-tools-path', default=None, help='Path to depot tools')
parser.add_argument('--xvfb', action='store_true', help='Run with xvfb.') parser.add_argument('--xvfb', action='store_true', help='Run with xvfb.')
parser.add_argument('--asan', action='store_true', help='Build with ASAN.')
args = parser.parse_args() args = parser.parse_args()
if platform == "win32": if platform == "win32":
args.test_suite += ".exe" args.test_suite += ".exe"
......
...@@ -78,36 +78,6 @@ void main() ...@@ -78,36 +78,6 @@ void main()
GLint mAttribLocation; GLint mAttribLocation;
}; };
// Disabled in debug because it's way too slow.
#if !defined(NDEBUG)
# define MAYBE_NULLData DISABLED_NULLData
#else
# define MAYBE_NULLData NULLData
#endif // !defined(NDEBUG)
TEST_P(BufferDataTest, MAYBE_NULLData)
{
glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
EXPECT_GL_NO_ERROR();
const int numIterations = 128;
for (int i = 0; i < numIterations; ++i)
{
GLsizei bufferSize = sizeof(GLfloat) * (i + 1);
glBufferData(GL_ARRAY_BUFFER, bufferSize, nullptr, GL_STATIC_DRAW);
EXPECT_GL_NO_ERROR();
for (int j = 0; j < bufferSize; j++)
{
for (int k = 0; k < bufferSize - j; k++)
{
glBufferSubData(GL_ARRAY_BUFFER, k, j, nullptr);
ASSERT_GL_NO_ERROR();
}
}
}
}
// If glBufferData was not called yet the capturing must not try to // If glBufferData was not called yet the capturing must not try to
// read the data. http://anglebug.com/6093 // read the data. http://anglebug.com/6093
TEST_P(BufferDataTest, Uninitialized) TEST_P(BufferDataTest, Uninitialized)
......
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