Skip to content
Snippets Groups Projects
Commit 54bfb17b authored by Cookiebowser's avatar Cookiebowser
Browse files

added SetRelation test

parent da7e2d82
Branches
No related tags found
1 merge request!28Rust support
package de.hhu.stups.codegenerator.rust;
import org.junit.Test;
public class TestOthers extends TestRS{
@Test
public void test_SetRelationConstructs() throws Exception {
testRSMC("SetRelationConstructs", true);
}
}
...@@ -4,6 +4,7 @@ import de.hhu.stups.codegenerator.CodeGenerator; ...@@ -4,6 +4,7 @@ import de.hhu.stups.codegenerator.CodeGenerator;
import de.hhu.stups.codegenerator.GeneratorMode; import de.hhu.stups.codegenerator.GeneratorMode;
import java.io.*; import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.Arrays; import java.util.Arrays;
...@@ -56,15 +57,25 @@ public class TestRS { ...@@ -56,15 +57,25 @@ public class TestRS {
Path mchPath = Paths.get(CodeGenerator.class.getClassLoader() Path mchPath = Paths.get(CodeGenerator.class.getClassLoader()
.getResource("de/hhu/stups/codegenerator/" + machine + ".mch").toURI()); .getResource("de/hhu/stups/codegenerator/" + machine + ".mch").toURI());
CodeGenerator codeGenerator = new CodeGenerator(); CodeGenerator codeGenerator = new CodeGenerator();
List<Path> rsFilePaths = codeGenerator.generate(mchPath, GeneratorMode.RS, List<Path> rsFilePaths = codeGenerator.generate(mchPath,
false, String.valueOf(Integer.MIN_VALUE), GeneratorMode.RS,
String.valueOf(Integer.MAX_VALUE), "10", false,
modelChecking, false,true, String.valueOf(Integer.MIN_VALUE),
addition, false, false, null); String.valueOf(Integer.MAX_VALUE),
"10",
modelChecking,
false,
true,
addition,
false,
false,
null,
null);
Path typesPath = Paths.get(this.getClass().getClassLoader().getResource("./").toURI()).getParent().getParent().getParent().getParent().resolve(Paths.get("btypes_primitives/src/main/rust/bmachine/src")); Path typesPath = Paths.get(this.getClass().getClassLoader().getResource("./").toURI()).getParent().getParent().getParent().getParent().resolve(Paths.get("btypes_primitives/src/main/rust/bmachine/src"));
Files.createDirectories(typesPath);
File[] oldFiles = typesPath.toFile().listFiles(); File[] oldFiles = typesPath.toFile().listFiles();
if (oldFiles != null && oldFiles.length > 0) Arrays.stream(oldFiles).forEach(file -> file.delete()); if (oldFiles != null && oldFiles.length > 0) Arrays.stream(oldFiles).forEach(this::cleanUp);
rsFilePaths = rsFilePaths.stream().map(file -> { rsFilePaths = rsFilePaths.stream().map(file -> {
Path dest = typesPath.resolve(Paths.get(file.toFile().getName())); Path dest = typesPath.resolve(Paths.get(file.toFile().getName()));
file.toFile().renameTo(dest.toFile()); file.toFile().renameTo(dest.toFile());
......
MODEL CHECKING SUCCESSFUL
Number of States: 1
Number of Transitions: 1
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment