Giter VIP home page Giter VIP logo

openmodelicalibrarytesting's Introduction

OpenModelica Library Testing

License: OSMC-PL

This repository provides scripts to run the nightly Modelica library tests for OpenModelica.

The scripts from this repository can be uses to run regression tests for public, non-public or commercial Modelica libraries to keep track of coverage with different OpenModelica versions.

Dependencies (Linux)

Set-Up

  • Install or build OpenModelica

  • Install Python requirements

    pip install -r requirements.txt
  • Install libraries you want to test

    • (Optional) Remove already installed libraries

      rm -rf ~/.openmodelica/libraries/
      rm -rf /path/to/OpenModelica/build/lib/omlibraries
    • Install all available libraries.

      /path/to/omc .CI/installLibraries.mos

      or

    • Install your libraries.

  • Create configs/myConf.json to specify what libraries to test.

    [
      {
        "library":"MyModelicaLibrary",
        "libraryVersion":"master",
        "referenceFileExtension":"mat",
        "referenceFileNameDelimiter":"/",
        "referenceFileNameExtraName":"$ClassName",
        "referenceFiles":{
          "giturl":"https://github.com/myName/MyModelicaLibrary-ref",
          "destination":"ReferenceFiles/MyModelicaLibrary"
        },
        "optlevel":"-Os -march=native"
      }
    ]

    You can add extra compiler settings

    "extraCustomCommands":["setCommandLineOptions(\"--std=3.2\");"]

    and more. Check config/conf.json for more.

  • If you used .CI/installLibraries.mos to test all libraries you'll need to install reference results and set environment variables, see Reference Results.

    export MSLREFERENCE="/path/to/ReferenceFiles/"
    export REFERENCEFILES="/path/to/OpenModelica/testsuite/ReferenceFiles"
    export PNLIBREFS="/path/to/ReferenceFiles/PNlib/ReferenceFiles"
    export THERMOFLUIDSTREAMREFS="/path/to/ReferenceFiles/ThermofluidStream-main-regression/ReferenceData"
    export THERMOFLUIDSTREAMREFSOM="/path/to/ReferenceFiles/ThermofluidStream-OM-regression/ReferenceData"
  • Run the library test

    ./test.py --noclean configs/myConf.json

    Use configs/*.json to specify what to test. The test results are saved in sqlite3.db.

  • Generate HTML results

    ./report.py configs/myConf.json
  • Upload and backup

    • Upload HTML files somewhere
    • backup sqlite3.db

Reference Results

If you use the default configs config/conf.json and config/conf-c++.json to test all libraries you need to download the reference files and make them available by defining MSLREFERENCE and REFERENCEFILES.

Some result file locations:

To download the MSL reference files create a file installReferenceResults.sh with

#!/bin/sh

refdir="/some/path/to/ReferenceFiles"   # Change the path!

# Update git repo for MSL Reference files
mkdir -p $refdir/modelica.org/ReferenceResults
cd $refdir/modelica.org/ReferenceResults
rm -rf $refdir/MAP-LIB_ReferenceResults/

test -f MAP-LIB_ReferenceResults.git/config || git clone --bare https://github.com/modelica/MAP-LIB_ReferenceResults.git MAP-LIB_ReferenceResults.git
cd MAP-LIB_ReferenceResults.git
git fetch origin '*:*'
git fetch --tags

for tag in $(git for-each-ref --format="%(refname:lstrip=-1)" refs/heads/)
do
  echo "tag: $tag"
  base="$refdir/MAP-LIB_ReferenceResults/$tag"
  mkdir -p $base
  echo "mkdir -p $base"
  git archive --format=tar $tag | (cd $base && tar xvf -)
done

and run it

chmod a+rx installReferenceResults.sh
./installReferenceResults.sh
export MSLREFERENCE="/some/path/to/ReferenceFiles/"

For the other libraries just clone the repositories to /some/path/to/ReferenceFiles/.

openmodelicalibrarytesting's People

Contributors

sjoelund avatar adrpo avatar perost avatar mahge avatar anheuermann avatar rfranke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.