Skip to content

Commit

Permalink
Add a check for getAvailablePackageVersions (#7554)
Browse files Browse the repository at this point in the history
Since the package manager cannot be used in the testsuite, the check
is performed while creating the library structure.
  • Loading branch information
sjoelund committed Jun 14, 2021
1 parent 547861f commit 12ee6bd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
14 changes: 13 additions & 1 deletion testsuite/libraries-for-testing/index.mos
Expand Up @@ -18,6 +18,18 @@ if 0 <> system("cp index.json .openmodelica/libraries/") then
print("Failed to cp index.json");
exit(1);
end if;
vers:=OpenModelica.Scripting.getAvailablePackageVersions(Modelica, "3.2.3");
if size(vers,1) <> 1 then
print("getAvailablePackageVersions(Modelica, \"3.2.3\") returned " + String(size(vers,1)) + " results\n");
print(getErrorString());
exit(1);
end if;
if vers[1] <> "3.2.3+maint.om" then
print("getAvailablePackageVersions(Modelica, \"3.2.3\") returned " + vers[1] + "\n");
print(getErrorString());
exit(1);
end if;

if not installPackage(BioChem, "1.0.1+msl.3.2.1", exactMatch=true) then
print("BioChem 1.0.1+msl.3.2.1 failed
");
Expand Down Expand Up @@ -174,4 +186,4 @@ if not installPackage(WasteWater, "2.1.0", exactMatch=true) then
print(getErrorString());
exit(1);
end if;
system("touch .openmodelica/libraries/20200610130629.stamp")
system("touch .openmodelica/libraries/20200610130629.stamp")
11 changes: 11 additions & 0 deletions testsuite/libraries-for-testing/update.py
Expand Up @@ -89,6 +89,17 @@
print("Failed to cp index.json");
exit(1);
end if;
vers:=OpenModelica.Scripting.getAvailablePackageVersions(Modelica, "3.2.3");
if size(vers,1) <> 1 then
print("getAvailablePackageVersions(Modelica, \"3.2.3\") returned " + String(size(vers,1)) + " results\n");
print(getErrorString());
exit(1);
end if;
if vers[1] <> "3.2.3+maint.om" then
print("getAvailablePackageVersions(Modelica, \"3.2.3\") returned " + vers[1] + "\n");
print(getErrorString());
exit(1);
end if;
''')
for lib in desired.keys():
for version in desired[lib]:
Expand Down

0 comments on commit 12ee6bd

Please sign in to comment.