Commit Graph

620 Commits (ab7b93ca583fe0779dd52f0ee41e41fed70ee2c5)

Author SHA1 Message Date
Brendan McDonnell c4f10aafee typos 2018-02-20 20:11:19 -05:00
Cruz Monrreal 45b4062f8b
Merge pull request #6093 from jeromecoutant/PR_IP_PRESSURE
NETSOCKET MBED_EXTENDED_TESTS json configuration
2018-02-20 13:27:31 -06:00
Veijo Pesonen 8e12db1a2b Fix WIFI-CONNECT-PARAMS-CHANNEL-FAIL Greentea test case
The test case is executed succesfully when usage of wrong channel is detected
2018-02-20 16:09:46 +02:00
Martin Kojtal acd1895052
Merge pull request #6135 from mprse/tests-events-timing_remove_debug_printf
tests-events-timing - print debug info only in case of failure
2018-02-19 17:13:49 +01:00
Przemyslaw Stekiel 2b68eb19e3 tests-events-timing - print debug info only in case of failure.
In the 'Testing accuracy of equeue semaphore' test case result is printed out in each loop iteration.
Since debug prints should not exist in the final test version I suggest to print information only in case of failure.
Additionally time needed to print single info is equal to ~25 ms (K64F/GCC_ARM). The while loop is designed to execute until 20000 ms elapses, so this print has also impact on number of times the loop is executed (number of semaphore accuracy checks).
2018-02-19 11:59:17 +01:00
Cruz Monrreal 06b618447f
Merge pull request #5973 from k-stachowiak/IOTSSL-1727-update-to-new-md-api
Update Mbed TLS HW acceleration partner code to new hashing API
2018-02-14 12:58:08 -06:00
jeromecoutant d25d457652 NETSOCKET pressure tests configuration 2018-02-14 15:18:07 +01:00
Krzysztof Stachowiak f913940a0c Prepare test program to work in different MD implementations 2018-02-13 11:02:18 +01:00
Krzysztof Stachowiak 8c412ed886 Resolve compiler and linker issues in MD APIs
The features/mbedtls/targets/TARGET_STM/* files include constant needed
for the error codes returned from the MD functions.

The features/mbedtls/targets/hash_wrappers.c provides thin redirection
layer for the hardware accelerated MD implementations that rely on the
old API.

The TESTS/mbedtls/multi/main.cpp has been changed to use the new API
as its build environment does not rely on the translation unit
containing the necessary wrappers.
2018-02-13 10:07:28 +01:00
Martin Kojtal 04f0f2b1aa
Merge pull request #5604 from betzw/betzw_tests_netsocket_wb
TESTS/NETSOCKET: Refinement of `netsocket` tests
2018-02-08 15:25:45 +00:00
Cruz Monrreal 0978062dae
Merge pull request #5971 from maciejbocianski/ticker_tests_fix
Ticker tests fix
2018-02-07 20:17:39 -06:00
Cruz Monrreal 40d1c02e25
Merge pull request #5914 from mprse/Transaction_tests
Add Transaction class unit test.
2018-02-07 15:56:59 -06:00
Wolfgang Betz d6cb3853df Enlarge event queue in `test_socket_attach()` 2018-02-07 13:40:50 +01:00
Martin Kojtal 1d759d0b9c
Merge pull request #5895 from maciejbocianski/fileHandle_tests
Add FileHandle tests
2018-02-07 11:53:04 +00:00
Maciej Bocianski 8e1cfe2191 Add FileHandle tests 2018-02-02 14:57:12 +01:00
Wolfgang Betz 8ec9f6b430 Correct test `socket_sigio`
A call to

    `TCPSocket::recv(void *data, nsapi_size_t size)`

returns, following the mbed documentation, the number of received bytes on
success, and a negative error code on failure.

So in case of success, the return value depends on both the value of parameter
`size` but also on the amount of data already available. This means, that the
value returned can be lower than or equal to the `size` of the `data` buffer
passed as argument to the call.

Therefore, in the cases of `test_tcp_hello_world()` & `find_substring()`
(i.e. test `socket_sigio`), the calls to `TCPSocket::recv()` might return from
one byte up to `sizeof(buffer) - 1` (i.e. 511) bytes for each single call,
while the tests expect to receive the whole response string with a single call.

This commit applies a fix to this situation by implementing a receive loop
which exits once there is no data anymore available to be read from the socket.
2018-02-02 10:29:46 +01:00
Maciej Bocianski 143765137e test-mbed_drivers-ticker: improve two ticker test accuracy
test_case_2x_callbacks test was redesigned to eliminate ticker rescheduling and improve time mesure accuracy.

Constant ticker rescheduling (detach()/attach_us() calls)
was causing the gap between consecutive callback calls was not exact 1ms
but 1ms + time needed to call the callback and attach new one.
New design just uses two tickers to update counter alternatively every 1ms without rescheduling them
2018-01-30 13:40:56 +01:00
Maciej Bocianski dd84c0bc5f test-mbed_drivers-ticker: fix ticker cross attach
This commit fixes ticker cross-schedule bug in test_case_2x_callbacks subtest

In effect of this bug:
    ticker_callback_1_switch_to_2 was called only once
    ticker2 was never been fired because it was repeatedly detached just before fire and attached again
2018-01-30 13:01:11 +01:00
Cruz Monrreal 3c793a714c
Merge pull request #5087 from mprse/rtc_test
Add RTC time test.
2018-01-26 17:26:38 -06:00
Cruz Monrreal 24859e90e1
Merge pull request #5789 from maciejbocianski/hal_critical_section_tests
Add tests for critical section HAL API
2018-01-26 10:39:33 -06:00
Przemyslaw Stekiel a25bf8fbc1 Add RTC time test. 2018-01-24 10:47:34 +01:00
Maciej Bocianski 628f521919 Add tests for critical section HAL API 2018-01-24 10:14:06 +01:00
Przemyslaw Stekiel 79e730328f Add Transaction class unit test. 2018-01-24 08:56:04 +01:00
Maciej Bocianski d747f1f300 Test set for critical section 2018-01-19 08:28:20 +01:00
Cruz Monrreal b59005154b
Merge pull request #5808 from SenRamakri/sen_ESP8266TestConfig
ESP8266 Test Config and fixes for tests tcp_echo/tcp_hello_world
2018-01-12 10:08:24 -06:00
Cruz Monrreal 45d7f505a8
Merge pull request #5831 from marcuschangarm/test-hal-flash-fix
Increase clock tolerance in Flash HAL test
2018-01-12 10:05:01 -06:00
Marcus Chang d60bed2da9 Increase clock tolerance in Flash HAL test
The current 0.1% clock tolerance is too small for certain platforms
which natural variance is larger than this. This commit increases the
tolerance to 0.5% instead.

Sample output from time_cpu_cycles called repeatedly in init,
before running any flash tests:

[1515706585.63][CONN][RXD] diff: 49316
[1515706585.69][CONN][RXD] diff: 49256
[1515706585.75][CONN][RXD] diff: 49286
[1515706585.81][CONN][RXD] diff: 49256
[1515706585.87][CONN][RXD] diff: 49225
[1515706585.94][CONN][RXD] diff: 49286
[1515706585.99][CONN][RXD] diff: 49317
[1515706586.06][CONN][RXD] diff: 49255
[1515706586.12][CONN][RXD] diff: 49286
[1515706586.18][CONN][RXD] diff: 49285
[1515706586.24][CONN][RXD] diff: 49286
[1515706586.31][CONN][RXD] diff: 49347
[1515706586.36][CONN][RXD] diff: 49347
[1515706586.43][CONN][RXD] diff: 49286
[1515706586.49][CONN][RXD] diff: 49286
[1515706586.55][CONN][RXD] diff: 49256
[1515706586.61][CONN][RXD] diff: 49286
[1515706586.68][CONN][RXD] diff: 49346
[1515706586.74][CONN][RXD] diff: 49347
[1515706586.80][CONN][RXD] diff: 49256

Notice the outliers will cause intermittent CI failures.
2018-01-11 13:44:51 -08:00
Senthil Ramakrishnan d82566cc6b Fix tcp_hello_world test to receive all the data from http response 2018-01-08 14:18:06 -06:00
Senthil Ramakrishnan 47390e62d6 ESP8266 test config and tcp_echo test fix for ESP8266 2018-01-08 14:18:06 -06:00
Jimmy Brisson 954960c2a1
Merge pull request #5784 from 0xc0170/fix_rtc_result
RTC test: fix __result variable
2018-01-08 10:38:26 -06:00
Przemyslaw Stekiel e725b4c2c5 RTC time conversion test - reduce number of tested years in order to reduce test execution time.
For each of the following years test example time of the first and last day of each month:
- first - 1970
- example not leap year (not divisible by 4)
- example leap year (divisible by 4 and by 100 and by 400)
- example leap year (divisible by 4 and not by 100)
- example not leap year (divisible by 4 and by 100)
- last fully supported  - 2105

Test execution time on K64F is now ~39 sec.
2018-01-08 10:14:54 +01:00
Jimmy Brisson c00efaec44
Merge pull request #5737 from jeromecoutant/PR_LP_TIMER_TEST
lp_timer test : add a minimum delta value
2018-01-04 10:03:53 -06:00
Jimmy Brisson b12d0fb56b
Merge pull request #5673 from maciejbocianski/mem_trace_tests
mem_trace tests refactoring
2018-01-04 09:54:40 -06:00
Jimmy Brisson 18e727623d
Merge pull request #5435 from mikaleppanen/emac_tests
Tests for wifi emac interface
2018-01-04 09:48:45 -06:00
Martin Kojtal 77cc7c7c8f RTC test: fix __result variable
Not needed, neither used anywhere. Teardown also can
be removed
2018-01-04 13:19:13 +00:00
jeromecoutant 9a43912177 lp_timer test : add a minimum delta value 2018-01-03 15:37:19 +01:00
Anna Bridge 2f4f82ec74
Merge pull request #5723 from SeppoTakalo/wifi-construtor-fix
Remove destruction of WiFi interface in test runs
2017-12-29 14:29:38 +00:00
Cruz Monrreal II 43af0d7395
Merge pull request #5743 from VeijoPesonen/greentea-wifi-fixes-disconnect
Greentea wifi test cases - disconnect done as teardown after each connect
2017-12-28 21:02:42 +00:00
Veijo Pesonen 5585ba60a5 Greentea test case WIFI-CONNECT-NOCREDENTIALS- accept also parameter error if AP is not found 2017-12-22 13:02:06 +02:00
Veijo Pesonen c993057537 Security protocol made configurable via json 2017-12-22 12:54:22 +02:00
Veijo Pesonen 402ab81730 remove disconnect from test cases as it's going to be called implicitly from get_interface-function 2017-12-22 10:18:28 +02:00
Maciej Bocianski cc580d7532 mem_trace tests refactoring 2017-12-22 07:56:56 +01:00
Veijo Pesonen ca95e3f88b Greentea WIFI-CONNECT-SECURE must use NSAPI_SECURITY_WPA_WPA2 2017-12-21 08:29:09 +02:00
Veijo Pesonen f71756cf98 Greentea WIFI-SCAN - make possible to disable check against assumed channel
It's possible that a device does not support setting the channel to be used.
In case channel is not set by the device lets disable the check.
2017-12-21 08:29:09 +02:00
Veijo Pesonen 8c421e20d6 Greentea Wifi testcase fixes
Call disconnect when connect has been tested. Also instead of waiting
for parameter error in case of missing SSID give missing SSID error
code.
2017-12-21 08:29:09 +02:00
TomoYamanaka 4f4b4ddf36 Change the "thread" test main for Cortex-A
In pararell threads of "thread" test is a simple thread, but it seems that there is a difference in the stack used between Cortex-A and Cortex-M.
As a result of check, in Cortex-A, program aborts because of the lack of stack when PARALLEL_THREAD_STACK_SIZE is 384, workes properly when PARALLEL_THREAD_STACK_SIZE is 512 at least.
2017-12-21 14:09:24 +09:00
TomoYamanaka a105f6f356 Change the "malloc" test main for Cortex-A
"malloc" test is used a simple thread that executes only malloc and free, but it seems that there is a difference in the stack used between Cortex-A and Cortex-M.
As a result of check, in Cortex-A, program aborts because of the lack of stack  when THREAD_STACK_SIZE is 256, workes properly when THREAD_STACK_SIZE is 512 at least. Since it seems that the definition processing of "DEFAULT_STACK_SIZE" was gone from Mbed OS by updating CMSIS5/RTX5, I setted 512 directly for Cortex-A.
2017-12-21 14:09:24 +09:00
TomoYamanaka 698de3b5ff Modify 2-byte code of "heap and stack" test main for Cortex-A
I modified "space" character from 2-byte code to 1-byte code in "heap and stack" test main.
2017-12-21 14:09:24 +09:00
Seppo Takalo 8bfe5779b3 Remove destruction of WiFi interface in test runs
Most of our IP stacks don't allow removal of interfaces so
interface destructor can not reliably clean up. Therefore we
cannot rely its behaviours in test case.

Instead run interface->disconnect() in case interface was already
created.
2017-12-20 16:58:11 +02:00
Martin Kojtal 63a923752b
Merge pull request #5568 from VeijoPesonen/greentea-wifi-fixes
Greentea Wifi testcase fixes
2017-12-20 14:52:44 +00:00
Martin Kojtal b89cf3ff75
Merge pull request #5578 from mprse/CircularBuffer_tests
CircularBuffer class modification and test
2017-12-20 14:51:44 +00:00
Martin Kojtal bea41d1ebb
Merge pull request #5635 from c1728p9/fix_lazy_init
Protect local static object construction in ARMCC
2017-12-12 17:41:21 +00:00
Martin Kojtal 5c98ca56fc
Merge pull request #5648 from maciejbocianski/singletonPtr_tests
Add SingletonPtr test
2017-12-12 17:40:36 +00:00
Martin Kojtal be52ba2156
Merge pull request #5363 from mprse/extended_rtc
Add support and tests for extended RTC
2017-12-12 17:36:44 +00:00
Martin Kojtal 57a5735387
Merge pull request #5576 from jeromecoutant/PR_IP
Ethernet tests update
2017-12-12 17:31:23 +00:00
Przemyslaw Stekiel fcdaeccea1 Add tests for extended RTC. 2017-12-05 07:53:41 +01:00
jeromecoutant d8cc5a3850 tests-netsocket-socket_sigio
HTTP_SERVER_NAME and HTTP_SERVER_FILE_PATH are replaced by
  MBED_CONF_APP_HTTP_SERVER_NAME and MBED_CONF_APP_HTTP_SERVER_FILE_PATH
  to allow user to make local tests

Test on HTTP connect added as test was always OK even with no connection...
2017-12-04 17:55:11 +01:00
jeromecoutant bff8fc1534 tests-netsocket-tcp_hello_world
HTTP_SERVER_NAME and HTTP_SERVER_FILE_PATH are replaced by
  MBED_CONF_APP_HTTP_SERVER_NAME and MBED_CONF_APP_HTTP_SERVER_FILE_PATH
  to allow user to make local tests
2017-12-04 17:55:10 +01:00
jeromecoutant df27bca67d tests-netsocket-tcp_echo
UUID lines are removed as they were not used

default case:
If MBED_CONF_APP_ECHO_SERVER_ADDR and MBED_CONF_APP_ECHO_SERVER_PORT are not defined
test is using Greentea to get server information (code before OS 5.6.1 version)

TCP_ECHO_PREFIX is no more a mandatory step
2017-12-04 17:55:09 +01:00
jeromecoutant 3cb8316993 tests-netsocket-udp_echo
UUID lines are removed as they were not used

default case:
If MBED_CONF_APP_ECHO_SERVER_ADDR and MBED_CONF_APP_ECHO_SERVER_PORT are not defined
test is using Greentea to get server information (code before OS 5.6.1 version)
2017-12-04 17:55:08 +01:00
jeromecoutant 61b8468db9 tests-netsocket-gethostbyname
MBED_DNS_TEST_HOST define is replaced by MBED_CONF_APP_DNS_TEST_HOST to allow user to change host name for local tests
2017-12-04 17:55:07 +01:00
Maciej Bocianski 2ac12028ca Add SingletonPtr test 2017-12-04 11:42:23 +01:00
Russ Butler 1faf46e161 Fix deficiency in the race test
The test for construction of local static objects doesn't check
to see if the object returned has been fully initialized. Because
of this, an error with ARMCC was not detected.

This patch adds an assert to the race_test to ensure that the
object has been properly initialized.
2017-12-01 10:49:50 -06:00
Veijo Pesonen 2d7a79f123 Greentea Wifi testcase fixes
Replace 'TEST_PASS' with 'return'
2017-12-01 16:35:55 +02:00
Przemyslaw Stekiel a488424d26 Add CircularBuffer test. 2017-11-29 11:26:36 +01:00
Wolfgang Betz 043ee4a6f5 Split test for secure & unsecure tests 2017-11-28 13:17:38 +01:00
Wolfgang Betz 3613803a7a Correct WiFi driver name to `X_NUCLEO_IDW0XX1` 2017-11-28 13:17:37 +01:00
Jimmy Brisson 70522bb44b
Merge pull request #5360 from maciejbocianski/thread_fix
threads test adjust to run on devices with small RAM
2017-11-27 10:35:44 -06:00
Veijo Pesonen e488b2c04f Greentea Wifi testcase fixes
ONME-3266 Greentea testcase WIFI-SCAN fails arbitrarily
ONME-3278 Greentea testcase WIFI-SET-CREDENTIAL doesn't try WEP with valid credentials
ONME-3279 Greentea testcase WIFI-GET-RSSI uses arbitrary RSSI value limits
ONME-3280 Greentea testcase WIFI-CONNECT-PARAMS-VALID-SECURE assumes WPA2
2017-11-23 13:57:05 +02:00
Jimmy Brisson cfa9e47aee
Merge pull request #5483 from maciejbocianski/heap_and_stack_tests
heap_and_stack test refactoring
2017-11-22 10:15:03 -06:00
Jimmy Brisson 308833b431
Merge pull request #5323 from maciejbocianski/malloc_tests
malloc test refactoring
2017-11-22 10:14:35 -06:00
Maciej Bocianski bc99556151 threads test: increase threads heap size 2017-11-22 12:54:43 +01:00
Mika Leppänen 5c15819130 Tests for wifi emac interface 2017-11-21 09:52:58 +02:00
Jimmy Brisson 593eab2603
Merge pull request #5123 from maciejbocianski/signal_tests
Extends test set for Thread signals
2017-11-20 10:49:58 -06:00
Maciej Bocianski bc103359f7 heap_and_stack test refactoring 2017-11-20 11:24:49 +01:00
Martin Kojtal 56aa7c396f
Merge pull request #5261 from maciejbocianski/ticker_tests2
Extends test set for Ticker class
2017-11-16 16:23:35 +00:00
Martin Kojtal eb5d3fffff
Merge pull request #5403 from mprse/timer_test_delta_fix
Provide fixes for Timer and LowPowerTimer tests.
2017-11-16 16:19:24 +00:00
Russ Butler 93cf15d57c Fix and add test for ConditionVariable
Fix the circular linked list handling in ConditionVariable and add a
test to validate the linked list implementation.
2017-11-15 16:15:27 -06:00
Martin Kojtal 41eb565d9c
Merge pull request #5342 from ARMmbed/feature_cortex_a
Update CMSIS/RTX with Cortex-A support
2017-11-15 11:24:36 +00:00
Maciej Bocianski a7f31c9cc1 malloc test refactoring 2017-11-15 11:04:40 +01:00
Przemyslaw Stekiel 78e1362ec0 Provide fix for Issue #5468.
Issue: https://github.com/ARMmbed/mbed-os/issues/5468
Increased DELTA value for Timer and Low Power Timer tests.
2017-11-13 11:03:29 +01:00
Przemyslaw Stekiel d962f67ca2 Move Timer test, modify ASERT macros, fix comments.
Move Timer test to TESTS/mbed_drivers/ directory which is more suitable.
Fix few comments which are incorrect.
Use more relevant ASERT macros.
2017-11-13 10:43:26 +01:00
Przemyslaw Stekiel d49899a6e2 Provide fix for Timer and LowPowerTimer tests (time accumulation).
LowPoterTimer test gives sometimes failed result while testing measured time accumulation. The check which verifies if total number of elapsed milliseconds is valid fails. Test assumes that delta value equal to 1 ms is sufficient for all test cases, which is not true since in case where time measurement is performed few times in sequence the measurement error also accumulates and 1 ms might be not enough. To solve this problem delta value for milliseconds tests must be updated.
2017-11-13 10:12:11 +01:00
Bartek Szatkowski 8eebcff166 Disable heap and stack tests for Cortex A
These tests are not compatible with Cortex A due to __get_MSP usage.
2017-11-10 09:53:41 +00:00
Sarah Marsh 8c5c905d95 Limit size of equeue for sigio net test 2017-11-09 17:56:53 -06:00
Martin Kojtal 6713513ce9
Merge pull request #5370 from maciejbocianski/event_queue_mem_fix
event queue test: fix out of memory for NUCLEO_F070RB
2017-11-09 16:40:16 +00:00
Martin Kojtal c45dd269f5
Merge pull request #3648 from c1728p9/condition_variable
Add ConditionVariable to mbed rtos
2017-11-09 16:38:02 +00:00
Martin Kojtal adfe004303
Merge pull request #5425 from fkjagodzinski/test-rtostimer-update
RtosTimer tests update
2017-11-09 16:31:39 +00:00
Maciej Bocianski 0151b1c359 small supplement for PR #5338 2017-11-03 15:32:08 +01:00
Maciej Bocianski f28aef4b01 event queue test: fix out of memory problem for NUCLEO_F070RB 2017-11-03 14:47:20 +01:00
Filip Jagodzinski efbfc5a5b8 Tests: RTOS: RtosTimer: Refactor for readability 2017-11-03 10:57:20 +01:00
Russ Butler d01c7fa626 Add test cases for ConditionVariable
Add basic tests for the ConditionVariable class.
2017-11-02 21:02:37 -05:00
Jimmy Brisson 3a05b63f1e
Merge pull request #5158 from YarivCol/master
RTOS : added empty and full functions to Mail and Queue
2017-11-02 10:46:06 -05:00
Jimmy Brisson d1c65c9243
Merge pull request #5338 from maciejbocianski/malloc_fix
malloc test: fix out of memory problem for NUCLEO_F070RB
2017-11-02 10:42:21 -05:00
Jimmy Brisson 1454e6b54b
Merge pull request #5047 from maciejbocianski/lp_ticker_tests
Test set for LowPowerTicker class
2017-11-02 10:37:00 -05:00
Jimmy Brisson c7b4c7a7ef
Merge pull request #5379 from maciejbocianski/race_mem_fix
race test: fix out of memory problem for NUCLEO_F070RB
2017-11-01 14:05:58 -05:00
Filip Jagodzinski fc27107311 Tests: RTOS: RtosTimer: Fix tests for NRF51_DK board
Additional delay is needed to prevent random failures when
waiting for a semaphore.
2017-10-31 18:19:36 +01:00
Jimmy Brisson 12dace0a4b
Merge pull request #5377 from maciejbocianski/semaphore_mem_fix
semaphore test: fix out of memory problem for NUCLEO_F070RB
2017-10-30 10:11:29 -05:00
Jimmy Brisson 3749f2d469
Merge pull request #5376 from maciejbocianski/mail_mem_fix
mail test: fix out of memory problem for NUCLEO_F070RB
2017-10-30 10:10:47 -05:00
Jimmy Brisson 55197e78f3
Merge pull request #4936 from mprse/memPool_test_and_fixes
Add MemoryPool test.
2017-10-30 10:07:49 -05:00
Maciej Bocianski 6bda5907aa malloc test - reduce heap usage 2017-10-27 14:32:03 +02:00
Przemyslaw Stekiel b7e27760d9 Add MemoryPool test.
Add test for MemoryPool.
2017-10-27 08:07:34 +02:00
Maciej Bocianski adb3dacd9d mail test: fix out of memory problem for NUCLEO_F070RB 2017-10-26 14:33:14 +02:00
Maciej Bocianski 1c39f5b37e semaphore test: fix out of memory problem for NUCLEO_F070RB 2017-10-26 14:32:42 +02:00
Maciej Bocianski e174bd439c Extends test set for signals 2017-10-26 14:13:09 +02:00
Anna Bridge ffb7ae0c9e Merge pull request #5365 from 0xc0170/fix_reduntant_tst
Remove redundant ISR test.
2017-10-26 10:59:50 +01:00
Maciej Bocianski 9bf936cb49 race test: fix out of memory problem for NUCLEO_F070RB 2017-10-25 09:40:05 +02:00
Przemyslaw Stekiel cbd402e426 Remove redundant ISR test. 2017-10-23 17:51:54 +01:00
Maciej Bocianski d231837b48 threads test adjust to run on devices with small RAM 2017-10-23 09:39:48 +02:00
Anna Bridge 9c1fd48529 Merge pull request #5278 from maciejbocianski/heap_and_stack_tests
Move heap_and_stack tests to TESTS/mbed_bootstrap
2017-10-20 10:25:07 +01:00
Anna Bridge 4d25bccbb1 Merge pull request #5081 from maciejbocianski/events_flags_tests
Extends test set for EventFlags class
2017-10-20 10:24:31 +01:00
Martin Kojtal cbb8a1f994 Merge pull request #4947 from fkjagodzinski/rtostimer_tests
Rtostimer tests
2017-10-19 16:46:12 +01:00
Martin Kojtal 919e145bde Merge pull request #5243 from maciejbocianski/basic_tests
Basic test refactoring
2017-10-19 16:43:49 +01:00
Maciej Bocianski aaa15bcf58 Extends test set for Ticker class (round 2) 2017-10-19 15:12:44 +02:00
Przemyslaw Stekiel 5a833ffd0a Add fix for Timer test - provide missing get_info ticker interface function 2017-10-17 10:47:51 +02:00
Jimmy Brisson 23be7a814d Merge pull request #5074 from mprse/lp_timer_test
Add Low Power Timer test.
2017-10-13 09:21:46 -05:00
Jimmy Brisson 84f2d089f4 Merge pull request #5147 from 0xc0170/fix_deepsleep_tests
Test: deepsleep() API replacement
2017-10-13 09:19:41 -05:00
Jimmy Brisson fad67559ae Merge pull request #5028 from c1728p9/ticker_api_changes
Update ticker to map closely to hardware
2017-10-13 09:18:02 -05:00
Jimmy Brisson bf9c507467 Merge pull request #4971 from mprse/test_timer
Add test for Timer class.
2017-10-13 09:17:31 -05:00
Maciej Bocianski 9ab2a1df32 Move heap_and_stack tests 2017-10-13 08:23:55 +02:00
Maciej Bocianski 9fb4fd017a Test set for LowPowerTicker class 2017-10-11 15:01:15 +02:00
Przemyslaw Stekiel 34a03267d8 Add Low Power Timer test. 2017-10-11 14:55:34 +02:00
Maciej Bocianski 0e014c9bc7 Extends test set for EventFlags class 2017-10-11 11:02:09 +02:00
Jimmy Brisson df88a9dcc2 Merge pull request #5272 from studavekar/echo_test_fix_handshake
Fix echo test handshake and reduce uart load
2017-10-09 13:05:03 -05:00
Jimmy Brisson 42532d7806 Merge pull request #5161 from SeppoTakalo/wifi_tests
Implement functional Wifi tests
2017-10-09 11:13:37 -05:00
Martin Kojtal 943fc32c73 Merge pull request #5255 from c1728p9/fix_ticker_test
Prevent use of deleted ticker in Ticker test
2017-10-09 14:05:22 +01:00
Maciej Bocianski 73a91e05fd Basic test refactoring 2017-10-09 13:27:07 +02:00
Shrikant Tudavekar c5621b9eb3 fix echo test handshake and reduce uart load
1) if we receive more than one __sync, previous handshake would consider
it as echo_count and try to decode the value. Now we skip superfluous __sync.

2) reduce the uart load produced by the test, as we are heavily running tests in
parallel and not one-to-one this update was required.
2017-10-08 11:21:17 -05:00
Russ Butler 77dd420509 Increase ticker test time for slower devices
Increase the hal ticker test time from 30s to 60s to prevent
a timeout from occurring on slower devices, such as the nrf51.
2017-10-05 11:57:35 -05:00
Russ Butler ec55b82acf Update ticker to map closely to hardware
Allow tickers to specify their native frequency and number of bits.
This allows the conversion to happen in common code rather than in
each vendor's implementation.
2017-10-05 11:57:12 -05:00
Martin Kojtal b30c622522 Test: deepsleep() API replacement
Use sleep() as entry function + check to be certain we
are entering deepsleep when required by test (should be allowed)
2017-10-05 16:43:57 +01:00
Jimmy Brisson 4dff32ab5a Merge pull request #5220 from c1728p9/sleep_lock_fixes
Fix deep sleep lock bugs
2017-10-05 10:03:44 -05:00
YarivCol e0a0615038 fix tests 2017-10-05 07:41:47 -07:00
YarivCol f403623ba5 Add test for empty, full functions in queue and mail 2017-10-05 07:00:18 -07:00
Russ Butler ad0b11565c Prevent use of deleted ticker in Ticker test
In test_case_2x_callbacks two tickers are setup to repeatedly
reschedule each other. When these tickers are deleted this
rescheduling is still occurring and can lead to a deleted ticker
being scheduled.

When this happens the following error message is displayed:
Thread 0x0 error -6: Not allowed in ISR context

Note - this problem was not detected by CI since the test reported
the correct results back to the host test and only experienced this
error on tear down.

This problem can be reproduced on an nrf51 by first building the ticker
test with:
"mbed test -t GCC_ARM -m NRF51_DK -n tests-mbed_drivers-ticker
--compile -DMBED_TRAP_ERRORS_ENABLED=1
-DMBED_HEAP_STATS_ENABLED=1 -DMBED_STACK_STATS_ENABLED=1"

And then running testing with:
"mbed test -t GCC_ARM -m NRF51_DK -n tests-mbed_drivers-ticker --run"
2017-10-04 16:07:41 -05:00
Seppo Takalo 429b0688bd Add license texts 2017-10-04 17:45:25 +03:00
Seppo Takalo 80198f2dcd Add Doxygen documentation for testcases. 2017-10-04 12:32:46 +03:00
Seppo Takalo 72e7c326c9 Fix builds for targets without wifi or without mbed_app.json 2017-10-04 12:01:49 +03:00
Seppo Takalo 5b40280cab Update help text 2017-10-04 12:01:49 +03:00
Seppo Takalo fde08a1ee8 Fix includes.
Cannot include header file witin a function (without severe side effects)
2017-10-04 12:01:49 +03:00
Seppo Takalo 0498e8d3c3 Update template mbed_app.json 2017-10-04 12:01:49 +03:00
Seppo Takalo 3ac788fa02 Set timeout to 4 minutes.
Wifi connections and scanning takes long time. 2 minutes might not be enough.
2017-10-04 12:01:49 +03:00
Seppo Takalo 3d87507c98 Implement functional Wifi tests
Implement 100% function coverage for WifiInterface as specified
in "Wifi test plan"
2017-10-04 12:01:49 +03:00
Russ Butler d910dc5bc4 Revert #5006 - Extends test set for Ticker class
This commit reverts commit c1c0f1ea57
because it causes nightly builds to fail. This is because extra tests
added in tests-mbed_drivers-ticker fail on some targets, such as the
KL46Z, MAX32625MBED, MAX32630FTHR, NCS36510, NRF51 and NRF52_DK.
2017-10-03 11:44:24 -05:00
Przemyslaw Stekiel 4509165d61 Add test for Timer class. 2017-10-03 11:54:58 +02:00
Russ Butler ea468856c4 Add a test to validate locking
Test that DeepSleepLock and Timer lock deep sleep at the correct time
and do no leave sleep locked after they are destroted.
2017-10-02 11:35:03 -05:00
Jimmy Brisson 90e5483bbe Merge pull request #5006 from maciejbocianski/ticker_tests
Extends test set for Ticker class
2017-09-29 10:06:14 -05:00
Jimmy Brisson e3cb228d5e Merge pull request #4795 from sarahmarshy/test-configs
Add configurable network driver tests
2017-09-28 14:06:38 -05:00
Filip Jagodzinski 311d38b925 Tests: RTOS: RtosTimer: Fix tests on debug profile
Redefine error() as noop to fix tests being aborted when compiled
with -DMBED_TRAP_ERRORS_ENABLED=1.
2017-09-26 13:41:18 +02:00
Sarah Marsh fbe8dfae19 update domain name to os.mbed.com 2017-09-22 09:40:32 -05:00
Martin Kojtal b72bd08644 Merge pull request #4965 from deepikabhavnani/IAR_heap_stats
Add heap stats for IAR
2017-09-22 11:34:47 +01:00
Martin Kojtal 1fed1d003e Merge pull request #4684 from deepikabhavnani/thread_stack_issue
Add thread terminate hook
2017-09-22 11:31:39 +01:00
Sarah Marsh 6a44ceb094 Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00
Sarah Marsh 8f9242fe40 Add netsocket tests 2017-09-20 18:27:58 -05:00
Deepika 459e7d4725 IAR heap stats added 2017-09-18 10:24:01 -05:00
Deepika 6f5df1f4c3 Threads test require more time to finish 2017-09-15 11:39:47 -05:00
Russ Butler 47b0f31d32 Remove direct use of us and lp ticker from tests
Remove the direct use of the microsecond and low power ticker from
the tests. This enforces that sleep mode is properly locked when
using timers. Furthermore, this prepares the codebase for new ticker
changes which allow differing clock frequencies and timer bit widths.
2017-09-13 20:11:39 -05:00
Maciej Bocianski c1c0f1ea57 Extends test set for Ticker class 2017-09-12 16:04:52 +02:00
Shrikant Tudavekar 1cb41e9715 use default macro for armcc 2017-09-12 01:00:45 -05:00
Shrikant Tudavekar 45202df55e gaurd thumb instruction for amrc6 2017-09-11 20:09:43 -05:00
Anna Bridge 2955a0adc6 Merge pull request #5063 from 0xc0170/fix_lpticker_test
Fixing lp ticker and sleep manager tests
2017-09-11 22:28:52 +01:00
Anna Bridge cab660d980 Merge pull request #4938 from deepikabhavnani/IAR_fixes
Update IAR to version 8
2017-09-11 17:28:38 +01:00
Russ Butler f746fc5bac Allow lp_ticker test to coexist with TimerEvents
The lp_ticker test overrides the default ticker handler for the
low power ticker. This stops all other low power TimerEvents in the
system, including the ones for tickless, from getting called. Because
of this devices with tickless enabled malfunction during this test.

This patch fixes this problem by passing all lp ticker events it did
not trigger on to the TimerEvent irq handler.
2017-09-10 17:06:46 -05:00
Russ Butler 30450d40d6 Decrease error in Timeout test due to ISR latency
Increase the Timeout period from 1ms to 10ms so interrupt latency has
1/10th the effect on the measurement. This prevents failures due to
interrupt latency causing a drift.
2017-09-09 20:43:36 -05:00
Russ Butler d9aff6f0dd Prevent deeps sleep in regular sleep test case
Lock deep sleep before calling sleep to prevent the device from
entering deep sleep mode.
2017-09-09 20:43:35 -05:00
Martin Kojtal deb1febb8b sleep manager test: fix Thread stack size
Decrease the default stack size as it's not needed for purposes of testing.
2017-09-09 20:42:55 -05:00
Jimmy Brisson e12f116ec1 Merge pull request #4912 from 0xc0170/dev_sleep_drivers
Add sleep manager API
2017-09-07 18:26:49 -05:00
Martin Kojtal c5a41d83c2 test: add sleep manager tests
This commits contains two tests:
- race condition
- deep sleep locking/unlocking
2017-09-07 15:35:07 +01:00
Deepika 5875569070 Added function header for stl test 2017-09-06 09:51:16 -05:00
Jimmy Brisson 81437732dd Merge pull request #4945 from maciejbocianski/mail_tests
Extends test set for Mail class
2017-09-05 11:16:27 -05:00
Filip Jagodzinski 33e38cc0d2 Tests: RTOS: RtosTimer: Add tests 2017-09-04 16:10:54 +02:00
Maciej Bocianski ae0b90f440 Extends test set for Mail class 2017-08-31 15:04:36 +02:00
Laurent MEUNIER be7fa925ad TESTS: flashiap: Add condition to check error on unaligned access
In case the target supports a page size of 1 byte, i.e. is able to
program flash 1 byte at a time, which is the case of STM32 F4 targets,
there is no reason for flash_device.program to return an error when
trying to write on an "unaligned" address.
2017-08-28 16:21:18 +02:00
Bartek Szatkowski b0ad73ea41 RTOS: Changes to the EvenFlags API, doxy and tests 2017-08-15 13:33:32 +01:00
YarivCol dfbcbddd9a RTOS: add tests for EvenFlags class 2017-08-15 13:27:30 +01:00
Christopher Haster 4cad764162 Added copyright header to all tests 2017-08-07 12:02:33 -05:00
Jimmy Brisson a81783e177 Merge pull request #4752 from bulislaw/queue_tests
RTOS: Queue tests & docs rework
2017-08-07 10:27:11 -05:00
Jimmy Brisson 294d7e7b41 Merge pull request #4690 from 0xc0170/us_ticker_test
test: add us ticker test
2017-08-07 10:26:54 -05:00
Jimmy Brisson c5c470e22c Merge pull request #4729 from bulislaw/mutex_tests
RTOS: Mutex: Rework tests
2017-07-27 09:40:26 -05:00
Martin Kojtal ae51f183c6 test: add hal ticker test (us + lp tickers)
This test exercises ticker API
- init should be executed just once
- read timestamp

Set interrupt should be tested via upper layer, as it does not provide
API to change handler that is invoked in the ISR ticker handler.
2017-07-26 17:05:51 +01:00
Marcus Chang 299c7f24ac mbed-hal: Fixed flash test
The test assumed that data written to flash would be memory mapped
and directly accessible. On some platform this is not the case
and data has to read back through an explicit read command.

The test has been changed to use the flash read command instead
of direct memory access.
2017-07-19 14:32:39 +01:00
Jimmy Brisson 160940b30e Merge pull request #4682 from bulislaw/sem_tests
Test: RTOS: Semaphore: Rework tests
2017-07-17 11:06:48 -05:00
Jimmy Brisson adfed0f9de Merge pull request #4644 from 0xc0170/fix_ticker_delta_negative
Ticker: add fire interrupt now function
2017-07-17 11:05:46 -05:00
Jimmy Brisson 18bb6fdc1f Merge pull request #4620 from bulislaw/thread_tests
Extend tests for RTOS Thread class
2017-07-17 11:03:34 -05:00
Martin Kojtal 5a5d159a3c Merge pull request #4666 from chrissnow/tests-mbed_hal-flash-Timing_fix
Fix timing issues found in "Flash - clock and cache test"
2017-07-13 16:48:32 +02:00
Martin Kojtal 56cb1582be ticker test: add test for set interrupt with timestamp in the past
2 test cases added, one for event in the past, one for event in future but very close
to the current time, thus once is set, it is already in the past, and we fire
interrupt immediately.
2017-07-13 12:23:25 +01:00
Martin Kojtal 4ff432904e ticker test: add fire now stub 2017-07-13 12:23:25 +01:00
Bartek Szatkowski fccfa7e2c0 Tests: RTOS: Queue: Rework and extend tests 2017-07-12 15:39:54 +01:00
Bartek Szatkowski 01c0cfd4f8 RTOS: Mutex: Rework tests
Add descriptions, fix small issues and timings.
2017-07-12 11:02:12 +01:00
Bartek Szatkowski 739a429820 Test: RTOS: Semaphore: Rework tests 2017-07-11 15:01:39 +01:00
Jimmy Brisson 50fdca88e8 Merge pull request #4599 from studavekar/timing_tests_update
Update timing tests to be robust
2017-07-07 16:22:09 -05:00
Shrikant Tudavekar 8a4dbff8d6 validate base_time key received
This is required as greentea can send multiple __sync packets and cause the
to be in unexpected state.
2017-07-05 12:37:41 -05:00
Chris 8365d9d00d Remove volatile 2017-06-30 22:44:05 +01:00
Chris ed8b378c6e Code tidy 2017-06-30 22:09:47 +01:00
Chris 562a548053 Assembly based loop for timing test 2017-06-30 20:33:58 +01:00
Bartek Szatkowski 60e7ef2ab7 RTOS: Thread: Rework and extend test suite 2017-06-29 13:04:13 +01:00
Chris 92e4a1faf7 Fix timing issues found in "Flash - clock and cache test"
ARMCC seemed to be inlining time_cpu_cycles() but with a different number of clock cycles in the loop, GCC worked fine.
2017-06-29 09:51:44 +01:00
Russ Butler f535cb5ddc Update timing calculations 2017-06-28 16:29:38 -05:00
Shrikant Tudavekar 73907259d9 Increased stack to 1024 from 768 and corrected assert.
1) mbed-os-tests-mbedmicro-rtos-mbed-basic tests use to fail when run in loop
after 20-25, This was because the stack used by test application was in range of
744-840 bytes. So bumped the stack size to 1024 bytes.

2) Corrected the assert and taken out the assert which was not required.
2017-06-22 18:25:39 -05:00
studavekar 12fe3415bc Deprecate testcases related to time drift.
1) RtosTimer is been Deprecated by EventQueue.
2) wait_us testing can't be reliably tested.
2017-06-22 18:25:38 -05:00
studavekar 0f55193df8 Update timing tests to be robust.
In the new approach the host controls the device activity when the test
should start, finish and pass/fail status is send to device. Also deprecate
the test cases which can't accurately test.
2017-06-22 18:25:16 -05:00
adustm 8ea9ca0af9 Add test of sha256_clone function 2017-06-16 10:47:45 +02:00
adustm 021b84a140 Handle context swapping + rename macro ST_SHA256_BLOCK_SIZE
Handle 64 bytes accumulation
2017-06-16 10:47:31 +02:00
Sam Grove cfc4159c3f Merge pull request #4490 from pan-/reintroduce_ticker_test
tests: Reintroduce ticker test.
2017-06-11 01:09:24 -05:00
Russ Butler adcd2928fe Fix mktime test DST error
Initialize all values of timeinfo in make_time_info. This prevents
the field 'tm_isdst' from getting inadvertently set to 1 causing
time to be off by 1 hour.
2017-06-09 16:29:24 -05:00
Russ Butler d6af53c3ab Limit mktime test range for IAR
Do not test mktime or localtime past the year 1935 for IAR since this
is out of their supported range.
2017-06-09 16:26:17 -05:00
Vincent Coubard 6b020a3510 mbed_localtime: Add support of year day.
This field is needed by the LPC43XX targets.
2017-06-08 10:32:57 +01:00
Vincent Coubard 946ed353bc mbed_mktime: Improve documentation for doxygen. 2017-06-08 10:01:43 +01:00
Vincent Coubard f880e44145 remove usage of mktime/localtime in favor of dedicated functions.
The use of mktime was causing a fault when called in interrupt handler because on GCC it lock the mutex protecting the environment, To overcome this issue, this patch add dedicated routine to convert a time_t into a tm and vice versa.
In the process mktime has been optimized and is now an order of magnitude faster than the routines present in the C library.
2017-06-07 22:06:22 -05:00
Vincent Coubard 7a8898bb21 tests: Reintroduce ticker test.
This test was removed because of its memory footprint.
Most of the memory consummed by the test itself was related to the instantion of test cases in RAM.

With the introduction of case_t which allows tests cases to live in FLASH, the memory footprint has been drastically reduced (860 bytes of RAM saved) and the ticker test can be reintroduced in the code base.
2017-06-07 10:59:23 +01:00
Russ Butler ee2be3f90c Ignore deprecated storage test
Add a .mbedignore to the storage_abstraction test since this is
deprecated.
2017-06-02 23:50:39 -05:00
Sam Grove 5f138810a9 Merge pull request #4294 from ARMmbed/feature_cmsis5
Update CMSIS-Core and RTX to version 5
2017-06-02 23:44:32 -05:00
Martin Kojtal 3e0cdb966c tests: remove ticker test
This is temporary, as this test does not fit to some 16kB RAM devices. This requires few more steps: some small devices are using big async HAL structures, RTX changes increased the RAM footprint, plus this test seems to be too big. With all these, it won't fit in RAM regions for some devices.
2017-06-02 09:26:39 +01:00
Sam Grove fa0cd205a2 Merge pull request #4094 from pan-/fix_hal_ticker
[HAL] Add support for 64 bit us timestamp
2017-06-01 23:25:26 -05:00
Vincent Coubard c6433b018a lp ticker test: Fix timestamp update during deepsleep test. 2017-06-01 16:31:48 +01:00
Vincent Coubard 3e24e8fa62 lp_ticker test: Capture completion time at completion point. 2017-05-31 19:13:10 +01:00
Bartek Szatkowski b793a3fb89 Update codebase for CMSIS5/RTX5
Update all of mbed-os to use RTX5.
2017-05-30 18:55:52 +01:00
Anna Bridge 1a37ea608a Merge pull request #4393 from 0xc0170/fix_race_test_single
race tests: fix unsupported condition
2017-05-30 16:59:01 +01:00
Sam Grove 58e88813a9 Merge pull request #4282 from kl-cruz/FlashAPI_nRF52840
Flash api nRF52840
2017-05-26 10:31:05 -05:00
Martin Kojtal 7aea3bc43e race tests: fix unsupported condition
Should be true if single thread is defined, then its not
supported.
2017-05-25 14:47:28 +01:00
Vincent Coubard 834a302664 ticker test: Fix data scope dependency. 2017-05-23 11:14:10 +01:00
Vincent Coubard fe2144f7ec ticker tests: optimize RAM usage. 2017-05-22 12:07:12 +01:00
Vincent Coubard 4adba7caff ticker test: fix code format. 2017-05-17 18:55:53 +01:00
Martin Kojtal 8f295177ce Merge pull request #4317 from c1728p9/reduce_test_overhead
Reduce test overhead in preperation for CMSIS 5
2017-05-17 10:13:25 +01:00
kl-cruz 4bb818cd97 nRF52840: Fixed flashapi test and casting issue 2017-05-17 09:21:39 +02:00
Bartek Szatkowski 07fc7aeb89 Remove deprecated Thread constructor usage 2017-05-16 10:54:30 +01:00
Vincent Coubard ab09a1722f ticker api: Schedule immediately event in the past. 2017-05-16 10:37:35 +01:00
Vincent Coubard aeffd738c7 ticker_api: Code clarification
* update_interrupt renamed into schedule_interrupt
* update_current_timestamp renamed into update_present_time
* ticker_event_queue_t::timestamp renamed into
* ticker_event_queue_t::present_time
* Fix doxygen comments in ticker_api.h
* Update comments internal comments in mbed_ticker_api.c
2017-05-16 10:37:35 +01:00
Vincent Coubard b1f3aa76bb [HAL] Add Tests for the hal ticker API. 2017-05-16 10:35:11 +01:00
Bartek Szatkowski 6a0fcd3c58 Reduce test overhead in preparation for CMSIS 5
Reduce RAM consumption so all tests can still be built when using
CMSIS/RTX5. Also reduce clutter by removing the per target stack size
defines in the tests.
2017-05-14 19:25:19 -05:00
Christopher Haster f98a52fb97 Fixed timeout units in events timing test
A units mistake led to passing 20000 seconds instead of 20000 milliseconds
to greentea. The would cause the test to spin for 6 hours if it got stuck
anywhere.
2017-05-12 15:07:48 -05:00
Martin Kojtal 84eddd01c1 tests: race test - add not supported for single threaded env
Fixes #4196. As someone might not be aware that settting default_lib to small has
some implications regarding thread safety, therefore we print an error.
2017-04-20 10:53:01 +01:00
ccli8 bcae1429e5 [Greentea] Fix test code mbed-os-tests-mbed_hal-flash 2017-03-20 15:06:06 +08:00
Christopher Haster aff49d8d1e Renamed files in platform to match source names
critical.h     -> mbed_critical.h
sleep.h        -> mbed_sleep.h
toolchain.h    -> mbed_toolchain.h
rtc_time.h     -> mbed_rtc_time.h
semihost_api.h -> mbed_semihost_api.h
wait_api.h     -> mbed_wait_api.h
2017-02-22 18:17:54 -06:00
0xc0170 2fa2927ab5 tests: add FlashIAP functional test
It currently tests functionality provided by flash IAP API like
read/program/erase and getters.
2017-02-21 14:08:56 -06:00
0xc0170 4d55719321 test: add flash functional tests for flash HAL
Add tests to verify the hal port of the flash_api.
2017-02-21 14:08:23 -06:00
Sam Grove bce720d756 Merge pull request #3786 from bulislaw/feature_rework_rtos_tests
Rework RTOS mutex tests
2017-02-21 10:57:08 -06:00
Sam Grove 4103842b2b Merge pull request #3782 from geky/events-callback-inference
events: Add support for infering event type from Callback objects
2017-02-21 10:53:14 -06:00
Christopher Haster 6e920fdfe9 events: Increased test tolerance to +-5ms 2017-02-16 13:26:59 -06:00
Bartek Szatkowski 9377fa97c9 Rework RTOS mutex tests 2017-02-16 14:07:26 +00:00
Christopher Haster 99ca88a66a events: Added support for infering event type from Callback objects
While limitations in type inference prevent the event helper from
infering the type of generic function objects, there is nothing
technical preventing inference from the Callback class, where the
function type is encoded in the template parameters.

With adoption of the Callback class as the standard function
representation, it makes sense to support events created from
callback objects.
2017-02-15 13:43:52 -06:00
Christopher Haster 1f9e239a7d events: Added equeue platform timing tests
Tests the timer/semaphores at a lower level than the event queue,
which removes a layer of concerns from issues in the rtos timing.
2017-02-15 10:59:46 -06:00
Bartek Szatkowski ed41ebef9b Fix deprecated Thread ctor usage in RTOS tests
Thread spawning constructors are deprecated, start function should be
used instead.
2016-12-23 13:16:11 +00:00
Brian Daniels 3880e3a39d Limiting the thread stack for parallel threads test
Previously, the RTOS threads test was conditionally change the thread
stack size for all test cases based on the target. Now, it uses the
default stack size for all targets when threads are created serially,
and uses a 512 byte stack for the threads that are created in parallel.
2016-12-20 17:14:04 -06:00
Russ Butler 92d11df19d Increase stack size in malloc test for Cortex-A
Increase the stack size used in the malloc test to prevent stack
overflows on Cortex-A devices.
2016-12-03 14:21:17 -06:00
Martin Kojtal ab2e869a24 Merge pull request #3157 from SiliconLabs/SiliconLabs-EFR32
[Silicon Labs] Adding support for EFR32MG1 wireless SoC
2016-12-02 15:46:35 +01:00
Martin Kojtal 464f04c6ba Merge pull request #3147 from bulislaw/wifi_test
Add new WiFi tests
2016-11-24 17:45:37 +00:00
Bartek Szatkowski 3c06cdae7e WiFi tests: Make tests CI friendly 2016-11-10 17:03:26 +00:00
Bartek Szatkowski e116a66270 WiFi test Add support for mbed_app.json 2016-11-10 10:15:44 +00:00
Bartek Szatkowski e8b55cac46 WiFi tests: Only support Odin board 2016-11-10 10:04:46 +00:00
Bartek Szatkowski 34cc61f871 WiFi tests: Increase the timeout for ESP module 2016-11-10 10:04:46 +00:00
Bartek Szatkowski beef1d8b00 Add new WiFi tests
The tests try to:
  * scan for available networks and check whether specified networks
    are present in the results.
  * connect to and disconnect from the specified network.
  * repeats the scan tests while connected to a network.
  * connect to a network and perform simple HTTP query.
2016-11-10 10:04:46 +00:00
Christopher Haster 9c0c95a24b callback - Added tests for inheritance and implicit casts 2016-11-09 14:00:15 -06:00
Steven Cooreman b64fa3ae18 [EFR32] Reduce test stack sizes on EFR32 2016-11-08 18:33:42 +01:00
Sam Grove 074555b715 Merge pull request #3113 from geky/static-assert
Add static assert macro
2016-11-07 10:25:17 -06:00
Mahadevan Mahesh ac9668a498 Update tests to fix build failures. Also make the code similar to other tests
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-11-02 11:45:14 -05:00
Christopher Haster 182c6a29f2 Added static assert macro
Added MBED_STATIC_ASSERT for compile-time assertions, results in
compile-time error if condition is false

The assertion acts as a declaration that can be placed at file scope, in
a code block (except after a label), or as a member of
a C++ class/struct/union.

Unfortunately, there does not exist a backup construct for use in
C class/struct/union contexts. An alternative macro,
MBED_STRUCT_STATIC_ASSERT provides this ability to avoid disabling
static assertions for the majority of mbed-supported C compilers.
2016-11-01 21:39:41 -05:00
Brian Daniels 33c8659512 Preventing test from printing before Greentea __sync
This test was causing issues on some platforms because the serial output
would get garbled and cause exceptions to occur in the testing tools. This
corrects the behavior to follow the other tests. It will now defer all
pritning until after the __sync event occurs.
2016-10-31 14:52:15 -05:00
Martin Kojtal d7c02a13b1 Merge pull request #2953 from geky/nsapi-fix-ipv6-parsing
nsapi - Fix leftover bytes from suffix during ipv6 parsing
2016-10-25 14:37:38 +02:00
Martin Kojtal e2efb35723 Merge pull request #3011 from RobMeades/master
Add u-blox Sara-N target.
2016-10-24 18:33:22 +02:00
Christopher Haster 281a0e2fe1 nsapi - Added rudimentary ip parsing tests 2016-10-19 15:28:32 -05:00
Rob Meades 4e808139d3 Add u-blox Sara-N target. 2016-10-15 12:06:29 +01:00
Brian Daniels 9a4aeec1b2 Waiting before call to deepsleep to allow buffers to flush 2016-10-13 13:51:54 -05:00
Mike Fiore 1b4a1b11e1 fix RTOS unit tests for MultiTech xDot platform - increase stack sizes in tests 2016-10-03 12:41:52 -05:00
Sam Grove 7f8cadae7f Merge pull request #2869 from geky/callback-fix-overloads
callback - Remove problematic callback overloads
2016-09-30 15:39:13 -05:00
Sam Grove 20756cbf77 Merge pull request #2860 from ARMmbed/event_loop_mbed_events_new
Event loop with mbed-events
2016-09-30 15:24:24 -05:00
Bogdan Marinescu f16342f321 Removed allocate_failure_test1 from equeue tests
This tests doesn't run on some MCUs with low RAM. According to @geky:

"We may want to omit this test (allocate_failure_test1) for now. It has
had other problems such as overflowing stacks, and allocation failure is
also tested by allocate_failure_test2."
2016-09-30 17:01:23 +03:00
Andres AG d6f40b6e89 Port mbedTLS entropy and sha selftest to mbedOS 2016-09-30 11:24:49 +01:00
Christopher Haster c18e1786cd callback - Updated tests based on argument order 2016-09-29 16:55:49 -05:00
Bogdan Marinescu e7abc11f59 Added mbed-events library
Added mbed-events from https://github.com/ARMMbed/mbed-events. Changes
from upstream:

- the whole code is licensed under the Apache license. Sources and
  headers were updates with this information.
- removed the porting layers for Windows and FreeRTOS and the references
  to these porting layers in equeue_platform.h.
- moved the TESTS directory in mbed-events to the TESTS directory of
  mbed-os.
2016-09-29 18:44:09 +03:00
Sam Grove 48ac4aec25 Merge pull request #2830 from jeromecoutant/PR_L073RZ
[STM32L073RZ] update OS5 RTOS tests
2016-09-28 15:00:27 -07:00
Sam Grove ab3e77f50a Merge pull request #2826 from jeromecoutant/PR_F410RB_THREAD
[STM32F410RB] update OS5 RTOS thread test
2016-09-28 14:59:29 -07:00
Sam Grove 28a4b3e03a Merge pull request #2781 from jeromecoutant/PR_RTOS_Tests_clean
Clean RTOS tests after PR #2648
2016-09-28 14:58:43 -07:00
jeromecoutant 1d6d554717 Clean RTOS OS5 tests 2016-09-27 17:26:03 +02:00
jeromecoutant 17c1d97f01 [STM32L073RZ] update OS5 RTOS tests 2016-09-27 16:58:23 +02:00
jeromecoutant 2db0938d67 [STM32F410RB] update OS5 RTOS thread test 2016-09-27 15:04:27 +02:00
jeromecoutant 52f70b06d0 [STM32F091RC] patch for tests-mbedmicro-rtos-mbed-threads 2016-09-27 10:59:34 +02:00
jeromecoutant c416a1286d [NUCLEO_F103RB] RTOS tests update
As this target has 20K RAM, default stack size needs to be tuned
2016-09-22 14:48:11 +02:00
Sam Grove a994f47da9 Merge pull request #2640 from jeromecoutant/PR_F0_RB
[NUCLEO_F072RB-NUCLEO_F070RB] RTOS issues
2016-09-22 00:47:14 -05:00
jeromecoutant dc8957a046 STM32F070RB/STM32F072RB: issue with some mbedmicro-rtos-mbed tests
Status is now OK
2016-09-19 10:17:56 +02:00
Simon Hughes 5e22db842f This commit includes the following CFSTORE/Flash-Journal/Storage updates and fixes:
- flash-journal basicAPI fix for ARM toolchain
- Updated storage-abstraction with version 0.4.7
  (commit c7c4a8c52298bbc006a6f53a059fb2599cad73cc).
- https://github.com/ARMmbed/storage-volume-manager at version v0.2.10.
- https://github.com/ARMmbed/mtd-k64f v0.4.2 version of flash.c (imported as storage_driver.c).
- update to CFSTORE to use the storage-volume-manager API to initialize volume manager and
  add a volume for CFSTORE to use.
- https://github.com/ARMmbed/flash-journal at version v0.5.3
  (commit 4c58165e2fa02c6ed2b9d166a9c96967e81f458f) including readFrom() support.
- Taking flash-journal-strategy-sequential v0.6.7 strategy.c
  (commit b11a718761aa9f33679956968a21aaef9179bde1).
- GCC_ARM, ARM and IAR compiler warning fixes for new versions of flash-journal code.
- Fix storage-volume-manager test cases for concurrent access from 2 volumes to use
  addresses within the 512-1024kB address range, which is within the cfstore added volume.
- Fix cfstore/storage-volume-manager IAR warnings when building with verbose flag.
2016-09-13 18:16:56 +01:00
Sam Grove 3806c8713b Merge pull request #2559 from pan-/utest_globals_optimizations
[utest]: Allow the linker to remove any part of utest if not used
2016-09-10 07:16:34 -05:00
Sam Grove 7dd1b04c2e Merge pull request #2651 from svastm/fix_lp_timer_test
Use lp_timer to count time in the deepsleep tests
2016-09-09 18:02:10 -05:00
Sam Grove 14f5647d62 Merge pull request #2643 from c1728p9/fix_thread_self_termination
Fix thread self termination
2016-09-09 18:01:38 -05:00
Sam Grove 0128dd2d8f Merge pull request #2562 from c1728p9/init_race_condition
Fix GCC lazy init race condition and add test
2016-09-09 17:59:37 -05:00
Sam Grove 3bb149cab2 Merge pull request #2549 from geky/thread-clarification
Clean up confusion with deprecated constructors and callbacks in thread-spawning functions
2016-09-09 17:58:13 -05:00
Sam Grove a6b27319ec Merge pull request #2496 from geky/callback-cv
Add cv-qualifiers to Callback and deprecate combinatorial explody functions
2016-09-09 01:45:25 +02:00
svastm cc55173329 Use lp_timer to count time in the deepsleep tests
Because microseconds timer can be disable during deepsleep
2016-09-08 18:09:45 +02:00
Russ Butler abbd71da9b Add test case for thread self termination
Test that thread self termination works.
2016-09-07 17:33:33 -05:00
Brian Daniels 1473240637 Fixing issue in timing host test and wait_us case
The timing host tests reported success even if the total drift was
negative. This adds a check for this now.

The wait_us test now does not use a timer and just waits for 100000 us
between prints. This adds inherent drift, but it should still be well
under the limit.
2016-09-07 09:14:17 -05:00
Brian Daniels 4f4112b18e Consolidating timer reads to reduce drift 2016-09-01 15:12:38 -05:00
Brian Daniels 07a23556a9 Reducing number of timeouts to decrease drift 2016-09-01 15:12:06 -05:00
Brian Daniels e678325730 Modifying timing tests to use timing drift host test 2016-08-30 14:53:18 -05:00
Brian Daniels f6c60d07ac Adding timing drift host test 2016-08-30 14:38:30 -05:00
Brian Daniels 6e223e311c Removing threaded_blink test (duplicate of basic rtos test) 2016-08-30 14:37:30 -05:00
Russ Butler 69431da0c7 Add a test to check for init race conditions
Test SingletonPtr initailization along the with lazy initailization
that is built into the C++ language itself.
2016-08-30 11:23:11 -05:00
Vincent Coubard a9d9987d7c Fix a rare case of imcompatibility between base_control_t and control_t.
Both branches of a ternary operator should yield the same type;
compatibility is not enough in that case.
2016-08-30 13:29:19 +01:00
Christopher Haster 756a09003c Added explicit void specialization in callbacks
One limitation of C++ is that implicit casts do not occur when
matching template overloads, as a consequence the callback's
argument type requires a strict match.

Unfortunately, the prevents the previously common pattern of using
void pointers as function arguments, causing unnecessary problems
for users porting code.

        Thing *t;
        void doit(void *p) { blablabla }

        Callback<void()> cb(t, doit);

To avoid this, explicit overloads on void pointers were added. This
avoids a template expansion, and allows the implicit cast to occur
as the user would expect.
2016-08-26 12:50:13 -05:00
Christopher Haster 5c0f39f190 Split callback test into multiple tests based on types
As the templated tests grew, the resulting binary exceeded a
flash size of 64K. This caused the test to incorrectly fail on
small devices.

Moved and split into the following:
TESTS/mbed_functional/callback
TESTS/mbed_functional/callback_small
TESTS/mbed_functional/callback_big
TESTS/mbed_functional/functionpointer
2016-08-26 09:54:13 -05:00
Christopher Haster c71e67f2dc Updated minor functionality of the Callback class
- Marked `call` and `operator()` functions as const
- Moved to static_cast for internal function pointer to avoid losing
  compiler checked const-safety
- Added test for `operator=` with non-callback types
- Moved from zero-cast to value-initializer when callback is null
- Added `operator==` and `operator!=`
- Removed special handling of null callback
- Replicated doxygen to all overloads
- Added correct nops where uninitialized callbacks are called
- Added assertion for null callback
- Removed copy-constructor from callback constructor
2016-08-26 09:54:02 -05:00
Bogdan Marinescu 1e3cbc909b Added tests for the memory tracer 2016-08-26 09:42:40 -05:00
Christopher Haster 45d25ed493 Added support for cv-qualifiers in Callback class
Additionally, the following changes were don to avoid combinatorial
explosion in function overloads as a result of adding cv-qualifiers:
- Added convenience function for inferred type
- Deprecated callback overloads qhere cv-qualifiers are not scalable

Supported overloads:
callback(void (*f)(A...));
callback(const Callback<R(A...)> &);
callback(T *t,                void (*f)(T*, A...));
callback(const T *t,          void (*f)(const T*, A...));
callback(volatile T *t,       void (*f)(volatile T*, A...));
callback(const volatile T *t, void (*f)(const volatile T*, A...));
callback(T *t,                void (T::*f)(A...));
callback(const T *t,          void (T::*f)(A...) const);
callback(volatile T *t,       void (T::*f)(A...) volatile);
callback(const volatile T *t, void (T::*f)(A...) const volatile);
2016-08-26 09:40:22 -05:00
Sam Grove 3dac791b4a Merge pull request #2476 from bulislaw/lp_ticker
K22F/K64F: Add lp_ticker implementation and HAL lp_ticker tests
2016-08-25 09:19:18 -05:00
Bartek Szatkowski 7203be9e6f Add tests for LowPowerTimeout and lp_ticker 2016-08-25 13:25:02 +01:00
Russ Butler 6a31ffbf3e Heap statistics
Keep track of the current size allocated, maximum size allocated,
number of allocations, failed allocations and total size allocated for
both GCC and ARM. Report the maximum size allocated at the end of
testing.

Also, add a test to verify heap metrics are working as expected.
2016-08-22 18:32:51 -05:00
Martin Kojtal 64a30a0095 Merge pull request #2479 from geky/deprecated-until
Updated deprecation notices to match branch names
2016-08-18 09:06:39 +01:00
Martin Kojtal 8568c9eac8 Merge pull request #2394 from geky/deprecated-until
Add more well-defined garuntees on deprecation notices in mbed
2016-08-17 14:45:46 +01:00
Christopher Haster b12c27c5b4 Updated deprecation notices to match branch names
Example:

    MBED_DEPRECATED_SINCE("mbed-os-5.1", "don't foo any more, bar instead")
    void foo(int arg);
2016-08-16 20:30:20 -05:00
Christopher Haster 0f516aa8e0 Added more well-defined garuntees on deprecation notices in mbed
From the discussion on issue #2068:
Functions marked deprecated in the mbed library should notate when
the deprecation was started to allow efficient removal once a set
amount of time has expired.

Added the following macro:
MBED_DEPRECATED_SINCE("version", "message string")

Example usage:

    MBED_DEPRECATED_SINCE("v5.1", "don't foo any more, bar instead")
    void foo(int arg);

Adopted in existing deprecations:
- FunctionPointer
- RtosTimer
- Thread
2016-08-16 15:45:51 -05:00
Russ Butler 13c06850a2 Add a test for thread-safe malloc
Add a test to repeatedly malloc and free from different threads to
test if these functions are thread safe.
2016-07-29 20:14:07 -05:00
Vincent Coubard a7d1bf7364 Update thread stack size for NRF based targets in rtos tests. 2016-07-28 21:21:31 +01:00
Sam Grove c24e461be3 Merge pull request #2248 from pan-/define_stack_stize_for_RTOS_threads_test
Define stack size of the threads spawned by RTOS threads test.
2016-07-26 20:14:51 -05:00
Vincent Coubard 2099da6d58 Define stack size of the threads spawned by this test.
This stack size is adjusted for NRF51 and NRF52 based targets.
2016-07-25 23:56:14 +01:00
Vincent Coubard 5676cccc7c Define stack size for NRF52. 2016-07-25 23:46:35 +01:00
Sam Grove 0675a58009 Merge pull request #2241 from pan-/fix_stack_definitions
Bring missing stack definitions for various targets.
2016-07-25 14:02:42 -05:00
Vincent Coubard 1752f23ff8 Remove double #else statement 2016-07-25 13:24:57 +01:00
Vincent Coubard d2e683cc1e Bring missing stack definitions for various targets.
Those definitions where available in libraries/test/rtos/mbed/* tests but
not in TESTS/mbedmicro-rtos-mbed/* tests.
2016-07-25 11:57:26 +01:00
Vincent Coubard 80ead8ca1a Fix behavior when mbed-os RTOS tests are build while the system is single
threaded.

For mbed micro, if the MBED_RTOS_SINGLE_THREAD is defined then the
compilation of the test will fail with the info
	[NOT_SUPPORTED] test not supported

This patch bring this behavior to mbed-os RTOS tests.
2016-07-25 11:41:00 +01:00
Christopher Haster 8e60fdd919 Added tests for cv-qualifier c-objects in Callback class 2016-07-20 19:27:38 -05:00
Brian Daniels a9eb39dee4 Adding test frameworks and test sources
This commit adds the following test frameworks:

- `greentea-client` (https://github.com/ARMmbed/greentea-client)
  - This framework provides a key-value api for communicating with the
    greentea test tool (https://github.com/ARMmbed/greentea)
- `unity` (https://github.com/ARMmbed/unity)
  - This framework provides test assert macros that can be used when
    writing test cases
- `utest` (https://github.com/ARMmbed/utest)
  - This framework allows you to execute a series of test cases with
    reporting that works with the greentea test tool
    (https://github.com/ARMmbed/greentea)

The following changes were made when bringing these frameworks into the
tree:

- References to `mbed_drivers/mbed.h` within utest's tests were migrated
  to `mbed.h`
- The yotta file `module.json` was removed from `greentea-client` and
  `unity`
  - `coverage.json` was also removed from `greentea-client`
- `.gitignore` and `.gitattributes` were removed from `greentea-client`
- Apache 2.0 license files were removed from `greentea-client`

This also brings in a number of tests that have been newly written or ported from various sources:

- `TESTS/integration` - Very basic tests, used to check if testing frameworks are working correctly
- `TESTS/mbed_drivers` (Thanks @PrzemekWirkus!) - TESTS ported from mbed OS 3.0 (https://github.com/ARMmbed/mbed-drivers)
- `TESTS/mbedmicro-mbed` (Thanks @PrzemekWirkus!) - Tests that weren't covered by `TESTS/mbed_drivers` that currently live in `libraries/tests/mbed`
- `TESTS/mbedmicro-rtos-mbed` (Thanks @PrzemekWirkus!) - Ported tests that currently live in `libraries/tests/rtos/mbed`
- `TESTS/storage_abstraction` (Thanks @rgrover!) - Tests for the storage_abstraction hal
2016-07-20 12:41:26 -05:00