Skip to content

test: turn unittest 1308 into libtest #16891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

bagder
Copy link
Member

@bagder bagder commented Apr 1, 2025

Test 1308 was wrongly marked a unit test when in reality it is a libtest.

@bagder bagder added the tests label Apr 1, 2025
@bagder

This comment was marked as outdated.

@bagder
Copy link
Member Author

bagder commented Apr 1, 2025

Hm, it was because of #include "test.h"...

return TEST_ERR_FAILURE; \
} \
} while(0)
#include "curlcheck.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be "cleaner" to move curlcheck.h to tests/libtest?
The variable unitfail that it's using, is declared there already.

It may avoid the two way dependency between units and libtests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be "cleaner" to move curlcheck.h to tests/libtest?

It is used by just about every unit test and this the first change making use of it in libtests. It seemed to belong there more than in libtests...

Copy link
Member

@vszakats vszakats Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, but it doesn't work without the global var in libtests/first.c and libtests/test.h.
It's somewhat confusing. Maybe that would be better be moved inside units and use a local macro here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. unitfail also sort of implies a unit test by name. Maybe we should just move them up a level and use them freely in both unit tests and libtests. I think we can do that outside of this PR to keep this focused.

bagder added 2 commits April 2, 2025 11:46
Test 1308 was wrongly marked a unit test when in reality it is a
libtest. Converted to test 3033.
@bagder bagder force-pushed the bagder/libtest-unit branch from af388f9 to 33d0f16 Compare April 2, 2025 09:58
@bagder bagder changed the title test: make unittest 1308 become libtest 3033 test: turn unittest 1308 into libtest Apr 2, 2025
@bagder bagder closed this in 1d84d68 Apr 2, 2025
@bagder bagder deleted the bagder/libtest-unit branch April 2, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants