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 {
repositories {
mavenCentral()
// mavenLocal()
maven {
name "gitlab-maven"
url "https://git-st.inf.tu-dresden.de/api/v4/groups/jastadd/-/packages/maven"
......@@ -8,12 +9,12 @@ buildscript {
}
dependencies {
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.relast.plugin.RelastTest
import org.jastadd.preprocessor.testing.plugin.PreprocessorPlugin
import org.jastadd.preprocessor.testing.plugin.RagConnectTest
plugins {
id 'java'
......@@ -24,7 +25,7 @@ plugins {
}
apply plugin: 'jastadd'
apply plugin: RelastPlugin
apply plugin: PreprocessorPlugin
group = 'de.tudresden.inf.st'
......@@ -55,6 +56,13 @@ dependencies {
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 {
useJUnitPlatform {
excludeTags 'mqtt'
......@@ -88,9 +96,10 @@ task specificTest(type: Test, dependsOn: testClasses) {
}
}
relastTest {
preprocessorTesting {
//noinspection GroovyAssignabilityCheck
compilerLocation = '../libs/relast.jar'
relastCompilerLocation = '../libs/relast.jar'
// ragconnectCompilerLocation = '../libs/ragconnect.jar'
}
File genSrc = file("src/test/java-gen")
......@@ -104,323 +113,199 @@ clean {
}
// --- Test: Example ---
task preprocessExampleTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ragconnect/example/Test.relast',
'src/test/02-after-ragconnect/example/MqttHandler.jadd',
'src/test/02-after-ragconnect/example/RagConnect.jadd'
}
classpath = sourceSets.main.runtimeClasspath
main = 'org.jastadd.ragconnect.compiler.Compiler'
args '--o=src/test/02-after-ragconnect/example',
'src/test/01-input/example/Test.relast',
'src/test/01-input/example/Test.connect',
'--rootNode=Model',
'--logReads', '--logWrites'
}
task compileExampleTest(type: RelastTest) {
task compileExampleTest(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/example')
inputFiles = [file('src/test/01-input/example/Test.relast'),
file('src/test/01-input/example/Test.connect')]
rootNode = 'Model'
}
relast {
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'
}
jastadd {
jastAddList = 'JastAddList'
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'
inputFiles = [file('src/test/01-input/example/Test.jadd')]
}
}
compileTestJava.dependsOn compileExampleTest
compileExampleTest.dependsOn preprocessExampleTest
// --- Test: default-only-read ---
task preprocessDefaultOnlyReadTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ragconnect/defaultOnlyRead/Test.relast',
'src/test/02-after-ragconnect/defaultOnlyRead/MqttHandler.jadd',
'src/test/02-after-ragconnect/defaultOnlyRead/RagConnect.jadd'
}
classpath = sourceSets.main.runtimeClasspath
main = 'org.jastadd.ragconnect.compiler.Compiler'
args '--o=src/test/02-after-ragconnect/defaultOnlyRead',
'src/test/01-input/defaultOnlyRead/Test.relast',
'src/test/01-input/defaultOnlyRead/Test.connect',
'--rootNode=A'
}
task compileDefaultOnlyReadTest(type: RelastTest) {
task compileDefaultOnlyRead(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/defaultOnlyRead')
inputFiles = [file('src/test/01-input/defaultOnlyRead/Test.relast'),
file('src/test/01-input/defaultOnlyRead/Test.connect')]
rootNode = 'A'
}
relast {
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'
}
jastadd {
jastAddList = 'JastAddList'
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 ---
task preprocessDefaultOnlyWriteTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ragconnect/defaultOnlyWrite/Test.relast',
'src/test/02-after-ragconnect/defaultOnlyWrite/MqttHandler.jadd',
'src/test/02-after-ragconnect/defaultOnlyWrite/RagConnect.jadd'
}
classpath = sourceSets.main.runtimeClasspath
main = 'org.jastadd.ragconnect.compiler.Compiler'
args '--o=src/test/02-after-ragconnect/defaultOnlyWrite',
'src/test/01-input/defaultOnlyWrite/Test.relast',
'src/test/01-input/defaultOnlyWrite/Test.connect',
'--rootNode=A'
}
task compileDefaultOnlyWriteTest(type: RelastTest) {
task compileDefaultOnlyWrite(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/defaultOnlyWrite')
inputFiles = [file('src/test/01-input/defaultOnlyWrite/Test.relast'),
file('src/test/01-input/defaultOnlyWrite/Test.connect')]
rootNode = 'A'
}
relast {
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'
}
jastadd {
jastAddList = 'JastAddList'
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'
inputFiles = [file('src/test/01-input/defaultOnlyWrite/Test.jadd')]
}
}
compileTestJava.dependsOn compileDefaultOnlyWriteTest
compileDefaultOnlyWriteTest.dependsOn preprocessDefaultOnlyWriteTest
// --- Test: read1write2 ---
task preprocessRead1Write2Test(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ragconnect/read1write2/Test.relast',
'src/test/02-after-ragconnect/read1write2/MqttHandler.jadd',
'src/test/02-after-ragconnect/read1write2/RagConnect.jadd'
}
classpath = sourceSets.main.runtimeClasspath
main = 'org.jastadd.ragconnect.compiler.Compiler'
args '--o=src/test/02-after-ragconnect/read1write2',
'src/test/01-input/read1write2/Test.relast',
'src/test/01-input/read1write2/Test.connect',
'--rootNode=A'
}
task compileRead1Write2Test(type: RelastTest) {
task compileRead1write2(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/read1write2')
inputFiles = [file('src/test/01-input/read1write2/Test.relast'),
file('src/test/01-input/read1write2/Test.connect')]
rootNode = 'A'
}
relast {
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'
}
jastadd {
jastAddList = 'JastAddList'
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'
inputFiles = [file('src/test/01-input/read1write2/Test.jadd')]
}
}
compileTestJava.dependsOn compileRead1Write2Test
compileRead1Write2Test.dependsOn preprocessRead1Write2Test
// --- Test: read2write1 ---
task preprocessRead2Write1Test(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ragconnect/read2write1/Test.relast',
'src/test/02-after-ragconnect/read2write1/MqttHandler.jadd',
'src/test/02-after-ragconnect/read2write1/RagConnect.jadd'
}
classpath = sourceSets.main.runtimeClasspath
main = 'org.jastadd.ragconnect.compiler.Compiler'
args '--o=src/test/02-after-ragconnect/read2write1',
'src/test/01-input/read2write1/Test.relast',
'src/test/01-input/read2write1/Test.connect',
'--rootNode=A'
}
task compileRead2Write1Test(type: RelastTest) {
task compileRead2write1(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/read2write1')
inputFiles = [file('src/test/01-input/read2write1/Test.relast'),
file('src/test/01-input/read2write1/Test.connect')]
rootNode = 'A'
}
relast {
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'
}
jastadd {
jastAddList = 'JastAddList'
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'
inputFiles = [file('src/test/01-input/read2write1/Test.jadd')]
}
}
compileTestJava.dependsOn compileRead2Write1Test
compileRead2Write1Test.dependsOn preprocessRead2Write1Test
// --- Test: via ---
task preprocessViaTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ragconnect/via/Test.relast',
'src/test/02-after-ragconnect/via/MqttHandler.jadd',
'src/test/02-after-ragconnect/via/RestHandler.jadd',
'src/test/02-after-ragconnect/via/RagConnect.jadd'
}
classpath = sourceSets.main.runtimeClasspath
main = 'org.jastadd.ragconnect.compiler.Compiler'
args '--o=src/test/02-after-ragconnect/via',
'src/test/01-input/via/Test.relast',
'src/test/01-input/via/Test.connect',
'--rootNode=A',
'--protocols=mqtt,rest'
}
task compileViaTest(type: RelastTest) {
task compileVia(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/via')
inputFiles = [file('src/test/01-input/via/Test.relast'),
file('src/test/01-input/via/Test.connect')]
rootNode = 'A'
protocols = ['mqtt', 'rest']
}
relast {
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'
}
jastadd {
jastAddList = 'JastAddList'
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'
inputFiles = [file('src/test/01-input/via/Test.jadd')]
}
}
compileTestJava.dependsOn compileViaTest
compileViaTest.dependsOn preprocessViaTest
// --- Test: token-value-send ---
task preprocessTokenValueSendTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ragconnect/tokenValueSend/Test.relast',
'src/test/02-after-ragconnect/tokenValueSend/MqttHandler.jadd',
'src/test/02-after-ragconnect/tokenValueSend/RestHandler.jadd',
'src/test/02-after-ragconnect/tokenValueSend/RagConnect.jadd'
}
classpath = sourceSets.main.runtimeClasspath
main = 'org.jastadd.ragconnect.compiler.Compiler'
args '--o=src/test/02-after-ragconnect/tokenValueSend',
'src/test/01-input/tokenValueSend/Test.relast',
'src/test/01-input/tokenValueSend/Test.connect',
'--rootNode=A'
}
task compileTokenValueSendTest(type: RelastTest) {
task compileTokenValueSend(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/tokenValueSend')
inputFiles = [file('src/test/01-input/tokenValueSend/Test.relast'),
file('src/test/01-input/tokenValueSend/Test.connect')]
rootNode = 'A'
}
relast {
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'
}
jastadd {
jastAddList = 'JastAddList'
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'
inputFiles = [file('src/test/01-input/tokenValueSend/Test.jadd')]
}
}
compileTestJava.dependsOn compileTokenValueSendTest
compileTokenValueSendTest.dependsOn preprocessTokenValueSendTest
// --- Test: tutorial ---
task preprocessTutorialTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ragconnect/tutorial/Test.relast',
'src/test/02-after-ragconnect/tutorial/MqttHandler.jadd',
'src/test/02-after-ragconnect/tutorial/RagConnect.jadd'
}
classpath = sourceSets.main.runtimeClasspath
main = 'org.jastadd.ragconnect.compiler.Compiler'
args '--o=src/test/02-after-ragconnect/tutorial',
'src/test/01-input/tutorial/Test.relast',
'src/test/01-input/tutorial/Test.connect',
'--rootNode=A'
}
task compileTutorialTest(type: RelastTest) {
task compileTutorial(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/tutorial')
inputFiles = [file('src/test/01-input/tutorial/Test.relast'),
file('src/test/01-input/tutorial/Test.connect')]
rootNode = 'A'
}
relast {
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'
}
jastadd {
jastAddList = 'JastAddList'
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'
inputFiles = [file('src/test/01-input/tutorial/Test.jadd')]
}
}
compileTestJava.dependsOn compileTutorialTest
compileTutorialTest.dependsOn preprocessTutorialTest
// --- Test: incremental ---
task preprocessIncrementalTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ragconnect/incremental/Test.relast',
'src/test/02-after-ragconnect/incremental/MqttHandler.jadd',
'src/test/02-after-ragconnect/incremental/RagConnect.jadd'
}
classpath = sourceSets.main.runtimeClasspath
main = 'org.jastadd.ragconnect.compiler.Compiler'
args '--o=src/test/02-after-ragconnect/incremental',
'src/test/01-input/incremental/Test.relast',
'src/test/01-input/incremental/Test.connect',
'--rootNode=A',
'--tracing=cache,flush',
'--incremental=param'
}
task compileIncrementalTest(type: RelastTest) {
task compileIncremental(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/incremental')
inputFiles = [file('src/test/01-input/incremental/Test.relast'),
file('src/test/01-input/incremental/Test.connect')]
rootNode = 'A'
}
relast {
useJastAddNames = true
jastAddList = 'JastAddList'
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'
}
jastadd {
jastAddList = 'JastAddList'
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',
inputFiles = [file('src/test/01-input/incremental/Test.jadd')]
extraOptions = ['--tracing=cache,flush',
'--incremental=param',
'--cache=all',
'--rewrite=cnta',
'--flush=full'
'--flush=full']
}
}
compileTestJava.dependsOn compileIncrementalTest
compileIncrementalTest.dependsOn preprocessIncrementalTest
// --- Test: mapping ---
task preprocessMappingTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ragconnect/mapping/Test.relast',
'src/test/02-after-ragconnect/mapping/MqttHandler.jadd',
'src/test/02-after-ragconnect/mapping/RagConnect.jadd'
}
classpath = sourceSets.main.runtimeClasspath
main = 'org.jastadd.ragconnect.compiler.Compiler'
args '--o=src/test/02-after-ragconnect/mapping',
'src/test/01-input/mapping/Test.relast',
'src/test/01-input/mapping/Test.connect',
'--rootNode=A',
'--logReads', '--logWrites', '--verbose'
}
task compileMappingTest(type: RelastTest) {
task compileMapping(type: RagConnectTest) {
ragconnect {
outputDir = file('src/test/02-after-ragconnect/mapping')
inputFiles = [file('src/test/01-input/mapping/Test.relast'),
file('src/test/01-input/mapping/Test.connect')]
rootNode = 'A'
logReads = true
logWrites = true
verbose = true
}
relast {
useJastAddNames = true
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'
}
jastadd {
jastAddList = 'JastAddList'
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'
inputFiles = [file('src/test/01-input/mapping/Test.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