The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

MATLAB Plugin

step([$class: 'MatlabBuilder']):

  • matlabRoot (optional)
    Enter the full path to the MATLAB root folder, which is returned by the matlabroot function.

    Example:

    Windows:
    C:\Program Files\MATLAB\R2019a
    Linux:
    /usr/local/MATLAB/R2019a
    Mac:
    /Applications/MATLAB_R2019a.app

    Note: If the job runs on a remote agent, you must specify the full path to MATLAB root folder on the remote agent.

    • Type: String
  • testRunTypeList (optional)
    Select the test run mode from the following options.
  • Run Tests Automatically: Runs all tests in the Jenkins workspace, including tests in subfolders.
  • Use Custom MATLAB Command: Use your own custom MATLAB commands or script file to run your tests.
    Nested Choice of Objects
  • $class: 'RunTestsAutomaticallyOption'
    • taCoberturaChkBx (optional)

      Generate a Cobertura code coverage report, named cobertura.xml, to be stored in the matlabTestArtifacts folder of the current Jenkins workspace.
      • Type: boolean
    • taJunitChkBx (optional)

      Generate a JUnit style test report, named junittestresults.xml, to be stored in the matlabTestArtifacts folder of the current Jenkins workspace.
      • Type: boolean
    • taModelCoverageChkBx (optional)

      Generate a Cobertura model coverage report, coberturamodelcoverage.xml, and save it in the matlabTestArtifacts folder of the Jenkins workspace. This report includes coverage results for Simulink® models that are tested using Simulink Test™.

      Note: This feature requires a Simulink Coverage™ license and is supported only in MATLAB R2018b or a newer release.

      • Type: boolean
    • taPDFReportChkBx (optional)

      Generate a test report in PDF format, testreport.pdf, and save it in the matlabTestArtifacts folder of the Jenkins workspace.

      Due to Jenkins Content Security Policy rules, the generated report might not open properly from within the Jenkins workspace. Consider copying the report to a location outside the workspace and opening it from there. For more information, see Configuring Jenkins Content Security Policy.

      Note:This feature is not currently supported on MacOS platforms.
      • Type: boolean
    • taSTMResultsChkBx (optional)

      Export Simulink Test™ Manager results in MLDATX format, simulinktestresults.mldatx, and save them in the matlabTestArtifacts folder of the Jenkins workspace.

      Note: This feature requires a Simulink Test license and is supported only in MATLAB R2019a or a newer release.
      • Type: boolean
    • tatapChkBx (optional)

      Generate a TAP style test report, named taptestresults.tap, to be stored in the matlabTestArtifacts folder of the current Jenkins workspace.
      • Type: boolean
  • $class: 'RunTestsWithCustomCommandOption'
    • customMatlabCommand (optional)
      To run your tests, enter MATLAB commands separated by semicolons.
      Example: cd c:\MATLAB\tests; runtests('IncludingSubfolder','true');

       
      Recommendation:If you require a number of MATLAB commands to execute your build, consider writing a MATLAB script and executing the script file instead.
      Note: The build will fail if the execution of any MATLAB command causes an error.
      • Type: String

RunMatlabCommand: Run MATLAB Command

  • matlabCommand (optional)
    Enter the command you want to run in MATLAB. If the command represents a MATLAB function or script, do not specify the file extension.
    Examples:
    Run commands: results = runtests(‘IncludingSubfolders’,true); assert(all(~[results.Failed]))
    Run a script: runMyScript

     
    Recommendation:If you require a number of MATLAB commands to execute your build, consider writing a MATLAB script and executing the script file instead.
    Note: The build will fail if the execution of any MATLAB command causes an error.
    • Type: String

RunMatlabTests: Run MATLAB Tests

  • coberturaChkBx (optional)

    Generate a Cobertura code coverage report, named cobertura.xml, to be stored in the matlabTestArtifacts folder of the current Jenkins workspace.
    • Type: boolean
  • junitChkBx (optional)

    Generate a JUnit style test report, named junittestresults.xml, to be stored in the matlabTestArtifacts folder of the current Jenkins workspace.
    • Type: boolean
  • modelCoverageChkBx (optional)

    Generate a Cobertura model coverage report, coberturamodelcoverage.xml, and save it in the matlabTestArtifacts folder of the Jenkins workspace. This report includes coverage results for Simulink® models that are tested using Simulink Test™.

    Note: This feature requires a Simulink Coverage™ license and is supported only in MATLAB R2018b or a newer release.

    • Type: boolean
  • pdfReportChkBx (optional)

    Generate a test report in PDF format, testreport.pdf, and save it in the matlabTestArtifacts folder of the Jenkins workspace.

    Due to Jenkins Content Security Policy rules, the generated report might not open properly from within the Jenkins workspace. Consider copying the report to a location outside the workspace and opening it from there. For more information, see Configuring Jenkins Content Security Policy.

    Note:This feature is not currently supported on MacOS platforms.
    • Type: boolean
  • stmResultsChkBx (optional)

    Export Simulink Test™ Manager results in MLDATX format, simulinktestresults.mldatx, and save them in the matlabTestArtifacts folder of the Jenkins workspace.

    Note: This feature requires a Simulink Test license and is supported only in MATLAB R2019a or a newer release.
    • Type: boolean
  • tapChkBx (optional)

    Generate a TAP style test report, named taptestresults.tap, to be stored in the matlabTestArtifacts folder of the current Jenkins workspace.
    • Type: boolean

Matlab: Use MATLAB version

Specify the MATLAB version for this build.

  • matlabRootFolder (optional)
    Enter the full path to the MATLAB root folder, which is returned by the matlabroot function. The specified directory will be prepended to the PATH environment variable, and the specified MATLAB version will be used to perform the build. You must not leave this field blank if no MATLAB directory exists on the path. If you leave the field blank, then the system tries to use the MATLAB directory closest to the top of the system path.


    Example:

    Windows:
    C:\Program Files\MATLAB\R2019a
    Linux:
    /usr/local/MATLAB/R2019a
    Mac:
    /Applications/MATLAB_R2019a.app

    Note: If the job runs on a remote agent, you must specify the full path to MATLAB root folder on the remote agent.

    • Type: String

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.