Added -C option to request cascading errors. By default, will exit early, to avoid all error-recovery-based crashes. This works by simulating end-of-file in input on first error, so no need for exception handling, or stack unwinding, or any complex error checking/handling to get out of the stack.
This commit is contained in:
@@ -97,8 +97,8 @@ TEST_P(ConfigTest, FromFile)
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Glsl, ConfigTest,
|
||||
::testing::ValuesIn(std::vector<TestCaseSpec>({
|
||||
{"specExamples.vert", "baseResults/test.conf", "specExamples.vert.out", EShMsgAST},
|
||||
{"100Limits.vert", "100.conf", "100LimitsConf.vert.out", EShMsgDefault},
|
||||
{"specExamples.vert", "baseResults/test.conf", "specExamples.vert.out", (EShMessages)(EShMsgAST | EShMsgCascadingErrors)},
|
||||
{"100Limits.vert", "100.conf", "100LimitsConf.vert.out", EShMsgCascadingErrors},
|
||||
})),
|
||||
);
|
||||
// clang-format on
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace glslangtest {
|
||||
// gets fixed.
|
||||
class GlslangInitializer {
|
||||
public:
|
||||
GlslangInitializer() : lastMessages(EShMsgDefault)
|
||||
GlslangInitializer() : lastMessages(EShMsgCascadingErrors)
|
||||
{
|
||||
glslang::InitializeProcess();
|
||||
}
|
||||
|
||||
@@ -48,8 +48,7 @@ TEST_P(LinkTest, FromFile)
|
||||
{
|
||||
const auto& fileNames = GetParam();
|
||||
const size_t fileCount = fileNames.size();
|
||||
const EShMessages controls = DeriveOptions(
|
||||
Source::GLSL, Semantics::OpenGL, Target::AST);
|
||||
const EShMessages controls = DeriveOptions(Source::GLSL, Semantics::OpenGL, Target::AST);
|
||||
GlslangResult result;
|
||||
|
||||
// Compile each input shader file.
|
||||
|
||||
@@ -68,7 +68,7 @@ EShLanguage GetShaderStage(const std::string& stage)
|
||||
|
||||
EShMessages DeriveOptions(Source source, Semantics semantics, Target target)
|
||||
{
|
||||
EShMessages result = EShMsgDefault;
|
||||
EShMessages result = EShMsgCascadingErrors;
|
||||
|
||||
switch (source) {
|
||||
case Source::GLSL:
|
||||
|
||||
@@ -264,8 +264,7 @@ public:
|
||||
tryLoadFile(expectedOutputFname, "expected output", &expectedOutput);
|
||||
|
||||
const EShMessages controls = DeriveOptions(source, semantics, target);
|
||||
GlslangResult result =
|
||||
compileAndLink(testName, input, entryPointName, controls);
|
||||
GlslangResult result = compileAndLink(testName, input, entryPointName, controls);
|
||||
|
||||
// Generate the hybrid output in the way of glslangValidator.
|
||||
std::ostringstream stream;
|
||||
@@ -290,7 +289,7 @@ public:
|
||||
glslang::TShader::ForbidInclude includer;
|
||||
const bool success = shader.preprocess(
|
||||
&glslang::DefaultTBuiltInResource, defaultVersion, defaultProfile,
|
||||
forceVersionProfile, isForwardCompatible, EShMsgOnlyPreprocessor,
|
||||
forceVersionProfile, isForwardCompatible, (EShMessages)(EShMsgOnlyPreprocessor | EShMsgCascadingErrors),
|
||||
&ppShader, includer);
|
||||
|
||||
std::string log = shader.getInfoLog();
|
||||
|
||||
Reference in New Issue
Block a user