Improve error reporting from DSL unit tests.

Previously, a DSL unit test failure would not report the actual text
generated by the DSL, or the line number of the failure.

Added a new macro EXPECT_EQUAL which
- supports DSL statements, DSL expressions, and IR nodes equally
- reports both the expected string and actual DSL output
- reports the line number of the failure
- always compares in a whitespace-insensitive fashion
- supports passing rvalue DSL expressions directly, rather than forcing
  us to create single-use lvalues for each test

Existing DSL tests have been updated to use this macro.

A failing test looks like this:

FAILURE: ../../tests/SkSLDSLTest.cpp:107	(Failed on line 146)
Expected: float4(0.0, 1.0, 2.0, 3.0)
  Actual: float4(0.0, 1.0, 2.0, 4.0)
 [DSLFloat, Mock]

Change-Id: Ie99d449690252f289bf48a66ab9c58e19dda9a07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372198
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
1 file changed