Disable tests which rely on carriage returns in the input

For some reason, the test generator is not currently able to create string
literals containing these characters, so the tests will fail.
This commit is contained in:
Sam Harwell 2015-06-06 14:30:17 -05:00
parent 12efe2f83b
commit 80a881e132
5 changed files with 27 additions and 3 deletions

View File

@ -1,5 +1,9 @@
TestType() ::= "Lexer" TestType() ::= "Lexer"
Options ::= [
"Ignore": "Currently unable to generate the required CRLF input sequence."
]
Grammar ::= [ Grammar ::= [
"L": {<grammar("L")>} "L": {<grammar("L")>}
] ]

View File

@ -1,5 +1,9 @@
TestType() ::= "Lexer" TestType() ::= "Lexer"
Options ::= [
"Ignore": "Currently unable to generate the required CRLF input sequence."
]
Grammar ::= [ Grammar ::= [
"L": {<grammar("L")>} "L": {<grammar("L")>}
] ]

View File

@ -1,5 +1,9 @@
TestType() ::= "Lexer" TestType() ::= "Lexer"
Options ::= [
"Ignore": "Currently unable to generate the required CRLF input sequence."
]
Grammar ::= [ Grammar ::= [
"L": {<grammar("L")>} "L": {<grammar("L")>}
] ]

View File

@ -1,5 +1,9 @@
TestType() ::= "Lexer" TestType() ::= "Lexer"
Options ::= [
"Ignore": "Currently unable to generate the required CRLF input sequence."
]
Grammar ::= [ Grammar ::= [
"L": {<grammar("L")>} "L": {<grammar("L")>}
] ]

View File

@ -2,6 +2,7 @@ TestFile(file) ::= <<
package org.antlr4.runtime.test; package org.antlr4.runtime.test;
import org.antlr.v4.test.rt.java.BaseTest; import org.antlr.v4.test.rt.java.BaseTest;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
@ -21,7 +22,7 @@ public class Test<file.name> extends BaseTest {
>> >>
LexerTestMethod(test) ::= << LexerTestMethod(test) ::= <<
@Test <testAnnotations(test)>
public void test<test.name>() throws Exception { public void test<test.name>() throws Exception {
mkdir(tmpdir); mkdir(tmpdir);
@ -52,6 +53,13 @@ CompositeLexerTestMethod(test) ::= <<
<LexerTestMethod(test)> <LexerTestMethod(test)>
>> >>
testAnnotations(test) ::= <%
@Test
<if(test.Options.("Ignore"))>
<\n>@Ignore(<writeStringLiteral(test.Options.("Ignore"))>)
<endif>
%>
writeBoolean(o) ::= "<if(o && !isEmpty.(o))>true<else>false<endif>" writeBoolean(o) ::= "<if(o && !isEmpty.(o))>true<else>false<endif>"
buildStringLiteral(text, variable) ::= << buildStringLiteral(text, variable) ::= <<
@ -78,7 +86,7 @@ writeLines(textLines) ::= <%
%> %>
ParserTestMethod(test) ::= << ParserTestMethod(test) ::= <<
@Test <testAnnotations(test)>
public void test<test.name>() throws Exception { public void test<test.name>() throws Exception {
mkdir(tmpdir); mkdir(tmpdir);
@ -125,7 +133,7 @@ String test<test.name>(String input) throws Exception {
>> >>
ConcreteParserTestMethod(test) ::= << ConcreteParserTestMethod(test) ::= <<
@Test <testAnnotations(test)>
public void test<test.name>() throws Exception { public void test<test.name>() throws Exception {
String found = test<test.baseName>("<test.input>"); String found = test<test.baseName>("<test.input>");
assertEquals("<test.expectedOutput>", found); assertEquals("<test.expectedOutput>", found);