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
make test count iteration configurable by environment variable #851
Conversation
Nice, that's indeed useful. ACK 0ce4554 I inspected the diff Here are a few small annoying things that you can add to this PR if you want. If not, let's consider this a list for another PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 0ce4554
utACK 0ce4554
I also wanted to do some sanitizing on the bench env var but hadn't gotten to doing it yet Lines 124 to 131 in ca4906b
|
deadalnix was using count==0 :) #528 |
lol |
I'm happy to add a count>0 check if people think it's valuable. I don't think it's worth exposing a way to change the exhaustive test iteration count. I didn't even know there was one. Unfortunately there is no usage text for the tests binary :). I could add an unconditional message above the "count =" line. |
The count variable for the exhaustive tests changes the z coordinate for gej elements (which is randomized, not exhaustive). I don't think there is much need to changing the default, though. |
yeah but even he says:
So I think we should just enforce > 0. But either way is fine.
Indeed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK a729a6c I inspected the diff but didn't test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK mod nit
src/tests.c
Outdated
} | ||
} | ||
if (count <= 0) { | ||
fputs("An iteration count of 0 is not allowed.\n", stderr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: <= 0
a729a6c
to
f4fa8d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK f4fa8d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK f4fa8d2
…iable Summary: ``` You can set the test iteration count by command-line parameter but it is very hard to control the iteration count used by make check and even harder to control the count when this is run through Bitcoin Core's build system. Using an environment var solves both problems. ``` Backport of [[bitcoin-core/secp256k1#851 | secp256k1#851]] Test Plan: SECP256K1_TEST_ITERS=16 ninja check-secp256k1 Should succeed but: SECP256K1_TEST_ITERS=0 ninja check-secp256k1 Should fail with error `An iteration count of 0 or less is not allowed.` Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Differential Revision: https://reviews.bitcoinabc.org/D9375
…iable Summary: ``` You can set the test iteration count by command-line parameter but it is very hard to control the iteration count used by make check and even harder to control the count when this is run through Bitcoin Core's build system. Using an environment var solves both problems. ``` Backport of [[bitcoin-core/secp256k1#851 | secp256k1#851]] Test Plan: SECP256K1_TEST_ITERS=16 ninja check-secp256k1 Should succeed but: SECP256K1_TEST_ITERS=0 ninja check-secp256k1 Should fail with error `An iteration count of 0 or less is not allowed.` Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Differential Revision: https://reviews.bitcoinabc.org/D9375
You can set the test iteration count by command-line parameter but it is very hard to control the iteration count used by
make check
and even harder to control the count when this is run through Bitcoin Core's build system. Using an environment var solves both problems.