-
Notifications
You must be signed in to change notification settings - Fork 284
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
test: Separate run_auto_tests into a library #1505
Conversation
f67e7e4
to
32c0d7a
Compare
auto_tests/BUILD.bazel
Outdated
@@ -8,8 +8,13 @@ cc_library( | |||
|
|||
cc_library( | |||
name = "run_auto_test", | |||
testonly = True, | |||
srcs = ["run_auto_test.c"], |
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.
This should still be testonly. We don't want to link this into production code.
auto_tests/BUILD.bazel
Outdated
@@ -8,8 +8,13 @@ cc_library( | |||
|
|||
cc_library( | |||
name = "run_auto_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.
Can you rename this to auto_test_support? Right now, all the "_test.c" files are actually tests. We use that fact to generate build/test rules for them. Either this, or add run_auto_test to an exclusion list below where we create those rules.
} | ||
} | ||
|
||
for (uint16_t i = 0; i < NUM_GROUP_TOX; ++i) { | ||
const uint32_t num_frozen = tox_conference_offline_peer_count(toxes[i], 0, nullptr); | ||
const uint32_t num_frozen = tox_conference_offline_peer_count(autotoxes[i].tox, 0, nullptr); | ||
ck_assert_msg(num_frozen <= max_frozen, | ||
"tox #%u has too many offline peers: %u\n", |
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.
c-toxcore/auto_tests/conference_test.c:260: failed `num_frozen <= max_frozen': tox #3 has too many offline peers: 15
This started happening for me in this PR.
Codecov Report
@@ Coverage Diff @@
## master #1505 +/- ##
==========================================
- Coverage 83.95% 83.91% -0.04%
==========================================
Files 87 87
Lines 16257 16270 +13
==========================================
+ Hits 13648 13653 +5
- Misses 2609 2617 +8
Continue to review full report at Codecov.
|
79ffdec
to
cc7e3d0
Compare
tox_kill(autotoxes[i].tox); | ||
} | ||
|
||
if (autotoxes[i].state != nullptr) { |
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.
if
is not needed for free
.
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.
Same.
{ | ||
fprintf(stderr, "Saving #%u\n", autotox->index); | ||
|
||
if (autotox->save_state != nullptr) { |
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.
No need for if
.
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.
This is still true.
free(autotoxes[i].state); | ||
} | ||
|
||
if (autotoxes[i].save_state != nullptr) { |
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.
Same here.
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.
Same.
{ | ||
fprintf(stderr, "Saving #%u\n", autotox->index); | ||
|
||
if (autotox->save_state != nullptr) { |
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.
This is still true.
tox_kill(autotoxes[i].tox); | ||
} | ||
|
||
if (autotoxes[i].state != nullptr) { |
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.
Same.
free(autotoxes[i].state); | ||
} | ||
|
||
if (autotoxes[i].save_state != nullptr) { |
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.
Same.
Superseded by #1932. |
This change is