Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report unsupported target properties as errors #2217

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions core/src/main/java/org/lflang/target/TargetConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,9 @@ protected void load(JsonObject jsonObject, MessageReporter messageReporter) {
* @param stage2 The second stage an the error reporter through which to report the warning.
*/
public void reportUnsupportedTargetProperty(String name, MessageReporter.Stage2 stage2) {
stage2.warning(
stage2.error(
String.format(
"The target property '%s' is not supported by the %s target and is thus ignored.",
name, this.target));
"The target property '%s' is not supported by the %s target.", name, this.target));
stage2.info("Recognized properties are: " + this.listOfRegisteredProperties());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1905,11 +1905,11 @@ public void testInvalidTargetParam() throws Exception {
var model = parseWithoutError(testCase);
List<Issue> issues = validator.validate(model);
Assertions.assertTrue(issues.size() == 2);
validator.assertWarning(
validator.assertError(
model,
LfPackage.eINSTANCE.getKeyValuePair(),
null,
"The target property 'foobarbaz' is not supported by the C target and is thus ignored.");
"The target property 'foobarbaz' is not supported by the C target.");
}

@Test
Expand All @@ -1922,12 +1922,11 @@ public void testTargetParamNotSupportedForTarget() throws Exception {
var model = parseWithoutError(testCase);
List<Issue> issues = validator.validate(model);
Assertions.assertTrue(issues.size() == 2);
validator.assertWarning(
validator.assertError(
model,
LfPackage.eINSTANCE.getKeyValuePair(),
null,
"The target property 'cargo-features' is not supported by the Python target and is thus"
+ " ignored.");
"The target property 'cargo-features' is not supported by the Python target.");
}

@Test
Expand Down
3 changes: 1 addition & 2 deletions test/C/src/concurrent/Threaded.lf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
// that without threads, this takes more than 800 msec to complete 200 msec of logical time. See
// ThreadedMultiport for a parameterized version of this.
target C {
timeout: 2 sec,
flags: "" // Disable compiler optimization so that TakeTime actually takes time.
timeout: 2 sec
}

reactor Source {
Expand Down
3 changes: 1 addition & 2 deletions test/C/src/concurrent/ThreadedMultiport.lf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Check multiport capabilities on Outputs.
target C {
timeout: 2 sec,
flags: "" // Disable compiler optimization so that TakeTime actually takes time.
timeout: 2 sec
}

reactor Source(width: int = 4) {
Expand Down
3 changes: 1 addition & 2 deletions test/C/src/concurrent/ThreadedThreaded.lf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
// of this.
target C {
timeout: 2 sec,
tracing: true,
flags: "" // Disable compiler optimization so that TakeTime actually takes time.
tracing: true
}

reactor Source {
Expand Down
1 change: 0 additions & 1 deletion test/C/src/concurrent/Tracing.lf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
target C {
timeout: 2 sec,
tracing: true,
flags: "", // Disable compiler optimization so that TakeTime actually takes time.
logging: DEBUG
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* @author Edward A. Lee
*/
target C {
flags: "-Wall",
coordination: centralized,
coordination-options: {
advance-message-interval: 100 msec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* @author Soroush Bateni
*/
target C {
flags: "-Wall",
coordination: centralized,
coordination-options: {
advance-message-interval: 100 msec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* @author Soroush Bateni
*/
target C {
flags: "-Wall",
coordination: centralized,
coordination-options: {
advance-message-interval: 100 msec
Expand Down
Loading