Commit 3a1fed6b authored by René Schöne's avatar René Schöne
Browse files

Update test definitions.

parent bf7871f1
Pipeline #8884 passed with stages
in 8 minutes and 30 seconds
buildscript { buildscript {
repositories { repositories {
mavenCentral() mavenCentral()
// mavenLocal()
maven { maven {
name "gitlab-maven" name "gitlab-maven"
url "https://git-st.inf.tu-dresden.de/api/v4/groups/jastadd/-/packages/maven" url "https://git-st.inf.tu-dresden.de/api/v4/groups/jastadd/-/packages/maven"
...@@ -8,12 +9,12 @@ buildscript { ...@@ -8,12 +9,12 @@ buildscript {
} }
dependencies { dependencies {
classpath 'org.jastadd:jastaddgradle:1.13.3' classpath 'org.jastadd:jastaddgradle:1.13.3'
classpath 'org.jastadd.relast:relast-test:0.2.4' classpath 'org.jastadd.preprocessor:testing:0.2.8'
} }
} }
import org.jastadd.relast.plugin.RelastPlugin import org.jastadd.preprocessor.testing.plugin.PreprocessorPlugin
import org.jastadd.relast.plugin.RelastTest import org.jastadd.preprocessor.testing.plugin.RagConnectTest
plugins { plugins {
id 'java' id 'java'
...@@ -24,7 +25,7 @@ plugins { ...@@ -24,7 +25,7 @@ plugins {
} }
apply plugin: 'jastadd' apply plugin: 'jastadd'
apply plugin: RelastPlugin apply plugin: PreprocessorPlugin
group = 'de.tudresden.inf.st' group = 'de.tudresden.inf.st'
...@@ -55,6 +56,13 @@ dependencies { ...@@ -55,6 +56,13 @@ dependencies {
api group: 'com.google.protobuf', name: 'protobuf-java', version: '3.0.0' api group: 'com.google.protobuf', name: 'protobuf-java', version: '3.0.0'
} }
//task helper {
// doLast {
// println(defaultOnlyRead.inputs.files.files)
// println(defaultOnlyRead.outputs.files.files)
// }
//}
test { test {
useJUnitPlatform { useJUnitPlatform {
excludeTags 'mqtt' excludeTags 'mqtt'
...@@ -88,9 +96,10 @@ task specificTest(type: Test, dependsOn: testClasses) { ...@@ -88,9 +96,10 @@ task specificTest(type: Test, dependsOn: testClasses) {
} }
} }
relastTest { preprocessorTesting {
//noinspection GroovyAssignabilityCheck //noinspection GroovyAssignabilityCheck
compilerLocation = '../libs/relast.jar' relastCompilerLocation = '../libs/relast.jar'
// ragconnectCompilerLocation = '../libs/ragconnect.jar'
} }
File genSrc = file("src/test/java-gen") File genSrc = file("src/test/java-gen")
...@@ -104,323 +113,199 @@ clean { ...@@ -104,323 +113,199 @@ clean {
} }
// --- Test: Example --- // --- Test: Example ---
task preprocessExampleTest(type: JavaExec, group: 'verification') { task compileExampleTest(type: RagConnectTest) {
doFirst { ragconnect {
delete 'src/test/02-after-ragconnect/example/Test.relast', outputDir = file('src/test/02-after-ragconnect/example')
'src/test/02-after-ragconnect/example/MqttHandler.jadd', inputFiles = [file('src/test/01-input/example/Test.relast'),
'src/test/02-after-ragconnect/example/RagConnect.jadd' file('src/test/01-input/example/Test.connect')]
} rootNode = 'Model'
}
classpath = sourceSets.main.runtimeClasspath relast {
main = 'org.jastadd.ragconnect.compiler.Compiler' useJastAddNames = true
args '--o=src/test/02-after-ragconnect/example', grammarName = 'src/test/03-after-relast/example/example'
'src/test/01-input/example/Test.relast', }
'src/test/01-input/example/Test.connect', jastadd {
'--rootNode=Model', jastAddList = 'JastAddList'
'--logReads', '--logWrites' packageName = 'example.ast'
} inputFiles = [file('src/test/01-input/example/Test.jadd')]
}
task compileExampleTest(type: RelastTest) {
useJastAddNames = true
jastAddList = 'JastAddList'
relastFiles 'src/test/02-after-ragconnect/example/Test.relast',
'src/test/02-after-ragconnect/example/RagConnect.relast'
grammarName = 'src/test/03-after-relast/example/example'
packageName = 'example.ast'
moreInputFiles 'src/test/01-input/example/Test.jadd',
'src/test/02-after-ragconnect/example/MqttHandler.jadd',
'src/test/02-after-ragconnect/example/RagConnect.jadd'
} }
compileTestJava.dependsOn compileExampleTest
compileExampleTest.dependsOn preprocessExampleTest
// --- Test: default-only-read --- // --- Test: default-only-read ---
task preprocessDefaultOnlyReadTest(type: JavaExec, group: 'verification') { task compileDefaultOnlyRead(type: RagConnectTest) {
doFirst { ragconnect {
delete 'src/test/02-after-ragconnect/defaultOnlyRead/Test.relast', outputDir = file('src/test/02-after-ragconnect/defaultOnlyRead')
'src/test/02-after-ragconnect/defaultOnlyRead/MqttHandler.jadd', inputFiles = [file('src/test/01-input/defaultOnlyRead/Test.relast'),
'src/test/02-after-ragconnect/defaultOnlyRead/RagConnect.jadd' file('src/test/01-input/defaultOnlyRead/Test.connect')]
} rootNode = 'A'
}
classpath = sourceSets.main.runtimeClasspath relast {
main = 'org.jastadd.ragconnect.compiler.Compiler' useJastAddNames = true
args '--o=src/test/02-after-ragconnect/defaultOnlyRead', grammarName = 'src/test/03-after-relast/defaultOnlyRead/defaultOnlyRead'
'src/test/01-input/defaultOnlyRead/Test.relast', }
'src/test/01-input/defaultOnlyRead/Test.connect', jastadd {
'--rootNode=A' jastAddList = 'JastAddList'
} packageName = 'defaultOnlyRead.ast'
}
task compileDefaultOnlyReadTest(type: RelastTest) {
useJastAddNames = true
jastAddList = 'JastAddList'
relastFiles 'src/test/02-after-ragconnect/defaultOnlyRead/Test.relast',
'src/test/02-after-ragconnect/defaultOnlyRead/RagConnect.relast'
grammarName = 'src/test/03-after-relast/defaultOnlyRead/defaultOnlyRead'
packageName = 'defaultOnlyRead.ast'
moreInputFiles 'src/test/02-after-ragconnect/defaultOnlyRead/MqttHandler.jadd',
'src/test/02-after-ragconnect/defaultOnlyRead/RagConnect.jadd'
} }
compileTestJava.dependsOn compileDefaultOnlyReadTest
compileDefaultOnlyReadTest.dependsOn preprocessDefaultOnlyReadTest
// --- Test: default-only-write --- // --- Test: default-only-write ---
task preprocessDefaultOnlyWriteTest(type: JavaExec, group: 'verification') { task compileDefaultOnlyWrite(type: RagConnectTest) {
doFirst { ragconnect {
delete 'src/test/02-after-ragconnect/defaultOnlyWrite/Test.relast', outputDir = file('src/test/02-after-ragconnect/defaultOnlyWrite')
'src/test/02-after-ragconnect/defaultOnlyWrite/MqttHandler.jadd', inputFiles = [file('src/test/01-input/defaultOnlyWrite/Test.relast'),
'src/test/02-after-ragconnect/defaultOnlyWrite/RagConnect.jadd' file('src/test/01-input/defaultOnlyWrite/Test.connect')]
} rootNode = 'A'
}
classpath = sourceSets.main.runtimeClasspath relast {
main = 'org.jastadd.ragconnect.compiler.Compiler' useJastAddNames = true
args '--o=src/test/02-after-ragconnect/defaultOnlyWrite', grammarName = 'src/test/03-after-relast/defaultOnlyWrite/defaultOnlyWrite'
'src/test/01-input/defaultOnlyWrite/Test.relast', }
'src/test/01-input/defaultOnlyWrite/Test.connect', jastadd {
'--rootNode=A' jastAddList = 'JastAddList'
} packageName = 'defaultOnlyWrite.ast'
inputFiles = [file('src/test/01-input/defaultOnlyWrite/Test.jadd')]
task compileDefaultOnlyWriteTest(type: RelastTest) { }
useJastAddNames = true
jastAddList = 'JastAddList'
relastFiles 'src/test/02-after-ragconnect/defaultOnlyWrite/Test.relast',
'src/test/02-after-ragconnect/defaultOnlyWrite/RagConnect.relast'
grammarName = 'src/test/03-after-relast/defaultOnlyWrite/defaultOnlyWrite'
packageName = 'defaultOnlyWrite.ast'
moreInputFiles 'src/test/01-input/defaultOnlyWrite/Test.jadd',
'src/test/02-after-ragconnect/defaultOnlyWrite/MqttHandler.jadd',
'src/test/02-after-ragconnect/defaultOnlyWrite/RagConnect.jadd'
} }
compileTestJava.dependsOn compileDefaultOnlyWriteTest
compileDefaultOnlyWriteTest.dependsOn preprocessDefaultOnlyWriteTest
// --- Test: read1write2 --- // --- Test: read1write2 ---
task preprocessRead1Write2Test(type: JavaExec, group: 'verification') { task compileRead1write2(type: RagConnectTest) {
doFirst { ragconnect {
delete 'src/test/02-after-ragconnect/read1write2/Test.relast', outputDir = file('src/test/02-after-ragconnect/read1write2')
'src/test/02-after-ragconnect/read1write2/MqttHandler.jadd', inputFiles = [file('src/test/01-input/read1write2/Test.relast'),
'src/test/02-after-ragconnect/read1write2/RagConnect.jadd' file('src/test/01-input/read1write2/Test.connect')]
} rootNode = 'A'
}
classpath = sourceSets.main.runtimeClasspath relast {
main = 'org.jastadd.ragconnect.compiler.Compiler' useJastAddNames = true
args '--o=src/test/02-after-ragconnect/read1write2', grammarName = 'src/test/03-after-relast/read1write2/read1write2'
'src/test/01-input/read1write2/Test.relast', }
'src/test/01-input/read1write2/Test.connect', jastadd {
'--rootNode=A' jastAddList = 'JastAddList'
} packageName = 'read1write2.ast'
inputFiles = [file('src/test/01-input/read1write2/Test.jadd')]
task compileRead1Write2Test(type: RelastTest) { }
useJastAddNames = true
jastAddList = 'JastAddList'
relastFiles 'src/test/02-after-ragconnect/read1write2/Test.relast',
'src/test/02-after-ragconnect/read1write2/RagConnect.relast'
grammarName = 'src/test/03-after-relast/read1write2/read1write2'
packageName = 'read1write2.ast'
moreInputFiles 'src/test/01-input/read1write2/Test.jadd',
'src/test/02-after-ragconnect/read1write2/MqttHandler.jadd',
'src/test/02-after-ragconnect/read1write2/RagConnect.jadd'
} }
compileTestJava.dependsOn compileRead1Write2Test
compileRead1Write2Test.dependsOn preprocessRead1Write2Test
// --- Test: read2write1 --- // --- Test: read2write1 ---
task preprocessRead2Write1Test(type: JavaExec, group: 'verification') { task compileRead2write1(type: RagConnectTest) {
doFirst { ragconnect {
delete 'src/test/02-after-ragconnect/read2write1/Test.relast', outputDir = file('src/test/02-after-ragconnect/read2write1')
'src/test/02-after-ragconnect/read2write1/MqttHandler.jadd', inputFiles = [file('src/test/01-input/read2write1/Test.relast'),
'src/test/02-after-ragconnect/read2write1/RagConnect.jadd' file('src/test/01-input/read2write1/Test.connect')]
} rootNode = 'A'
}
classpath = sourceSets.main.runtimeClasspath relast {
main = 'org.jastadd.ragconnect.compiler.Compiler' useJastAddNames = true
args '--o=src/test/02-after-ragconnect/read2write1', grammarName = 'src/test/03-after-relast/read2write1/read2write1'
'src/test/01-input/read2write1/Test.relast', }
'src/test/01-input/read2write1/Test.connect', jastadd {
'--rootNode=A' jastAddList = 'JastAddList'
} packageName = 'read2write1.ast'
inputFiles = [file('src/test/01-input/read2write1/Test.jadd')]
task compileRead2Write1Test(type: RelastTest) { }
useJastAddNames = true
jastAddList = 'JastAddList'
relastFiles 'src/test/02-after-ragconnect/read2write1/Test.relast',
'src/test/02-after-ragconnect/read2write1/RagConnect.relast'
grammarName = 'src/test/03-after-relast/read2write1/read2write1'
packageName = 'read2write1.ast'
moreInputFiles 'src/test/01-input/read2write1/Test.jadd',
'src/test/02-after-ragconnect/read2write1/MqttHandler.jadd',
'src/test/02-after-ragconnect/read2write1/RagConnect.jadd'
} }
compileTestJava.dependsOn compileRead2Write1Test
compileRead2Write1Test.dependsOn preprocessRead2Write1Test
// --- Test: via --- // --- Test: via ---
task preprocessViaTest(type: JavaExec, group: 'verification') { task compileVia(type: RagConnectTest) {
doFirst { ragconnect {
delete 'src/test/02-after-ragconnect/via/Test.relast', outputDir = file('src/test/02-after-ragconnect/via')
'src/test/02-after-ragconnect/via/MqttHandler.jadd', inputFiles = [file('src/test/01-input/via/Test.relast'),
'src/test/02-after-ragconnect/via/RestHandler.jadd', file('src/test/01-input/via/Test.connect')]
'src/test/02-after-ragconnect/via/RagConnect.jadd' rootNode = 'A'
} protocols = ['mqtt', 'rest']
}
classpath = sourceSets.main.runtimeClasspath relast {
main = 'org.jastadd.ragconnect.compiler.Compiler' useJastAddNames = true
args '--o=src/test/02-after-ragconnect/via', grammarName = 'src/test/03-after-relast/via/via'
'src/test/01-input/via/Test.relast', }
'src/test/01-input/via/Test.connect', jastadd {
'--rootNode=A', jastAddList = 'JastAddList'
'--protocols=mqtt,rest' packageName = 'via.ast'
} inputFiles = [file('src/test/01-input/via/Test.jadd')]
}
task compileViaTest(type: RelastTest) {
useJastAddNames = true
jastAddList = 'JastAddList'
relastFiles 'src/test/02-after-ragconnect/via/Test.relast',
'src/test/02-after-ragconnect/via/RagConnect.relast'
grammarName = 'src/test/03-after-relast/via/via'
packageName = 'via.ast'
moreInputFiles 'src/test/01-input/via/Test.jadd',
'src/test/02-after-ragconnect/via/MqttHandler.jadd',
'src/test/02-after-ragconnect/via/RestHandler.jadd',
'src/test/02-after-ragconnect/via/RagConnect.jadd'
} }
compileTestJava.dependsOn compileViaTest
compileViaTest.dependsOn preprocessViaTest
// --- Test: token-value-send --- // --- Test: token-value-send ---
task preprocessTokenValueSendTest(type: JavaExec, group: 'verification') { task compileTokenValueSend(type: RagConnectTest) {
doFirst { ragconnect {
delete 'src/test/02-after-ragconnect/tokenValueSend/Test.relast', outputDir = file('src/test/02-after-ragconnect/tokenValueSend')
'src/test/02-after-ragconnect/tokenValueSend/MqttHandler.jadd', inputFiles = [file('src/test/01-input/tokenValueSend/Test.relast'),
'src/test/02-after-ragconnect/tokenValueSend/RestHandler.jadd', file('src/test/01-input/tokenValueSend/Test.connect')]
'src/test/02-after-ragconnect/tokenValueSend/RagConnect.jadd' rootNode = 'A'
} }
relast {
classpath = sourceSets.main.runtimeClasspath useJastAddNames = true
main = 'org.jastadd.ragconnect.compiler.Compiler' grammarName = 'src/test/03-after-relast/tokenValueSend/tokenValueSend'
args '--o=src/test/02-after-ragconnect/tokenValueSend', }
'src/test/01-input/tokenValueSend/Test.relast', jastadd {
'src/test/01-input/tokenValueSend/Test.connect', jastAddList = 'JastAddList'
'--rootNode=A' packageName = 'tokenValueSend.ast'
} inputFiles = [file('src/test/01-input/tokenValueSend/Test.jadd')]
}
task compileTokenValueSendTest(type: RelastTest) {
useJastAddNames = true
jastAddList = 'JastAddList'
relastFiles 'src/test/02-after-ragconnect/tokenValueSend/Test.relast',
'src/test/02-after-ragconnect/tokenValueSend/RagConnect.relast'
grammarName = 'src/test/03-after-relast/tokenValueSend/tokenValueSend'
packageName = 'tokenValueSend.ast'
moreInputFiles 'src/test/01-input/tokenValueSend/Test.jadd',
'src/test/02-after-ragconnect/tokenValueSend/MqttHandler.jadd',
'src/test/02-after-ragconnect/tokenValueSend/RagConnect.jadd'
} }
compileTestJava.dependsOn compileTokenValueSendTest
compileTokenValueSendTest.dependsOn preprocessTokenValueSendTest
// --- Test: tutorial --- // --- Test: tutorial ---
task preprocessTutorialTest(type: JavaExec, group: 'verification') { task compileTutorial(type: RagConnectTest) {
doFirst { ragconnect {
delete 'src/test/02-after-ragconnect/tutorial/Test.relast', outputDir = file('src/test/02-after-ragconnect/tutorial')
'src/test/02-after-ragconnect/tutorial/MqttHandler.jadd', inputFiles = [file('src/test/01-input/tutorial/Test.relast'),
'src/test/02-after-ragconnect/tutorial/RagConnect.jadd' file('src/test/01-input/tutorial/Test.connect')]
} rootNode = 'A'
}
classpath = sourceSets.main.runtimeClasspath relast {
main = 'org.jastadd.ragconnect.compiler.Compiler' useJastAddNames = true
args '--o=src/test/02-after-ragconnect/tutorial', grammarName = 'src/test/03-after-relast/tutorial/tutorial'
'src/test/01-input/tutorial/Test.relast', }
'src/test/01-input/tutorial/Test.connect', jastadd {
'--rootNode=A' jastAddList = 'JastAddList'
} packageName = 'tutorial.ast'
inputFiles = [file('src/test/01-input/tutorial/Test.jadd')]
task compileTutorialTest(type: RelastTest) { }
useJastAddNames = true
jastAddList = 'JastAddList'
relastFiles 'src/test/02-after-ragconnect/tutorial/Test.relast',
'src/test/02-after-ragconnect/tutorial/RagConnect.relast'
grammarName = 'src/test/03-after-relast/tutorial/tutorial'
packageName = 'tutorial.ast'
moreInputFiles 'src/test/01-input/tutorial/Test.jadd',
'src/test/02-after-ragconnect/tutorial/MqttHandler.jadd',
'src/test/02-after-ragconnect/tutorial/RagConnect.jadd'
} }
compileTestJava.dependsOn compileTutorialTest
compileTutorialTest.dependsOn preprocessTutorialTest
// --- Test: incremental --- // --- Test: incremental ---
task preprocessIncrementalTest(type: JavaExec, group: 'verification') { task compileIncremental(type: RagConnectTest) {
doFirst { ragconnect {
delete 'src/test/02-after-ragconnect/incremental/Test.relast', outputDir = file('src/test/02-after-ragconnect/incremental')
'src/test/02-after-ragconnect/incremental/MqttHandler.jadd', inputFiles = [file('src/test/01-input/incremental/Test.relast'),
'src/test/02-after-ragconnect/incremental/RagConnect.jadd' file('src/test/01-input/incremental/Test.connect')]
} rootNode = 'A'
}
classpath = sourceSets.main.runtimeClasspath relast {
main = 'org.jastadd.ragconnect.compiler.Compiler' useJastAddNames = true
args '--o=src/test/02-after-ragconnect/incremental', grammarName = 'src/test/03-after-relast/incremental/incremental'
'src/test/01-input/incremental/Test.relast', }
'src/test/01-input/incremental/Test.connect', jastadd {
'--rootNode=A', jastAddList = 'JastAddList'
'--tracing=cache,flush', packageName = 'incremental.ast'
'--incremental=param' inputFiles = [file('src/test/01-input/incremental/Test.jadd')]
} extraOptions = ['--tracing=cache,flush',
'--incremental=param',
task compileIncrementalTest(type: RelastTest) { '--cache=all',
useJastAddNames = true '--rewrite=cnta',
jastAddList = 'JastAddList' '--flush=full']
relastFiles 'src/test/02-after-ragconnect/incremental/Test.relast', }
'src/test/02-after-ragconnect/incremental/RagConnect.relast'
grammarName = 'src/test/03-after-relast/incremental/incremental'
packageName = 'incremental.ast'
moreInputFiles 'src/test/01-input/incremental/Test.jadd',
'src/test/02-after-ragconnect/incremental/MqttHandler.jadd',
'src/test/02-after-ragconnect/incremental/RagConnect.jadd'
extraJastAddOptions '--tracing=cache,flush',
'--incremental=param',
'--cache=all',
'--rewrite=cnta',
'--flush=full'
} }
compileTestJava.dependsOn compileIncrementalTest
compileIncrementalTest.dependsOn preprocessIncrementalTest
// --- Test: mapping --- // --- Test: mapping ---
task preprocessMappingTest(type: JavaExec, group: 'verification') { task compileMapping(type: RagConnectTest) {
doFirst { ragconnect {
delete 'src/test/02-after-ragconnect/mapping/Test.relast', outputDir = file('src/test/02-after-ragconnect/mapping')
'src/test/02-after-ragconnect/mapping/MqttHandler.jadd', inputFiles = [file('src/test/01-input/mapping/Test.relast'),
'src/test/02-after-ragconnect/mapping/RagConnect.jadd' file('src/test/01-input/mapping/Test.connect')]
} rootNode = 'A'
logReads = true
classpath = sourceSets.main.runtimeClasspath logWrites = true
main = 'org.jastadd.ragconnect.compiler.Compiler' verbose = true
args '--o=src/test/02-after-ragconnect/mapping', }
'src/test/01-input/mapping/Test.relast', relast {
'src/test/01-input/mapping/Test.connect', useJastAddNames = true
'--rootNode=A', grammarName = 'src/test/03-after-relast/mapping/mapping'
'--logReads', '--logWrites', '--verbose' }
} jastadd {
jastAddList = 'JastAddList'
task compileMappingTest(type: RelastTest) { packageName = 'mapping.ast'
useJastAddNames = true inputFiles = [file('src/test/01-input/mapping/Test.jadd')]
jastAddList = 'JastAddList' }
relastFiles 'src/test/02-after-ragconnect/mapping/Test.relast',
'src/test/02-after-ragconnect/mapping/RagConnect.relast'
grammarName = 'src/test/03-after-relast/mapping/mapping'
packageName = 'mapping.ast'
moreInputFiles 'src/test/01-input/mapping/Test.jadd',
'src/test/02-after-ragconnect/mapping/MqttHandler.jadd',
'src/test/02-after-ragconnect/mapping/RagConnect.jadd'
} }
compileTestJava.dependsOn compileMappingTest
compileMappingTest.dependsOn preprocessMappingTest
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment