[ClavaWeaver] Adds ClavaWeaverTester.set(), for arbitrary options
@@ -23,6 +23,7 @@ import org.lara.interpreter.joptions.config.interpreter.LaraiKeys;
import org.lara.interpreter.joptions.config.interpreter.VerboseLevel;
import org.lara.interpreter.joptions.keys.FileList;
import org.lara.interpreter.joptions.keys.OptionalFile;
+import org.suikasoft.jOptions.Datakey.DataKey;
import org.suikasoft.jOptions.Interfaces.DataStore;
import larai.LaraI;
@@ -52,6 +53,7 @@ public class ClavaWeaverTester {
private String srcPackage;
private String resultPackage;
private String resultsFile;
+ private final DataStore additionalSettings;
// private boolean debug;
public ClavaWeaverTester(String basePackage, Standard standard, String compilerFlags) {
@@ -63,6 +65,7 @@ public class ClavaWeaverTester {
srcPackage = null;
resultPackage = null;
resultsFile = null;
+ additionalSettings = DataStore.newInstance("Additional Settings");
// debug = false;
}
@@ -103,6 +106,12 @@ public class ClavaWeaverTester {
this.resultsFile = resultsFile;
}
+ public <T, ET extends T> ClavaWeaverTester set(DataKey<T> key, ET value) {
+ this.additionalSettings.set(key, value);
+
+ return this;
+ }
+
private String sanitizePackage(String packageName) {
String sanitizedPackage = packageName;
if (!sanitizedPackage.endsWith("/")) {
@@ -212,6 +221,9 @@ public class ClavaWeaverTester {
data.set(CxxWeaverOption.CLEAN_INTERMEDIATE_FILES, false);
}
+ // Add additional settings
+ data.addAll(additionalSettings);
+
CxxWeaver weaver = new CxxWeaver();
try {
boolean result = LaraI.exec(data, weaver);
