Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't load libraries when looking for builtin name (#9571)
- Don't load libraries when looking for a builtin element during name lookup, since that means we're in an encapsulated class and the library might already be loaded and should not be loaded again. - Disable reporting of times when running `checkAllModelsRecursive` in a testcase to make it possible to test it. Fixes #9554
- Loading branch information
Showing
4 changed files
with
81 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
testsuite/openmodelica/interactive-API/checkAllModelsRecursive1.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// name: checkAllModelsRecursive1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
loadString(" | ||
package TestCheckAll | ||
model A | ||
parameter Modelica.SIunits.Voltage V = 10; | ||
end A; | ||
encapsulated model B | ||
parameter Modelica.SIunits.Current A = 5; | ||
end B; | ||
model C | ||
parameter Modelica.SIunits.Voltage V = 10; | ||
end C; | ||
annotation(uses(Modelica(version = \"3.2.3\"))); | ||
end TestCheckAll; | ||
"); | ||
|
||
checkAllModelsRecursive(TestCheckAll); | ||
getErrorString(); | ||
|
||
// Result: | ||
// true | ||
// Number of classes to check: 4 | ||
// Checking skipped: package TestCheckAll... | ||
// Checking: model TestCheckAll.A... OK | ||
// Check of TestCheckAll.A completed successfully. | ||
// Class TestCheckAll.A has 0 equation(s) and 0 variable(s). | ||
// 0 of these are trivial equation(s). | ||
// Error String: | ||
// | ||
// Error Buffer: | ||
// Notification: Automatically loaded package Modelica 3.2.3 due to uses annotation from TestCheckAll. | ||
// Notification: Automatically loaded package Complex 3.2.3 due to uses annotation from Modelica. | ||
// Notification: Automatically loaded package ModelicaServices 3.2.3 due to uses annotation from Modelica. | ||
// | ||
// #[+], TestCheckAll.A | ||
// ------------------------------------------------------------------------- | ||
// Checking: encapsulated model TestCheckAll.B... FAILED! | ||
// | ||
// Error String: | ||
// | ||
// Error Buffer: | ||
// [<interactive>:7:6-7:46:writable] Error: Class Modelica.SIunits.Current not found in scope B. | ||
// | ||
// #[-], TestCheckAll.B | ||
// ------------------------------------------------------------------------- | ||
// Checking: model TestCheckAll.C... OK | ||
// Check of TestCheckAll.C completed successfully. | ||
// Class TestCheckAll.C has 0 equation(s) and 0 variable(s). | ||
// 0 of these are trivial equation(s). | ||
// Error String: | ||
// | ||
// Error Buffer: | ||
// | ||
// #[+], TestCheckAll.C | ||
// ------------------------------------------------------------------------- | ||
// "Number of classes checked / failed: 4/1" | ||
// "" | ||
// endResult |