DSL ReleaseProgram retains source and reports errors better

Change-Id: Id5923e1c1404bddf7f7da7d04bd91721ab637322
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429096
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
diff --git a/tests/SkSLDSLTest.cpp b/tests/SkSLDSLTest.cpp
index fcd299c..96062f2 100644
--- a/tests/SkSLDSLTest.cpp
+++ b/tests/SkSLDSLTest.cpp
@@ -1974,7 +1974,8 @@
     DSLFunction(kVoid_Type, "main").define(
         sk_FragColor() = (sqr(2), Half4(sqr(3)))
     );
-    std::unique_ptr<SkSL::Program> program = ReleaseProgram();
+    const char* source = "source test";
+    std::unique_ptr<SkSL::Program> program = ReleaseProgram(std::make_unique<SkSL::String>(source));
     EXPECT_EQUAL(*program,
                  "layout(location = 0, index = 0, builtin = 10001) out half4 sk_FragColor;"
                  "layout(builtin = 17)in bool sk_Clockwise;"
@@ -1983,4 +1984,5 @@
                  "/* inlined: sqr */;"
                  "(sk_FragColor = (4.0 , half4(half(9.0))));"
                  "}");
+    REPORTER_ASSERT(r, *program->fSource == source);
 }