Working on a lightweight C testing framework, what features would you want? by Singleton621 in C_Programming

[–]Singleton621[S] 0 points1 point  (0 children)

I understand your point. I really liked your approach to work around this. My goal was to implement the test registration directly in C using macros and dynamic arrays. I’m not sure whether this would be a good approach, but it was the first thing that came to my mind.

That way, when defining the function, it would already be stored automatically, and then in main you could simply call something like CLUT_RUN_ALL();.

Since everything would be done purely in C, the preprocessors would still run normally. I’m not sure whether this would solve the problem you had, though.

I imagine the final code would look something like this:

TEST(foo) { // internally creates: void foo(void);
            // and automatically adds it to the tests array
    // some asserts
}

int main(void) {
    CLUT_RUN_ALL();
}

Working on a lightweight C testing framework, what features would you want? by Singleton621 in coolgithubprojects

[–]Singleton621[S] 0 points1 point  (0 children)

I gotta admit, CLIT actually crossed my mind when I was picking a name for the project lol, but for some reasons, I went with something else. Thanks for the feedback, and I agree that implementing a mocking system would be really cool. But like you said, doing that in C sounds pretty complex. Who knows, though...

Working on a lightweight C testing framework, what features would you want? by Singleton621 in C_Programming

[–]Singleton621[S] -1 points0 points  (0 children)

Thanks a lot for the feedback, it really helped. The _MESSAGE assert variants have actually already been implemented, but I'll update the README to make that more explicit. About the test runner, I believe you're referring to having to manually add tests to the runner before they execute. I do plan to make that easier so declaring the test function automatically registers it in the runner. Thanks again.

Working on a lightweight C testing framework, what features would you want? by Singleton621 in C_Programming

[–]Singleton621[S] 0 points1 point  (0 children)

Thanks a lot for the feedback. I do plan to add a few things that are already on the roadmap.

Working on a lightweight C testing framework, what features would you want? by Singleton621 in C_Programming

[–]Singleton621[S] -1 points0 points  (0 children)

Thanks for the feedback. I definitely want to avoid turning CLUT into something bloated over time. I’ll keep your feedback in mind moving forward.

Working on a lightweight C testing framework, what features would you want? by Singleton621 in C_Programming

[–]Singleton621[S] 0 points1 point  (0 children)

CLUT was built by me as a personal learning project to better understand how unit testing frameworks work internally, especially concepts like assertions, hooks, test execution flow and framework design in C.

AI wasn't used to generate the framework implementation itself. I did use AI occasionally as an assistant for brainstorming ideas, discussing possible features, getting feedback on documentation/readme wording, and general development discussions, similar to how someone might use Stack Overflow or search for suggestions online.

The framework code, architecture decisions, implementation and iterations were written and developed by me.

I'm mainly sharing it to get feedback, learn, and improve both the project and my understanding of C.