Skip to content

Commit 1a83b73

Browse files
committed
IJMP-1874: fix annotator tests and change task for lexer generation
Signed-off-by: Denis Lisenkov <lisenkov.d.y@gmail.com>
1 parent 67d2cda commit 1a83b73

File tree

4 files changed

+73
-73
lines changed

4 files changed

+73
-73
lines changed

build.gradle.kts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,19 @@ tasks {
126126
purgeOldFiles.set(true)
127127
}
128128

129+
// needed until it becomes possible to set encoding of .flex file using the generateLexer task
130+
// see https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/127
131+
val generateJclLexer = task<JavaExec>("generateJclLexer") {
132+
val jflexJar = "jflex-${jflexVersion}.jar"
133+
val source = "src/main/kotlin/org/zowe/jcl/lang/Jcl.flex"
134+
val targetDir = "src/main/java/org/zowe/jcl/lang"
135+
val encoding = "UTF-8"
136+
classpath = files(jflexJar)
137+
args("-d", targetDir, "--encoding", encoding, source)
138+
}
139+
129140
compileKotlin {
130-
dependsOn(generateLexer, generateParser)
141+
dependsOn(generateJclLexer, generateParser)
131142

132143
kotlinOptions {
133144
jvmTarget = JavaVersion.VERSION_17.toString()
@@ -159,15 +170,4 @@ grammarKit {
159170
jflexRelease.set(jflexVersion)
160171
// release version of Grammar-Kit - https://github.com/JetBrains/Grammar-Kit
161172
grammarKitRelease.set("2021.1.2")
162-
}
163-
164-
// needed until it becomes possible to set encoding of .flex file using the generateLexer task
165-
// see https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/127
166-
val generateJclLexer = task<JavaExec>("generateJclLexer") {
167-
val jflexJar = "jflex-${jflexVersion}.jar"
168-
val source = "src/main/kotlin/org/zowe/jcl/lang/Jcl.flex"
169-
val targetDir = "src/main/java/org/zowe/jcl/lang"
170-
val encoding = "UTF-8"
171-
classpath = files(jflexJar)
172-
args("-d", targetDir, "--encoding", encoding, source)
173-
}
173+
}
Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
// TODO: fix this
2-
// /*
3-
// * This program and the accompanying materials are made available under the terms of the
4-
// * Eclipse Public License v2.0 which accompanies this distribution, and is available at
5-
// * https://www.eclipse.org/legal/epl-v20.html
6-
// *
7-
// * SPDX-License-Identifier: EPL-2.0
8-
// *
9-
// * Copyright IBA Group 2023
10-
// */
11-
12-
// package org.zowe.jcl.lang.annotator
13-
14-
// import com.intellij.testFramework.fixtures.BasePlatformTestCase
15-
16-
// class JclAnnotatorTest: BasePlatformTestCase() {
17-
18-
// /**
19-
// * @return path to test data file directory relative to root of this module.
20-
// */
21-
// override fun getTestDataPath(): String = "src/test/resources/annotator"
22-
23-
// /**
24-
// * Tests jsl file annotator using test name to get jsl file from resources.
25-
// */
26-
// private fun doTest() {
27-
// myFixture.configureByFile(getTestName(false) + ".jcl")
28-
// myFixture.testHighlighting(true, true, true)
29-
// }
30-
// fun testAnnotatorTestData() {
31-
// doTest()
32-
// }
33-
34-
// fun testOperator() {
35-
// doTest()
36-
// }
37-
38-
// fun testNoSuchOperator() {
39-
// doTest()
40-
// }
41-
42-
// fun testTuple() {
43-
// doTest()
44-
// }
45-
46-
// fun testUnclosedTuple() {
47-
// doTest()
48-
// }
49-
50-
// fun testIfCondition() {
51-
// doTest()
52-
// }
53-
54-
// fun testIncorrectIfCondition() {
55-
// doTest()
56-
// }
57-
58-
// }
1+
/*
2+
* This program and the accompanying materials are made available under the terms of the
3+
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
4+
* https://www.eclipse.org/legal/epl-v20.html
5+
*
6+
* SPDX-License-Identifier: EPL-2.0
7+
*
8+
* Copyright IBA Group 2023
9+
*/
10+
11+
package org.zowe.jcl.lang.annotator
12+
13+
import com.intellij.testFramework.fixtures.BasePlatformTestCase
14+
15+
class JclAnnotatorTest: BasePlatformTestCase() {
16+
17+
/**
18+
* @return path to test data file directory relative to root of this module.
19+
*/
20+
override fun getTestDataPath(): String = "src/test/resources/annotator"
21+
22+
/**
23+
* Tests jsl file annotator using test name to get jsl file from resources.
24+
*/
25+
private fun doTest() {
26+
myFixture.configureByFile(getTestName(false) + ".jcl")
27+
myFixture.testHighlighting(true, true, true)
28+
}
29+
30+
fun testAnnotatorTestData() {
31+
doTest()
32+
}
33+
34+
fun testOperator() {
35+
doTest()
36+
}
37+
38+
fun testNoSuchOperator() {
39+
doTest()
40+
}
41+
42+
fun testTuple() {
43+
doTest()
44+
}
45+
46+
fun testUnclosedTuple() {
47+
doTest()
48+
}
49+
50+
fun testIfCondition() {
51+
doTest()
52+
}
53+
54+
fun testIncorrectIfCondition() {
55+
doTest()
56+
}
57+
58+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
//IFBAD IF (ABEND > <error descr="<if value> expected, got '('">(</error>STEP1.RC > 8)) THEN
1+
//IFBAD IF (ABEND > <error descr="<if value> or line_start expected, got '('">(</error>STEP1.RC > 8)) THEN
22
//TRUE EXEC PROC=ERROR
33
//IFBADEND ENDIF
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
//SORTOUT DD SPACE=(CYL,(50,1),RLSE<EOLError descr="tuple_end or tuple_param_delim expected"></EOLError>
1+
//SORTOUT DD SPACE=(CYL,(50,1),RLSE<EOLError descr="<tuple param>, param_equals, tuple_end or tuple_param_delim expected"></EOLError>

0 commit comments

Comments
 (0)