Testmanager, How is it possible to sort testcases within testsuite?

2 vues (au cours des 30 derniers jours)
circle_d
circle_d le 11 Sep 2019
Commenté : circle_d le 19 Sep 2019
Dear ladies and gentlemen,
I´m worjing with the TestManager and I would like to change the sequnce of the testcases within a testsuite. Is it possible to move them via track and drop?
Thank you very much and best regards
Damian Kreis

Réponses (1)

Abhisek Pradhan
Abhisek Pradhan le 18 Sep 2019
Test case can be rearragned inside a test suite. Following code sorts the test cases in descending and random order.
s = matlab.unittest.TestSuite.fromFolder(pwd)
s = s(end:-1:1)
s.run % run in descending order
s = s(randperm(numel(s)))
s.run % run in random order
But as testing should be independent of the order of test cases. So, it doesn’t matter in which order one has the test cases.
  1 commentaire
circle_d
circle_d le 19 Sep 2019
Hello,
thanks a lot for the answer. I would prefer to change the sort by making it via "drag and drop".
By sure the sort is not really important if only evaluating the test result for each test.
But the sort is important if I make some parameter adaptions and I sort the testcases witin the testsuite by taking the difficult testcases at the beginning and the easier testcases (check robustness) at the end. If the first test fails the execution of the next tests are not sensefull and I can stop the test execution.
best regards
Damian Kreis

Connectez-vous pour commenter.

Catégories

En savoir plus sur Function-Based Unit Tests dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by