Envisioning a CI scenario, etc., where you only know the name of the testing package, but not the name of any particular defsuite'd suite within it. Is there a way to tell clunit2 to "just run everything"?
Is there a way to run all suites "blindly"? #1
Hi @fosskers !
Envisioning a CI scenario, etc., where you only know the name of the testing package, but not the name of any particular
defsuite'd suite within it. Is there a way to tellclunit2to "just run everything"?
This is an interesting question! As far as I know, no such method exists but, looking at the code, all the suites (defined using the defsuite macro) are stored into the hash table: *test-suite-hashtable*. So i think that in principle, a function can be added that iterates the elements of said hashtable and runs all the suites that has not a parent.
I can try to write that function, to see it that idea works or not, maybe the name could be simply: run-all-suites.
Bye!
C.
That would be very convenient, thank you. The real reason is that I have implemented vend test, and want to add compatibility for clunit2: https://github.com/fosskers/vend?tab=readme-ov-file#vend-test
It would also be very helpful if run-all-suites could return a T if all suites passed, or NIL otherwise, that way I can report the proper error code to the terminal 🙏.
Hi @fosskers !
I am going to figure out how to write that code, just a question: would be the same if the function run-all-suites would signals an error condition when a test fails, instead of returning nil?
Bye!
C.
Yeah, a condition would work well too!
Hi @fosskers !
I just added a new function: run-all-suites that runs all the suites that have no parents.
To signal a condition when the first test fails the arguments should be:
(clunit:run-all-suites :signal-condition-on-fail t
:stop-on-fail t)
Immediately after a test fails a condition 'clunit:test-suite-failure' is signaled.
I hope that this code is what you needed!
Bye!
C.
It works! Thanks a lot!
Hi @fosskers !
Thanks to you for helping improving this project!
C.
vend now has official support for clunit2: https://github.com/fosskers/vend?tab=readme-ov-file#integrations
Great news!
I am happy to have contributed (although in an indirect way) to your project!
C.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?