Skip to content

Commit

Permalink
Add enclave tests and other nitpicks from merge
Browse files Browse the repository at this point in the history
  • Loading branch information
erlingrj committed Oct 2, 2023
1 parent acb9be9 commit ff27f40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ public void runGenericsTests() {
super.runGenericsTests();
}

@Test
@Override
public void runEnclaveTests() {
super.runEnclaveTests();
}

@Test
@Override
public void runTargetSpecificTests() {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/lflang/ast/ASTUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,12 @@ public static ReactorInstance createMainReactorInstance(
return null;
}
// Inform the run-time of the breadth/parallelism of the reaction graph
var breadth = reactionInstanceGraph.getBreadth();
var breadth = reactionInstanceGraph.getBreadth(main);
if (breadth == 0) {
messageReporter.nowhere().warning("The program has no reactions");
} else {
targetConfig.compileDefinitions.put(
"LF_REACTION_GRAPH_BREADTH", String.valueOf(reactionInstanceGraph.getBreadth()));
"LF_REACTION_GRAPH_BREADTH", String.valueOf(breadth));
}
return main;
}
Expand Down
30 changes: 1 addition & 29 deletions core/src/main/java/org/lflang/generator/c/CGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2141,35 +2141,7 @@ public Target getTarget() {
////////////////////////////////////////////////////////////
//// Private methods

/**
* If a main or federated reactor has been declared, create a ReactorInstance for this top level.
* This will also assign levels to reactions, then, if the program is federated, perform an AST
* transformation to disconnect connections between federates.
*/
private void createMainReactorInstance() {
if (this.mainDef != null) {
if (this.main == null) {
// Recursively build instances.
this.main =
new ReactorInstance(toDefinition(mainDef.getReactorClass()), messageReporter, reactors);
var reactionInstanceGraph = this.main.assignLevels();
if (reactionInstanceGraph.nodeCount() > 0) {
messageReporter
.nowhere()
.error("Main reactor has causality cycles. Skipping code generation.");
return;
}
if (hasDeadlines) {
this.main.assignDeadlines();
}
// Inform the run-time of the breadth/parallelism of the reaction graph
var breadth = reactionInstanceGraph.getBreadth(this.main);
targetConfig.compileDefinitions.put("LF_REACTION_GRAPH_BREADTH", String.valueOf(breadth));
}
}
}

/**
/**
* Generate an array of self structs for the reactor and one for each of its children.
*
* @param r The reactor instance.
Expand Down

0 comments on commit ff27f40

Please sign in to comment.