-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Move test_tone and test_ppm out of test_hrt.cpp file into their own respective files. #11234
Conversation
16d8887
to
f47a39e
Compare
f47a39e
to
2c6f50a
Compare
6954752
to
9110377
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.
Please make one pass and update the Copyright dates. Also there files have the old Nuttx section format (line 57-81) It would be OK to remove the empty comment blocks.
9110377
to
64659cf
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.
@mcsauder - Thank you!
459732d
to
a682df5
Compare
src/systemcmds/tests/test_tone.cpp
Outdated
int fd, result; | ||
unsigned long tone; | ||
|
||
fd = px4_open(TONEALARM0_DEVICE_PATH, O_WRONLY); |
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.
Are you going to remove ioctl on a subsequent 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.
After today's dev call I decided to add a second commit to this PR to take care of the IOCTL work, see comment and test results below.
f01e4b1
to
6305f82
Compare
27bcc56
to
ce83519
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.
@mcsauder - Thank you this looks good to go now.
@mcsauder - I had a thought - use the tone API to indicate the success or failure of the tests. The would give an audible result to a tester? |
34569e2
to
2d98b47
Compare
@davids5 , I've created the functionality we discussed. It's nice to get a tone when a test passes or fails. Let me know if you'd prefer a different tone for pass/fail. Thanks for the direction! |
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.
@mcsauder - Thank you - This looks great see one comment
src/systemcmds/tests/tests_main.c
Outdated
for (unsigned i = 0; tests[i].name; i++) { | ||
if (!strcmp(tests[i].name, argv[1])) { | ||
if (tests[i].fn(argc - 1, argv + 1) == 0) { | ||
tests[tone_test_index].fn(2, tone_pass); // Play a notification. |
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.
Is the tone guaranteed to be linked?
If not we need a guard on int tone_test_index == -1
So if tone is not found to not invoke the test at 0.
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.
Nice catch. Thank you! Guards added, initialized to -1.
I made another pass through test_runner and changed loop index types to size_t (index type) and condensed a few printf() calls as well. Those changes are pushed up and rebased with current master. Tested on pixhawk 4 (V5) and performing as expected - "tests time" still fails to return properly as reported in #11361, (not caused by this PR).
e7b2a80
to
fc79dca
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.
@mcsauder LGTM!
df70466
to
0abf07f
Compare
…own respective files.
…sh() instead of IOCTL() and alphabetize tests_main.h.
0abf07f
to
fa6331a
Compare
Hi there,
This PR places test_tone and test_ppm into their own files to follow the convention in all of the other
src/systemcmds/tests/*
files.Let me know if you have any questions on this PR!
-Mark