From: phillip.wood123@gmail.com Date: Wed, 28 Aug 2024 14:58:50 GMT Subject: Re: [PATCH v6 00/13] Introduce clar testing framework Message-ID: <13c94c27-0975-46dc-b94e-72fd3972ef16@gmail.com> In-Reply-To: Hi Patrick On 28/08/2024 15:03, Patrick Steinhardt wrote: > On Wed, Aug 28, 2024 at 02:18:49PM +0100, Phillip Wood wrote: >> On 20/08/2024 15:02, Patrick Steinhardt wrote: >>> Hi, >>> >>> this is another version of my patch series that introduces the clar >>> testing framework for our C unit tests. >> >> I've left some comments on the code, most of them are points I made in the >> last round that received no response. My main concern is that the assertions >> offered by clar are not as convinent as the check_* macros. > > Did you have a look at my reply at , where I > responded to these concerns? Oh sorry I'd completely missed that mail (it came in while I was off line and I failed to notice it). > In summary: I'm aware that this is still a rough edge. I'd be happy to > follow up on this and improve usability of the assertions, but doing it > likely is a bit more involved, mostly because I want to upstream all > changes in this context. So I'd rather want to land a basic version > first, and then I'd iterate and improve asserts. That sounds reasonable >> What's the plan for converting our current tests if this gets merged? If we >> were to add wrappers that provide check_int() etc. that would greatly >> simplify the conversion. I think it would offer a more ergonomic api for >> writing new tests than the verbose and non-typesafe cl_assert_equal_i() and >> friends. > > My plan would first be to let things cook for a bit while I sort out the > rough spots upstream. Once done and once we are sufficiently sure that > this is the direction to go I'm happy to do the conversion myself. > > Whether we want to have wrappers... I dunno, I don't think the names are > all that bad. They have a clear namespace and say rather directly what > they are doing, which I value more than briefness (to a certain extent, > of course). One could argue the check_* are namespaced by "check". I find writing unit tests in C is pretty tedious and having to type cl_assert_equal_? just adds to that. > The type safety is another topic though, and something I > will aim to address. Thanks, it sounds like we're more or less on the same page Best Wishes Phillip > Thanks! > > Patrick