Exemplo n.º 1
0
        private static void ValidateToolError(string message, string tool, CanonicalError.Parts.Category severity, string code, string text)
        {
            CanonicalError.Parts errorParts = CanonicalError.Parse(message);

            errorParts.ShouldNotBeNull(); // "The message '" + message + "' could not be interpreted."
            errorParts.origin.ShouldBe(tool);
            errorParts.category.ShouldBe(severity);
            errorParts.code.ShouldBe(code);
            errorParts.text.ShouldBe(text);
            errorParts.line.ShouldBe(CanonicalError.Parts.numberNotSpecified);
            errorParts.column.ShouldBe(CanonicalError.Parts.numberNotSpecified);
            errorParts.endLine.ShouldBe(CanonicalError.Parts.numberNotSpecified);
            errorParts.endColumn.ShouldBe(CanonicalError.Parts.numberNotSpecified);
        }
Exemplo n.º 2
0
        private static void ValidateFileNameMultiLineColumnError(string message, string filename, int line, int column, int endLine, int endColumn, CanonicalError.Parts.Category severity, string code, string text)
        {
            CanonicalError.Parts errorParts = CanonicalError.Parse(message);

            errorParts.ShouldNotBeNull(); // "The message '" + message + "' could not be interpreted."
            errorParts.origin.ShouldBe(filename);
            errorParts.category.ShouldBe(severity);
            errorParts.code.ShouldBe(code);
            errorParts.text.ShouldBe(text);
            errorParts.line.ShouldBe(line);
            errorParts.column.ShouldBe(column);
            errorParts.endLine.ShouldBe(endLine);
            errorParts.endColumn.ShouldBe(endColumn);
        }
Exemplo n.º 3
0
        public void ClangGccError()
        {
            CanonicalError.Parts errorParts = CanonicalError.Parse(
                "err.cpp:6:3: error: use of undeclared identifier 'force_an_error'");

            errorParts.ShouldNotBeNull();
            errorParts.origin.ShouldBe("err.cpp");
            errorParts.category.ShouldBe(CanonicalError.Parts.Category.Error);
            errorParts.code.ShouldStartWith("G");
            errorParts.code.Length.ShouldBe(9);
            errorParts.text.ShouldBe("use of undeclared identifier 'force_an_error'");
            errorParts.line.ShouldBe(6);
            errorParts.column.ShouldBe(3);
            errorParts.endLine.ShouldBe(CanonicalError.Parts.numberNotSpecified);
            errorParts.endColumn.ShouldBe(CanonicalError.Parts.numberNotSpecified);
        }