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

Move tests to separate Gradle module.

parent b7706c07
......@@ -157,5 +157,3 @@ jastadd {
}
generateAst.dependsOn relast
apply from: 'test.build.gradle'
......@@ -71,12 +71,17 @@ public class Compiler {
printMessage("Writing output files");
// copy MqttUpdater into outputDir
final String mqttUpdaterFileName = "MqttUpdater.jadd";
try {
Files.copy(Paths.get("src", "main", "resources", "MqttUpdater.jadd"),
Paths.get(outputDir, "MqttUpdater.jadd"),
InputStream inputStream = Compiler.class.getClassLoader().getResourceAsStream(mqttUpdaterFileName);
if (inputStream == null) {
throw new CompilerException("Could not open " + mqttUpdaterFileName);
}
Files.copy(inputStream,
Paths.get(outputDir, mqttUpdaterFileName),
StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
throw new CompilerException("Could not copy MqttUpdater.java", e);
throw new CompilerException("Could not copy " + mqttUpdaterFileName, e);
}
writeToFile(outputDir + "/Grammar.relast", ros2Rag.getProgram().generateAbstractGrammar());
writeToFile(outputDir + "/ROS2RAG.jadd", ros2Rag.generateAspect(optionRootNode.getValue()));
......
import org.jastadd.relast.plugin.RelastPlugin
import org.jastadd.relast.plugin.RelastTest
apply plugin: 'jastadd'
apply plugin: 'application'
apply plugin: RelastPlugin
relastTest {
compilerLocation = '../libs/relast.jar'
sourceCompatibility = 1.8
repositories {
jcenter()
}
buildscript {
repositories.jcenter()
dependencies {
classpath 'org.jastadd:jastaddgradle:1.13.3'
}
}
dependencies {
runtime 'org.jastadd:jastadd:2.3.4'
implementation project(':ros2rag.base')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.0'
testImplementation 'org.assertj:assertj-core:3.12.1'
......@@ -15,6 +28,16 @@ dependencies {
testImplementation 'com.google.protobuf:protobuf-java:3.0.0'
}
test {
useJUnitPlatform()
maxHeapSize = '1G'
}
relastTest {
compilerLocation = '../libs/relast.jar'
}
sourceSets {
test {
java.srcDir "src/test/java-gen"
......@@ -22,7 +45,6 @@ sourceSets {
}
task preprocessExampleTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ros2rag/example/Grammar.relast',
'src/test/02-after-ros2rag/example/MqttUpdater.java',
......
rootProject.name = 'ros2rag'
include 'relast.preprocessor'
include 'ros2rag.base'
include 'ros2rag.tests'
include 'ros2rag.example'
include 'ros2rag.senderstub'
include 'ros2rag.receiverstub'
include 'relast.preprocessor'
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