Skip to content
Snippets Groups Projects
Commit a35aea52 authored by René Schöne's avatar René Schöne
Browse files

Split project into base and example.

parents
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
package org.jastadd.ros2rag.tests;
import org.jastadd.ros2rag.compiler.Compiler;
import org.jastadd.ros2rag.compiler.options.CommandLine;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.nio.file.Paths;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class RosToRagTest {
void transform(String inputFile, String outputDir) throws CommandLine.CommandLineException {
System.out.println(Paths.get(".").toAbsolutePath());
assertTrue(Paths.get(inputFile).toFile().exists(), "input file does not exist");
File outputDirFile = Paths.get(outputDir).toFile();
if (outputDirFile.exists()) {
assertTrue(outputDirFile.isDirectory());
if (outputDirFile.list().length != 0) {
System.out.println("output directory is not empty!");
}
} else {
outputDirFile.mkdir();
}
String[] args = {
"--outputDir=" + outputDir,
inputFile
};
new Compiler(args);
}
@Test
void transformMinimalExample() throws CommandLine.CommandLineException {
transform("src/test/resources/MinimalExample.relast", "src/test/resources/out");
}
}
Model ::= RobotArm ZoneModel ;
ZoneModel ::= Size:Position SafetyZone:Zone*;
Zone ::= Position*;
RobotArm ::= Joint* EndEffector /<ShouldUseLowSpeed:Boolean>/ ;
Joint ::= <Name> ;
rel Join.CurrentPosition -> Position ;
EndEffector : Joint;
Position ::= <x:int> <y:int> <z:int> ;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment