Skip to content

Conversation

ladislas
Copy link
Contributor

@ladislas ladislas commented Jan 27, 2020

Summary of changes

On macOS Catalina, with a fresh clone of mbed-os, running mbed test --unittests results in the following issue:

[...]
/usr/bin/gcc  -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/target_h -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/target_h/events -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/target_h/events/equeue -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/target_h/platform -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/target_h/platform/cxxsupport -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/target_h/drivers -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/stubs -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/.. -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/netsocket -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../platform -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../drivers -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../hal -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../events -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../events/source -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../events/internal -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../rtos -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../rtos/TARGET_CORTEX -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../rtos/TARGET_CORTEX/rtx5/Include -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../cmsis -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/frameworks -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/frameworks/mbed-trace -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/frameworks/nanostack-libservice -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/frameworks/nanostack-libservice/mbed-client-libservice -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/filesystem/fat -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/filesystem/fat/ChaN -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/filesystem/bd -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/filesystem -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/filesystem/littlefs -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/filesystem/littlefs/littlefs -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/cellular/framework/API -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/cellular/framework/AT -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/cellular/framework/device -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/cellular/framework -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/cellular/framework/common -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/lorawan -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/lorawan/lorastack -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/lorawan/lorastack/mac -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/lorawan/lorastack/phy -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/lorawan/system -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/mbedtls -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/mbedtls/inc -I/Users/ladislas/dev/github/mbed-os/UNITTESTS/../features/mbedtls/mbed-crypto/inc  -DUNITTEST -DDEVICE_EMAC -DMBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE=ETHERNET -DMBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME=10000 -DMBED_CONF_NSAPI_DNS_RETRIES=1 -DMBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS=10 -DMBED_CONF_NSAPI_DNS_CACHE_SIZE=5 -DMBED_CONF_LORA_NWKSKEY="{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}" -DMBED_CONF_LORA_APPSKEY="{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}" -DMBED_CONF_LORA_FSB_MASK="{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}" -DMBED_CONF_LORA_FSB_MASK_CHINA="{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}" -DMBED_CONF_LORA_FSB_MASK_CHINA="{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}" -DMBED_CONF_LORA_FSB_MASK="{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk   -o CMakeFiles/features-netsocket-DTLSSocketWrapper.MbedOS.dir/Users/ladislas/dev/github/mbed-os/features/frameworks/nanostack-libservice/source/libip4string/ip4tos.c.o   -c /Users/ladislas/dev/github/mbed-os/features/frameworks/nanostack-libservice/source/libip4string/ip4tos.c
In file included from /Users/ladislas/dev/github/mbed-os/features/netsocket/TLSSocketWrapper.cpp:21:
In file included from /Users/ladislas/dev/github/mbed-os/UNITTESTS/target_h/events/mbed_events.h:21:
In file included from /Users/ladislas/dev/github/mbed-os/UNITTESTS/../events/EventQueue.h:21:
In file included from /Users/ladislas/dev/github/mbed-os/UNITTESTS/../events/equeue.h:27:
/Users/ladislas/dev/github/mbed-os/UNITTESTS/../events/internal/equeue_platform.h:43:2: warning: "Unknown platform! Please update equeue_platform.h" [-W#warnings]
#warning "Unknown platform! Please update equeue_platform.h"
[...]

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

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@ladislas
Copy link
Contributor Author

ladislas commented Jan 27, 2020

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

⚠️ EDIT:

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));

@ciarmcom ciarmcom requested review from a team January 27, 2020 14:00
@ciarmcom
Copy link
Member

@ladislas, thank you for your changes.
@ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@evedon
Copy link
Contributor

evedon commented Jan 27, 2020

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

⚠️ EDIT:

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));

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

@ciarmcom ciarmcom requested review from a team January 27, 2020 16:00
@ciarmcom
Copy link
Member

@ladislas, thank you for your changes.
@ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@kjbracey
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 29, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@mbed-ci
Copy link

mbed-ci commented Jan 29, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@kjbracey kjbracey merged commit c1ce5cb into ARMmbed:master Jan 30, 2020
@mergify mergify bot removed the ready for merge label Jan 30, 2020
@mergify
Copy link

mergify bot commented Jan 30, 2020

This PR does not contain release version label after merging.

@maciejbocianski
Copy link
Contributor

@ladislas could you raise an issue for the platform-ATCmdParser ?

@ladislas ladislas deleted the fix/equeue-unit-tests-on-macOS branch January 31, 2020 09:01
@ladislas
Copy link
Contributor Author

@maciejbocianski just did! ✅

@0xc0170 0xc0170 added release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 and removed Release review required labels Feb 4, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 4, 2020

I've fixed the version: Set to 6.0.0-alpha-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants