Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Matlab Run Tests

ASecurity

Run MATLAB test suites and analyze results, including test filtering, parallel execution, result diagnostics, code coverage collection, gap analysis, and CI/CD with buildtool. Use when running tests, filtering test suites, analyzing test failures, checking, collecting, or analyzing coverage, justifying uncovered code, or configuring CI pipelines. Do NOT use for writing, generating, or structuring tests. Do NOT use for Simulink coverage or Simulink testing workflows.

1,122 stars
0 votes
0 copies
1 views
Added 9/22/2026
ai-agentsgoazuretestinggitdevopsci/cdperformance

Works with

mcp

Security Analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned 9/22/2026

$npx -y skills add matlab/matlab-agentic-toolkit --skill matlab-run-tests --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Matlab Run Tests?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Matlab Run Tests
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/matlab-matlab-run-tests/badge)](https://www.skillsdirectory.com/skills/matlab-matlab-run-tests)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: matlab-run-tests
description: >
  Run MATLAB test suites and analyze results, including test filtering, parallel execution,
  result diagnostics, code coverage collection, gap analysis, and CI/CD with buildtool. Use
  when running tests, filtering test suites, analyzing test failures, checking, collecting,
  or analyzing coverage, justifying uncovered code, or configuring CI pipelines. Do NOT use
  for writing, generating, or structuring tests. Do NOT use for Simulink coverage or
  Simulink testing workflows.
license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md
metadata:
  author: MathWorks
  version: "1.0"
---

# Run Tests

Run MATLAB test suites, analyze results, collect code coverage metrics, and configure CI/CD pipelines using `matlab.unittest` infrastructure.

## When to Use

- User wants to run an existing test suite
- User needs to filter tests by name, tag, or folder
- User wants to analyze test failures or incomplete results
- User needs code coverage collection or analysis
- User wants CI/CD pipeline configuration with buildtool
- User asks about parallel test execution

## When NOT to Use

- Writing tests, creating test classes, parameterization, fixtures, mocking — use `matlab-write-tests`
- Baseline/regression tests against stored reference data — use `matlab-write-tests`
- Testing Simulink models — use Simulink test skills
- Performance benchmarking — use profiling workflows
- Buildtool setup without test context — use `matlab-software-development:matlab-create-buildfile`

## Workflow

### Run and report
1. **Run tests** — Execute via `run_matlab_test_file` MCP tool or `runtests` with filtering
2. **Analyze results** — Report pass/fail counts, iterate failed tests for diagnostics
3. **Verify** — Confirm all tests pass before proceeding to coverage or CI

### Coverage analysis (when requested)
1. **Collect** — Set up `TestRunner` with `CodeCoveragePlugin` and `CoverageResult`
2. **Report summary** — Call `coverageSummary` and present percentages to user
3. **Act on results** — Generate reports, analyze gaps, or justify — as user directs

### CI/CD setup
1. **Create buildfile.m** — Define `TestTask` with source and report options
2. **Add CI config** — GitHub Actions, Azure DevOps, or GitLab CI template

## Running Tests

### Via MCP

Use the `run_matlab_test_file` MCP tool to run test files directly. When you need filtering, parallel execution, or other options, use `evaluate_matlab_code` with `runtests`:

```matlab
results = runtests('tests');                            % all tests in folder
results = runtests('tests', Tag='Unit');                % by tag
results = runtests('tests', Name='*Calculator*');       % by name pattern
results = runtests('tests', UseParallel=true);          % parallel execution
results = runtests('tests', Strict=true);               % warnings = failures
```

### Analyzing Results

```matlab
disp(results);

for r = results([results.Failed])
    fprintf('\nFAILED: %s\n', r.Name);
    disp(r.Details.DiagnosticRecord.Report);
end

for r = results([results.Incomplete])
    fprintf('\nINCOMPLETE: %s\n', r.Name);
    disp(r.Details.DiagnosticRecord.Report);
end
```

## Coverage Analysis

```matlab
import matlab.unittest.TestRunner
import matlab.unittest.plugins.CodeCoveragePlugin
import matlab.unittest.plugins.codecoverage.CoverageResult

runner = TestRunner.withTextOutput;
covFormat = CoverageResult;
runner.addPlugin(CodeCoveragePlugin.forFolder('src', ...
    IncludingSubfolders=true, Producing=covFormat, MetricLevel='mcdc'));
results = runner.run(testsuite('tests'));

covResults = covFormat.Result;
summary = coverageSummary(covResults, "mcdc");
fprintf('Coverage: %d/%d (%.1f%%)\n', sum(summary(:,1)), sum(summary(:,2)), ...
    100*sum(summary(:,1))/sum(summary(:,2)));
```

For detailed coverage workflows — gap analysis, justifications, generated C code coverage, and data type/size coverage — see [references/code-coverage-guidance.md](references/code-coverage-guidance.md).

## Key Functions

| Category | Functions | Purpose |
|----------|-----------|---------|
| Execution | `runtests`, `TestSuite`, `TestRunner` | Run and organize tests |
| Coverage | `CodeCoveragePlugin`, `CoverageResult`, `coverageSummary` | Measure test coverage |
| Reports | `CoverageReport`, `generateStandaloneReport`, `generateCoberturaReport` | Coverage output formats |
| CI/CD | `buildtool`, `TestTask`, `addCodeCoverage` | Pipeline automation |
| Scripts | [`printCoverageGaps`](scripts/printCoverageGaps.m) | Print all uncovered items across metric levels — see [references/code-coverage-guidance.md](references/code-coverage-guidance.md) for interface |

## CI/CD Integration

Use `buildtool` with a `buildfile.m` for CI pipelines. See [references/test-execution-guidance.md](references/test-execution-guidance.md) for `buildfile.m` templates and CI configs (GitHub Actions, Azure DevOps, GitLab CI).

## References

Load these on demand — most test runs only need what's in this file.

| Load when... | Reference |
|---|---|
| Running tests in CI, buildtool config, filtering options, parallel execution details | [references/test-execution-guidance.md](references/test-execution-guidance.md) |
| Collecting code coverage (MC/DC, statement, decision, condition), analyzing gaps, justifying uncovered code, generated C code coverage, type-size coverage | [references/code-coverage-guidance.md](references/code-coverage-guidance.md) |
| Creating or modifying filter rule XML for coverage justifications | [references/justification-filter-rules.md](references/justification-filter-rules.md) |
| Extracting data type and size coverage results from hidden property | [references/datatype-size-extraction.md](references/datatype-size-extraction.md) |

## Conventions

- Always: run tests via the `run_matlab_test_file` MCP tool when possible
- Always: report pass/fail summary before taking further action
- Always: check for Failed/Incomplete tests before analyzing coverage
- Prefer: `forFolder` with `IncludingSubfolders=true` as the default source specification for coverage
- Prefer: MC/DC as the default metric level because each level includes all lower levels
- Never: generate coverage reports (HTML, Cobertura) unless the user explicitly requests them
- Never: use `CoverageResult` as the only format — always use it as the primary programmatic format

----

Copyright 2026 The MathWorks, Inc.

----

Attribution

matlabmatlab
View sourceSee grades on GitHubMore from matlab →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →