Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
conI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LRT_infinite_dimensional_systems
conI
Commits
30e61345
Commit
30e61345
authored
5 years ago
by
Ferdinand Fischer
Browse files
Options
Downloads
Patches
Plain Diff
New helper function to simplify the call of a single test function
parent
d4bdd455
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
+misc/runSingleTest.m
+13
-0
13 additions, 0 deletions
+misc/runSingleTest.m
+unittests/readme.md
+3
-0
3 additions, 0 deletions
+unittests/readme.md
with
16 additions
and
0 deletions
+misc/runSingleTest.m
0 → 100644
+
13
−
0
View file @
30e61345
function
runSingleTest
(
testSuite
,
testName
)
%RUNSINGLETEST runs a single test of a test file
% runSingleTest(testSuite, testName) runs the testfunction with the name
% 'testName' of the 'testSuite'. A testSuite can be produced by
% matlab.unittest.TestSuite.from*... or if the tests are defined in a
% file, this file can be directly used as testSuite.
% Example:
% testSuite = unittests.quantity.testSymbolic
% testName = 'testCat'
% runSingletest(testSuite, testName)
testSuite
(
strcmp
({
testSuite
.
ProcedureName
},
testName
))
.
run
end
This diff is collapsed.
Click to expand it.
+unittests/readme.md
+
3
−
0
View file @
30e61345
...
...
@@ -3,6 +3,9 @@ To run multiple unittests in packages use:
If you want to run only the tests for a subpackage, you can use the code:
result = run(matlab.unittest.TestSuite.fromPackage('unittests.
<subpackage
name
>
', 'IncludingSubpackages', true))
If you want to run only a single test of a subpackage, you can use the helper function
misc.runSingleTest(testSuite, testName)
Some tests need reference results or save data locally in order to improve speed.
This is usually done in a setupOnce() function. Therefore, calling unittests for the first time, might take
a lot longer then afterwards.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment