Unit Testing: How to treat errors as failures
    6 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
Whenever one of my functions throws an error that was not intended in that test-case the whole test suite stops. Is there any possibility to treat those error-occurrences as failures for those specific testcases and then continue with the next ones?
1 Commento
  Andy Campbell
    
 il 24 Gen 2017
				Hi Christian,
What test framework are you using? The framework that is officially included in MATLAB actually has the behavior you desire, unless something else is going on. Are you using the framework in the matlab.unittest package?
Andy
Risposte (2)
  Adam
      
      
 il 24 Gen 2017
        doc matlab.unittest.qualifications.Assumable
rather than using assert in a unit test will cause the test to be filtered rather than produce a failure. In this case the test suite should continue rather than terminate.
Be careful not to squash expected errors with this though.
0 Commenti
Vedere anche
Categorie
				Scopri di più su Run Unit Tests in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



