]> git.tdb.fi Git - libs/gl.git/commitdiff
Catch exceptions from parsing while testing the compiler
authorMikko Rasa <tdb@tdb.fi>
Fri, 5 Mar 2021 10:59:27 +0000 (12:59 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 5 Mar 2021 23:00:31 +0000 (01:00 +0200)
tests/glsl/glslcompiler.cpp

index 7c5e646283c25cfcbbbc8e705e4c958b0c22c6f9..8ff630555557e1bf5a3b7f1d7b5e7ece23d33027 100644 (file)
@@ -99,9 +99,9 @@ const GlslCompilerTest::TestCase &GlslCompilerTest::load_test_case(const string
 void GlslCompilerTest::run_test_case(const TestCase *test_case)
 {
        GL::SL::Compiler compiler(GL::SL::Features::all());
-       compiler.set_source(test_case->source, "<test>");
        try
        {
+               compiler.set_source(test_case->source, "<test>");
                compiler.compile(GL::SL::Compiler::PROGRAM);
        }
        catch(const GL::SL::invalid_shader_source &exc)