Commit Graph

518 Commits (e17b1df13d9c3269b838169d6d61912d3d13431d)

Author SHA1 Message Date
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