-
Notifications
You must be signed in to change notification settings - Fork 3k
Add check for __APPLE__ & __MACH__ to fix unit tests on macOS #12315
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
Add check for __APPLE__ & __MACH__ to fix unit tests on macOS #12315
Conversation
Not sure if it's related but I have the Test 53 failing on macOS Catalina: test 53
Start 53: platform-ATCmdParser
53: Test command: /Users/ladislas/dev/github/mbed-os/UNITTESTS/build/platform-ATCmdParser
53: Test timeout computed to be: 1500
53: Running main() from gmock_main.cc
53: [==========] Running 13 tests from 1 test case.
53: [----------] Global test environment set-up.
53: [----------] 13 tests from test_ATCmdParser
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_create
53: [ OK ] test_ATCmdParser.test_ATCmdParser_create (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_set_timeout
53: [ OK ] test_ATCmdParser.test_ATCmdParser_set_timeout (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_process_oob
53: [ OK ] test_ATCmdParser.test_ATCmdParser_process_oob (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_flush
53: [ OK ] test_ATCmdParser.test_ATCmdParser_flush (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_write
53: [ OK ] test_ATCmdParser.test_ATCmdParser_write (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_set_delimiter
53: [ OK ] test_ATCmdParser.test_ATCmdParser_set_delimiter (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_read
53: [ OK ] test_ATCmdParser.test_ATCmdParser_read (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_debug_on
53: [ OK ] test_ATCmdParser.test_ATCmdParser_debug_on (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_abort
53: [ OK ] test_ATCmdParser.test_ATCmdParser_abort (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_printf
53: [ OK ] test_ATCmdParser.test_ATCmdParser_printf (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_send
53: [ OK ] test_ATCmdParser.test_ATCmdParser_send (0 ms)
53: [ RUN ] test_ATCmdParser.test_ATCmdParser_recv
53/54 Test #53: platform-ATCmdParser ......................................Bus error***Exception: 0.15 sec
test 54
Start 54: platform-CircularBuffer
54: Test command: /Users/ladislas/dev/github/mbed-os/UNITTESTS/build/platform-CircularBuffer
54: Test timeout computed to be: 1500
54: Running main() from gmock_main.cc
54: [==========] Running 1 test from 1 test case.
54: [----------] Global test environment set-up.
54: [----------] 1 test from TestCircularBuffer
54: [ RUN ] TestCircularBuffer.constructor
54: [ OK ] TestCircularBuffer.constructor (0 ms)
54: [----------] 1 test from TestCircularBuffer (0 ms total)
54:
54: [----------] Global test environment tear-down
54: [==========] 1 test from 1 test case ran. (1 ms total)
54: [ PASSED ] 1 test.
54/54 Test #54: platform-CircularBuffer ................................... Passed 0.14 sec
98% tests passed, 1 tests failed out of 54
Total Test time (real) = 7.76 sec
The following tests FAILED:
53 - platform-ATCmdParser (Bus error)
Errors while running CTest I've narrowed it down to this line: EXPECT_TRUE(at1.recv("%c %d %x %s\r\n%c %d %x %s\r\n", &c, &intval, &hexval, &text)); |
@ladislas, thank you for your changes. |
This is a bug and it should be fixed in a different PR. It seems that there is a duplication of the response format string that is causing the seg fault. @mtomczykmobica |
@ladislas, thank you for your changes. |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
This PR does not contain release version label after merging. |
@ladislas could you raise an issue for the |
@maciejbocianski just did! ✅ |
I've fixed the version: Set to 6.0.0-alpha-2 |
Summary of changes
On macOS Catalina, with a fresh clone of mbed-os, running
mbed test --unittests
results in the following issue:The same happens with the
cmake
approach.Adding
#if defined(__unix__) || defined(__APPLE__) || defined(__MACH__)
fixes the issue and the tests run correctly.Impact of changes
The change fixes unit testing on macOS Catalina.
Migration actions required
Documentation
n/a
Pull request type
Test results
Reviewers