1
2
Fork
You've already forked clunit2
1

Is there a way to run all suites "blindly"? #1

Closed
opened 2025年01月21日 22:44:13 +01:00 by fosskers · 10 comments

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"?

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"?
Owner
Copy link

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 tell clunit2 to "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.

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 tell `clunit2` to "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 🙏.

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 🙏.
Owner
Copy link

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.

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!

Yeah, a condition would work well too!
Owner
Copy link

Hi @fosskers !

Very well, I hope i can assemble a working code in the next days!

Bye!
C.

Hi @fosskers ! Very well, I hope i can assemble a working code in the next days! Bye! C.
Owner
Copy link

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.

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: ``` lisp (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!

It works! Thanks a lot!
Owner
Copy link

Hi @fosskers !

Thanks to you for helping improving this project!
C.

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

`vend` now has official support for `clunit2`: https://github.com/fosskers/vend?tab=readme-ov-file#integrations
Owner
Copy link

Great news!

I am happy to have contributed (although in an indirect way) to your project!
C.

Great news! I am happy to have contributed (although in an indirect way) to your project! C.
Sign in to join this conversation.
No Branch/Tag specified
master
tap14-support
improve-performances
redirect-output-tests
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cage/clunit2#1
Reference in a new issue
cage/clunit2
No description provided.
Delete branch "%!s()"

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?