{"id":22549841,"url":"https://github.com/openmodelica/openmodelicalibrarytesting","last_synced_at":"2025-04-10T01:53:19.784Z","repository":{"id":37617242,"uuid":"70574835","full_name":"OpenModelica/OpenModelicaLibraryTesting","owner":"OpenModelica","description":"Test script for OMCompiler+OpenModelicaLibraries","archived":false,"fork":false,"pushed_at":"2025-04-02T14:48:55.000Z","size":834,"stargazers_count":10,"open_issues_count":24,"forks_count":14,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T15:36:36.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenModelica.png","metadata":{"files":{"readme":"README.md","changelog":"history.html.tpl","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-11T08:55:10.000Z","updated_at":"2025-04-02T14:49:00.000Z","dependencies_parsed_at":"2024-04-04T19:28:14.854Z","dependency_job_id":"22afd2ad-df06-476c-b009-6a04b8e94b39","html_url":"https://github.com/OpenModelica/OpenModelicaLibraryTesting","commit_stats":{"total_commits":679,"total_committers":9,"mean_commits":75.44444444444444,"dds":0.3254786450662739,"last_synced_commit":"e188a4282537fb2b85e4dce71a478fe321fad39c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenModelica%2FOpenModelicaLibraryTesting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenModelica%2FOpenModelicaLibraryTesting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenModelica%2FOpenModelicaLibraryTesting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenModelica%2FOpenModelicaLibraryTesting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenModelica","download_url":"https://codeload.github.com/OpenModelica/OpenModelicaLibraryTesting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142939,"owners_count":21054671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T16:10:05.734Z","updated_at":"2025-04-10T01:53:19.757Z","avatar_url":"https://github.com/OpenModelica.png","language":"Python","readme":"# OpenModelica Library Testing\n\n[![Continuous Integration](https://github.com/OpenModelica/OpenModelicaLibraryTesting/actions/workflows/test.yml/badge.svg)](https://github.com/OpenModelica/OpenModelicaLibraryTesting/actions/workflows/test.yml)\n[![License: OSMC-PL](https://img.shields.io/badge/license-OSMC--PL-lightgrey.svg)](OSMC-License.txt)\n\nThis repository provides scripts and documentation to run the nightly Modelica library tests for OpenModelica.\n\n## OpenModelica nightly testsuite\n\nSome of the open-source Modelica libraries managed by the [Open Modelica Package Manager](https://github.com/OpenModelica/OMPackageManager) are tested on a daily basis on the OSMC servers.\n\n[Test results reports](testresults.md#open-source-modelica-library-testing-using-openmodelica) are publicly available.\n\nThe configuration file for the regular library nightly testsuite is [conf.json](configs/conf.json). Additional old and non-standard libraries are listed in [conf-old.json](configs/conf-old.json) and [conf-nonstandard.json](configs/conf-nonstandard.json), note that failures in those libraries may be due to the fact that they are not fully complying with the Modelica standard, rather than to OpenModelica issues. The setup of the configuration files is discussed in [conf-howto.md](conf-howto.md).\n\nTest results reports are collected in the https://libraries.openmodelica.org/branches/ directory. The [overview.html](https://libraries.openmodelica.org/branches/overview.html) report gives the results of the regular testsuite with the default C runtime and solvers. Other reports contain the results using the C++ runtime, FMI, daeMode, and the old frontend. Combined reports also include results from the old and nonstandard libraries. The https://libraries.openmodelica.org/branches/history/ directory contains regression reports and plots using different versions (including master) and simulation runtime configurations (C++, daeMode, FMI, old frontend) of OpenModelica.\n\nIf you want to include your open-source library in the testsuite, please open a pull request on [conf.json](configs/conf.json), or open an issue on the [OpenModelica issue tracker](https://github.com/OpenModelica/OpenModelica/issues/new/choose) and ask us to do it for you.\n\n## Running the library testing infrastructure on your own server\n\nThe scripts from this repository can be used to run regression tests for public, private, and commercial Modelica libraries to keep track of coverage with different OpenModelica versions, according to the conditions of the [OSMC-PL license](OSMC-License.txt).\n\n### Dependencies\n\n  - [OpenModelica](https://openmodelica.org)\n  - [Python](https://www.python.org/)\n  - (Optional) Reference simulation result files\n\n### Set-Up\n\n  - Install or build OpenModelica\n    - [Install instructions](https://openmodelica.org/download/download-linux)\n    - [Build instructions](https://github.com/OpenModelica/OpenModelica#readme)\n    - Make sure `omc` is in your `PATH`\n  - Install Python requirements\n    ```bash\n    pip install -r requirements.txt\n    ```\n  - OMC will search for libraries in the location provided with test.py argument `--libraries`.\n    The default value is `/home/username/.openmodelica/libraries/` (Linux) or `%APPDATA%/.openmodelica/libraries` (Windows).\n    - Install your libraries into the location specified with `--libraries`\n      or use `loadFile` command inside `loadFileCommands` in the config JSON:\n      ```yml\n      \"loadFileCommands\": [\n        \"loadFile(\\\"/path/to/package.mo\\\")\"\n      ]\n      ```\n  - Create configs/myConf.json to specify what libraries to test.\n    ```json\n    [\n      {\n        \"library\":\"MyModelicaLibrary\",\n        \"libraryVersion\":\"main\",\n        \"referenceFileExtension\":\"mat\",\n        \"referenceFileNameDelimiter\":\"/\",\n        \"referenceFileNameExtraName\":\"$ClassName\",\n        \"referenceFiles\": \"/path/to/some/SomeDirectory\", // specifies a directory with the files\n        \"referenceFiles\": \"$ENV_VAR/SomeDirectory\", // specifies a directory with the files via an env var\n        \"referenceFiles\":{ // specified as an URL, directory destination, git branch and git directory\n          \"giturl\":\"https://github.com/myName/MyModelicaLibrary-ref\",\n          \"destination\":\"ReferenceFiles/MyModelicaLibrary\",\n          \"git-ref\": \"main\",\n          \"git-directory\": \"ReferenceFiles\"\n        },\n        \"defaultTolerance\": 1e-6, // tolerance for tests if not specified by the model, defaults to 1e-6\n        \"defaultNumberOfIntervals\": 2500, // number of intervals for tests if not specified by the model, defaults to 2500\n        \"ulimitOmc\":800, // specify a max timeout for a model build\n        \"ulimitExe\":300, // specify a max timeout for a model simulation\n        \"ulimitMemory\":62000000, // specify a max for the virtual memory of the running process when building a model\n        \"procOMC\":0, // [if procOMC = 0 use max procs, use procOMC = 1 if not defined, else use the given value] how many CPU cores should be used to run omc (load Modelica libraries in parallel and generate the C code in parallel)\n        \"procCCompile\":0, // [if procCCompile = 0 use max procs, use procCCompile = 1 if not defined, else use the given value] how many CPU cores should be used to compile the generated code\n        \"optlevel\":\"-Os -march=native\" // what optimizations should be used by the C compiler\n      }\n    ]\n    ```\n\n    You can add extra compiler settings\n\n    ```json\n    \"extraCustomCommands\":[\"setCommandLineOptions(\\\"--std=3.2\\\");\"]\n    ```\n    and extra simulation flags\n\n    ```json\n    \"extraSimFlags\": \"-s=ida -nls=kinsol\"\n    ```\n\n    Check `config/conf.json` for more.\n  - If you used `.CI/installLibraries.mos` to test all libraries you'll need to install reference results and set environment variables, see [Reference Results](#reference-results).\n    ```bash\n    export MSLREFERENCE=\"/path/to/ReferenceFiles/\"\n    export REFERENCEFILES=\"/path/to/OpenModelica/testsuite/ReferenceFiles\"\n    export PNLIBREFS=\"/path/to/ReferenceFiles/PNlib/ReferenceFiles\"\n    export THERMOFLUIDSTREAMREFS=\"/path/to/ReferenceFiles/ThermofluidStream-main-regression/ReferenceData\"\n    export THERMOFLUIDSTREAMREFSOM=\"/path/to/ReferenceFiles/ThermofluidStream-OM-regression/ReferenceData\"\n    ```\n\n  - Run the library test\n    ```bash\n    ./test.py --noclean configs/myConf.json\n    ```\n    Use `configs/*.json` to specify what to test.\n    The test results are saved in `sqlite3.db`.\n\n    Options:\n      - `--branch=master`: Branch of OpenModelica\n      - `--fmi=False`: Test FMI\n      - `--output=''`: Result location\n      - `--libraries=~/.openmodelica/libraries/`: Location of Modelica libraries\n      - `--extraflags=''`: Extra compiler flags.\n      - `--extrasimflags=''`: Extra simulation flags.\n      - `--ompython_omhome=''`: Path to OpenModelica for OMPython (can be different to the OM running the tests)\n      - `--noclean=False`: Clean (most) generated files.\n      - `--fmisimulator=''`: The default is nothing but you can use the path to OMSimulator executable or 'fmpy'\n      - `--ulimitvmem=8388608`: Virtual memory limit (in kB)\n      - `--default=[]`: Add a default value for some configuration key, such as --default=ulimitExe=60. The equals sign is mandatory\n      - `-j`,`--jobs`: Number of cores to use for testing, default is 0 (max cores), use 1 to run serial (for large tests) and see procOMC and procCCompile above for more insight into individual test parallelization\n\n  - Generate HTML results\n    ```bash\n    ./report.py configs/myConf.json\n    ```\n  - Upload and backup\n    - Upload HTML files somewhere\n    - backup sqlite3.db\n\n### Reference Results\n\nIf you use the default configs `config/conf.json` and\n`config/conf-c++.json` to test all libraries you need to\ndownload the reference files and make them available by\ndefining `MSLREFERENCE` and `REFERENCEFILES`.\n\nSome result file locations:\n  - Modelica Association: https://github.com/modelica/MAP-LIB_ReferenceResults\n  - PNLib: https://github.com/AMIT-FHBielefeld/PNlib\n  - DLR-SR: https://github.com/DLR-SR/ThermoFluidStream-Regression.git and https://github.com/DLR-SR/PlanarMechanics_ReferenceResults.git\n\n\nTo download the MSL reference files create a file\ninstallReferenceResults.sh with\n```sh\n#!/bin/sh\n\nrefdir=\"/some/path/to/ReferenceFiles\"   # Change the path!\n\n# Update git repo for MSL Reference files\nmkdir -p $refdir/modelica.org/ReferenceResults\ncd $refdir/modelica.org/ReferenceResults\nrm -rf $refdir/MAP-LIB_ReferenceResults/\n\ntest -f MAP-LIB_ReferenceResults.git/config || git clone --bare https://github.com/modelica/MAP-LIB_ReferenceResults.git MAP-LIB_ReferenceResults.git\ncd MAP-LIB_ReferenceResults.git\ngit fetch origin '*:*'\ngit fetch --tags\n\nfor tag in $(git for-each-ref --format=\"%(refname:lstrip=-1)\" refs/heads/)\ndo\n  echo \"tag: $tag\"\n  base=\"$refdir/MAP-LIB_ReferenceResults/$tag\"\n  mkdir -p $base\n  echo \"mkdir -p $base\"\n  git archive --format=tar $tag | (cd $base \u0026\u0026 tar xvf -)\ndone\n```\n\nand run it\n```bash\nchmod a+rx installReferenceResults.sh\n./installReferenceResults.sh\nexport MSLREFERENCE=\"/some/path/to/ReferenceFiles/\"\n```\n\nFor the other libraries just clone the repositories to `/some/path/to/ReferenceFiles/`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenmodelica%2Fopenmodelicalibrarytesting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenmodelica%2Fopenmodelicalibrarytesting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenmodelica%2Fopenmodelicalibrarytesting/lists"}