Skip to content
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

cmake: Adjust test/README.md instructions #328

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented Aug 14, 2024

Based on #322 with the minimized diff.

@hebasto hebasto added the documentation Docs and manuals label Aug 14, 2024
@hebasto
Copy link
Owner Author

hebasto commented Aug 14, 2024

cc @paplorinc @maflcko

src/test/README.md Outdated Show resolved Hide resolved
Copy link

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

almost ACK

Copy link

@l0rinc l0rinc left a comment

Choose a reason for hiding this comment

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

ACK 64ee198

src/test/README.md Show resolved Hide resolved
Copy link

@l0rinc l0rinc left a comment

Choose a reason for hiding this comment

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

Copy link

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

lgtm

src/test/README.md Outdated Show resolved Hide resolved
src/test/README.md Outdated Show resolved Hide resolved
Copy link

@vasild vasild left a comment

Choose a reason for hiding this comment

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

ACK 64ee198

Comment on lines -41 to +42
test_bitcoin --log_level=all --run_test=getarg_tests
build/src/test/test_bitcoin --log_level=all --run_test=getarg_tests
Copy link

Choose a reason for hiding this comment

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

The previous variant assumed . is in PATH!

Copy link

Choose a reason for hiding this comment

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

I couldn't find that in the docs, do most people have that set?

src/test/README.md Outdated Show resolved Hide resolved
@hebasto
Copy link
Owner Author

hebasto commented Aug 14, 2024

We might want to update ... https://github.com/hebasto/bitcoin/pull/328/files#diff-4d2a64ce14cb8b971dbba9455421b04ae7ed0c489c66d983664be5632b0de4a3R111 also.

I've put that into a separated PR.

Adjust test/README.md instructions for cmake
@hebasto
Copy link
Owner Author

hebasto commented Aug 14, 2024

We might want to update ... the Makefile.test.include mention, right?

Reworked.

Copy link

@l0rinc l0rinc left a comment

Choose a reason for hiding this comment

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

I'm fine with merging, but have a slight preference for simplifying a bit.

ACK 36117af

Comment on lines +23 to +24
after a test file was modified, run `cmake --build build` and then run the test again. If you
modify a non-test file, use `cmake --build build --target test_bitcoin` to recompile only what's needed
Copy link

Choose a reason for hiding this comment

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

Maybe I'm missing context, but whether test file was modified or production code, both cmake --build build --target test_bitcoin and cmake --build build will build all dependencies automagically, so maybe we can simply recommend cmake --build build --target test_bitcoin in all cases - and if we're worried about speed, we could even mention the -j N param here as well.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, cmake --build build --target test_bitcoin always works.

To add a new unit test file to our test suite you need
to add the file to `src/Makefile.test.include`. The pattern is to create
To add a new unit test file to our test suite, you need
to add the file to either `src/test/CMakeLists.txt` or
Copy link

Choose a reason for hiding this comment

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

I see you've mentioned the wallet as well, should we maybe mention that test utility functions could be extracted to src/test/util/CMakeLists.txt (or is that too advanced for an intro readme)?

Copy link
Owner Author

Choose a reason for hiding this comment

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

or is that too advanced for an intro readme

It seems so.

Comment on lines -41 to +42
test_bitcoin --log_level=all --run_test=getarg_tests
build/src/test/test_bitcoin --log_level=all --run_test=getarg_tests
Copy link

Choose a reason for hiding this comment

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

I couldn't find that in the docs, do most people have that set?

@maflcko
Copy link

maflcko commented Aug 15, 2024

re-ACK 36117af

Copy link

@vasild vasild left a comment

Choose a reason for hiding this comment

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

ACK 36117af

@hebasto hebasto merged commit ed373e3 into cmake-staging Aug 15, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Docs and manuals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants