Hmmm, it seems that the unittest.spad is not really something that works nicely if there are testLibraryError calls to be tested.

I just figured out that if I have foo.input (see attachment), then the output will be (see below), i.e. the B tests are never executed.

Well, that's somehow understandible, but I would like the collect the common tests in one macro TEST. Now if one (expeced) error occurs, then all remaining tests in TEST are skipped.

That's, of course, not what I want.

Is there a way around this problem?
The only way I can imagine at the moment is to create a file
TESTS.input that contains all the tests, but not in a macro and
instead of calling the macro, I simply )read TEST.input.
Better suggestions are appreciated.


====================================================================

)clear complete

   All user variables and function definitions have been cleared.
   All )browse facility databases have been cleared.
   Internally cached functions and constructors have been cleared.
   )clear completely is finished.
)set break resume

)expose UnittestCount UnittestAux Unittest

   UnittestCount is now explicitly exposed in frame frame1
   UnittestAux is now explicitly exposed in frame frame1
   Unittest is now explicitly exposed in frame frame1
-------------------------------------------------------------------
testsuiteNoClear "elt-UniversalSegment"

   WARNING: string for testsuite should have less than 15 characters!

Type: Void
-------------------------------------------------------------------
A := "A"


   (2)  "A"
Type: String
B := "B"


   (3)  "B"
Type: String
TESTS ==>
  testLibraryError("error(A NAME)")
  testLibraryError("error(B NAME)")


Type: Void

testcaseNoClear "List"


Type: Void
NAME := "List"


   (6)  "List"
Type: String
TESTS


   Error signalled from user code:
      AList

   Continuing to read the file...


testcaseNoClear "Vector"


Type: Void
NAME := "Vector"


   (8)  "Vector"
Type: String
TESTS


   Error signalled from user code:
      AVector

   Continuing to read the file...


statistics()


=============================================================================
   General WARNINGS:
   * do not use ')clear completely' before having used 'statistics()'
     It clears the statistics without warning!
* do not forget to pass the arguments of the testXxxx functions as Strings!
     Otherwise, the test will fail and statistics() will not notice!
* testLibraryError does not prevent FriCAS from aborting the current block. Thus, if a block contains other test functions, they will not be executed
     and statistics() will not notice!


=============================================================================
   Testsuite: elt-UniversalSegment
     failed (total): 0 (2)


=============================================================================
   testsuite | testcases: failed (total) | tests: failed (total)
   elt-UniversalSegment        0     (2)               0     (2)

=============================================================================
   File summary.
   unexpected failures: 0
   expected failures: 0
   unexpected passes: 0
   total tests: 2

Type: Void

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/187fc5a8-6e57-fcc3-f09f-24f9613547bd%40hemmecke.org.
)clear complete
)set break resume
)expose UnittestCount UnittestAux Unittest
-------------------------------------------------------------------
testsuiteNoClear "elt-UniversalSegment"
-------------------------------------------------------------------
A := "A"
B := "B"
TESTS ==>
  testLibraryError("error(A NAME)")
  testLibraryError("error(B NAME)")

testcaseNoClear "List"
NAME := "List"
TESTS

testcaseNoClear "Vector"
NAME := "Vector"
TESTS

statistics()

Reply via email to