Skip to content

Commit

Permalink
Merge branch 'lenaRB:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
audrey-jardin committed Dec 12, 2023
2 parents 20f45d8 + 97aa98a commit 59b40c3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
13 changes: 9 additions & 4 deletions src/main/java/crml/compiler/CRMLC.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package crml.compiler;

import static org.junit.jupiter.api.Assertions.fail;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
Expand Down Expand Up @@ -80,6 +78,13 @@ public static void main( String[] args ) throws Exception {
return;
}

if(cmd.simulate != null)
cs.verifModelFolder = cmd.simulate;

if(cmd.verify != null)
cs.referenceResFolder = cmd.verify;


File out_dir = new File(cmd.outputDir);
out_dir.mkdir();

Expand All @@ -96,7 +101,7 @@ public static void main( String[] args ) throws Exception {
if(test.endsWith(".crml")) {
logger.trace("Translating: " + test);
parse_file(path, test, out_dir.getPath(), cmd.stacktrace, cmd.printAST , cmd.generateExternal);
if(cmd.simulate){
if(cmd.simulate!=null){
String msg;
try {
msg = OMCUtil.compile(test, path, cs);
Expand All @@ -113,7 +118,7 @@ public static void main( String[] args ) throws Exception {
} else if (file.isFile()){
logger.trace("Translating: " + file);
parse_file("", path, out_dir.getPath(), cmd.stacktrace, cmd.printAST ,cmd.generateExternal);
if(cmd.simulate){
if(cmd.simulate!=null){
String msg;
try {
msg = OMCUtil.compile(file.getPath(), "", cs);
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/crml/compiler/CommandLineArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ public class CommandLineArgs {
@Parameter(names = "--help", help = true)
public boolean help;

// TODO
@Parameter(names = "--simulate", description = "simulate the files passed in parameters")
public boolean simulate;
@Parameter(names = "--simulate", description = "simulate the files passed in parameters, takes the path to the additional omc files")
public String simulate = null;

// TODO
@Parameter(names = "--verify", description = "verify the files passed in parameters")
public boolean verify;
@Parameter(names = "--verify", description = "verify the files passed in parameters, takes the path to the reference files")
public String verify = null;

@Parameter(names = "--testsuiteETL", description = "run just the ETL tests")
public boolean testsuiteETL;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/crml/compiler/TestListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public void testPlanExecutionFinished(TestPlan testPlan) {

private void processTestNode(ExtentTest testKlass, TestIdentifier test) {
final ExtentTest node = testKlass.createNode(test.getDisplayName());
if(test.isContainer()){
return;
}
if (SKIPPED.containsKey(test)) {
node.skip(SKIPPED.get(test));
System.out.printf("Marking test [%s] as skipped%n", test.getDisplayName());
Expand Down
6 changes: 0 additions & 6 deletions src/test/java/ctests/Util.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package ctests;

import static org.junit.jupiter.api.Assertions.fail;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.concurrent.TimeUnit;

import crml.compiler.CompileSettings;
import crml.compiler.ModelicaSimulationException;
Expand Down

0 comments on commit 59b40c3

Please sign in to comment.