Commit graph

2591 commits

Author SHA1 Message Date
Anas Nashif f431084619 tests: common: add rand32 test
Change-Id: I499586a3be1f9794b68b5cf2e5047a762ea11104
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif 5058bb75bc tests: move individual common tests into one test
We have many tests that are being built as stand-alone binaries for no good
reason. Those can be put in one single test to speed up testing and CI
verification.

Currently we do support the following in test_common:

- byteorder
- printk
- intmath
- slist
- atomic
- ring_buf

In addition, the test now uses the ztest framework.

Change-Id: I656ac7f4acf48b7de4ec81c9f5dafc9dea3da911
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif 90937df6e9 tests: make generic kernel tests unified
Tests that do not use any of the legacy kernel APIs can be moved to unified
kernel to avoid double testing.

Change-Id: Ic2353feb23ee20d9d93f5459432d3b3739df8e03
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif be4fe7f4e5 tests: move kernel tests to tests/legacy
Move all kernel tests using legacy APIs into tests/legacy to continue testing
old APIs and compatibility. We keep in tests/kernel those tests that do not use
any kernel APIs and generic in nature, those should not be affected by the
unified kernel API change.

In tests/kernel we will start adding tests that are unified kernel only. Later
and when deprecation period is over the legacy tests would be dropped.

Change-Id: Icc7d8c7e5f2af65af350b75da3117f72396925f4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif a32579749b ztest: move ztest to unified kernel
ztest was not working with unified kernel and v1 APIs and not many tests are
using ztest right now, so instead of making it work with old APIs, convert it
to unified kernel completely so that new tests written using ztest would be
unified kenrel based.

Change-Id: Ibfcc7783dcb266abbd388662ba61c4b55d32b10c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 21:38:04 +00:00
Benjamin Walsh b452817b67 kernel: merge _IS_IN_ISR() with _is_in_isr()
They were the same, standardize on the lowercase one.

Change-Id: I8bca080e45f3e0970697d4451e468b9081f96f5f
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-27 21:45:03 +00:00
Allan Stephens 0eae13d6de unified/test: Fix typo in kernel's test_task application
The wrong tag name was used to mark the test as compatible
with the unified kernel.

Change-Id: Idda5d5e0993447270e7131c42c224df8dcd59282
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-27 08:14:51 -05:00
Flavio Santes 73d4929886 test/context: Fix style issues
Fix some style issues found at the 'test_context' source code.
Issues detected:

- Naming convention
- Lines over 80 characters

Change-Id: I2f121fce7b00aaf805da44a9aa33cd5aa8d3d6ac
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-10-25 12:13:50 +00:00
Allan Stephens f4ba3b1d5d unified/test: Adapt floating point sharing test
Microkernel and nanokernel tests now use customized source code
to eliminate use of MICROKERNEL and NANOKERNEL config options.

Change-Id: I7f9aff4729a7a257c4a0a0f5939ba0f5525af460
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-25 00:10:35 +00:00
Allan Stephens 514be49072 kernel/test: Add testing of heap memory pool support
Enhances the microkernel memory pool test application to
include tests for dynamic memory allocation and freeing
from the heap memory pool using kernel APIs that behave
like malloc() and free().

This enhancement works under both the microkernel and
unified kernel.

Change-Id: Ibc485877ea9d60307edb8f93c54a0b94ebacb017
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-25 00:10:34 +00:00
Kumar Gala 5680681ed9 tests: Rename test_arm_m3_irq_vector_table test since it is not M3 specific
Drop the _m3 from the test name since this can run on M0, M3, M4, etc.

Change-Id: Ia12ece62fc7b42e28f37e191c90c0dead48d40d0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-24 22:56:19 +00:00
Anas Nashif bf5fdfbe43 tests: fix testcases for cortex-m0+ platforms
Change-Id: Idf6f5e38354aa5f1801ec0c0db63a4e19243918c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-22 16:54:19 -04:00
Dmitriy Korovkin 3ef74d4fea unified/arc: Add tickless idle test for Arduino 101 ARC core
Change-Id: I19375d70e875ea94570956598409a28b1f237b13
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-10-22 01:27:02 +00:00
Andrew Boie 1c25f49ac5 x86: arm: add support for custom data at start/end of RAM
This is used by a test case, and it's better to just put this
here instead of forking the linker scripts.

Change-Id: Ifbb90b73bb26118ae2422cc6feccb3db58a26f2c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-10-21 23:30:06 +00:00
Andrew Boie 662df128cd x86: remove references to .intStubSect in linker script
This has been unused for a long time.

Change-Id: Ie251d60d1cf9f3806292e3c150dbedf5f99d6410
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-10-21 23:30:06 +00:00
Andrew Boie 327017fb92 x86: remove unused linker-defs-arch.h
Change-Id: Ib57cced30569adf2ae72f32d27baf30a5ca4fe71
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-10-21 23:30:05 +00:00
Allan Stephens 45bfa37f97 unified: Revise timer code to conform to new API specification
Provides users with a more compact and intuitive API for kernel
timers.

Provides legacy support for microkernel timers and nanokernel
timers by building on the new kernel timer infrastructure.
Each timer type requires only a small amount of additional
wrapper code, as well as the addition of a single pointer
field to the underlying timer structure, all of which will be
easily removed when support for the legacy APIs is discontinued.

Change-Id: I282dfaf1ed08681703baabf21e4dbc3516ee7463
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-19 18:14:58 +00:00
Allan Stephens b5c6cec4c2 unified/test: Tag early sleep test as 'unified capable'
This application now executes successfully.

Change-Id: Ib3c2673fd7e8f0ff001a8355b4f7c8ddd808da94
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-18 15:30:01 +00:00
Marcus Shawcroft e1a7b47111 tests: test_ipm: Make device config structures static.
Change-Id: Ief7a411af8dd48b9c6b7122d3062c12f3fa28c66
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:16 +00:00
Tomasz Bursztyka fb24857b5c tests: Add a unit test for the byteorder buffer swap utilities
sys_memcpy_swap() and sys_mem_swap are tested.

Change-Id: Ib7ee9bd5e58a17cb41960c1834510d6643dc8271
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-10-15 10:13:36 +00:00
Allan Stephens 1d07bd1bff unified: Eliminate support for dynamic timers
Gets rid of official support for dynamic timer allocation
in the unified kernel, since users can easily define and
initialize timers at any time. Legacy support for dynamic
timers is maintained for backwards compatibility reasons
for the time being ...

Change-Id: I12b3e25914fe11e3886065bee4e96fb96f59b299
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-13 13:54:00 +00:00
Allan Stephens f0d6c033aa unified/test: Fix issues affecting LIFO object test application
Revises the test to account for changes in LIFO object behavior
in the unified kernel.

Note: A LIFO object shouldn't really be used to try and pass
data items between two different threads in an ordered manner,
as this test is doing. Ordered behavior should only be expected
when a single thread is adding and removing items from a LIFO.
A LIFO is typically used to pass data items between different
threads when ordering doesn't matter -- for example, when using the
LIFO to implement a shared pool of data items that can be allocated
and returned by a bunch of threads. (A LIFO object is more efficient
than a FIFO object for implementing this kind of pool.)

Change-Id: Ic4cbd8b8368477e72c1bf0bca35600b78f963933
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-11 09:59:16 -05:00
Allan Stephens 8472a63317 unified/test: Fix issues affecting XIP test applications
The nanokernel version of this application now uses its own source
files to eliminate its reliance on the build system setting the
CONFIG_MICROKERNEL and CONFIG_NANOKERNEL options correctly
(which the unified kernel build system doesn't do).

Change-Id: Ie7254cce314dc8d55ab325f784bd4f3309329baa
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-11 09:59:16 -05:00
Allan Stephens b5f9543535 unified/test: Fix issues affecting static idt application
The nanokernel version of this application now uses its own source
files to eliminate its reliance on the build system setting the
CONFIG_MICROKERNEL and CONFIG_NANOKERNEL options correctly
(which the unified kernel build system doesn't do).

Change-Id: Ief1d90251df62b54a6814e82cb95730088d40d99
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-11 09:59:16 -05:00
Allan Stephens 98e1e0674c unified/test: Fix issues affecting stack canary applications
The nanokernel version of this application now uses its own source
file to eliminate its reliance on the build system setting the
CONFIG_MICROKERNEL and CONFIG_NANOKERNEL options correctly
(which the unified kernel build system doesn't do).

Change-Id: Ife27f8172b2be33b95136ccdfa29522c8a6fba0b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-11 09:59:16 -05:00
Allan Stephens 16376d00e6 unified/test: Fix issues affecting test_critical application
Adjusted thread priorities to lie within the default priority
range for the unified kernel.

Change-Id: I130c60b382a6205c4c41b6f74f77679c87e6dc4d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-11 09:59:16 -05:00
Allan Stephens 6f96335a39 unified/test: Fix issues affecting task test applications
Fixes bug with the private definition of the helper task
that incorrectly added task to the EXE task group.
(This is problematic because the regression task also
starts the helper task!)

Revises test code to use legacy kernel types for task id and
task priority values, rather than using "int", since these
types are not necessarily integer values in the unified kernel.

Revises task/thread priorities used by test so they fit within
the unified kernel's default priority range.

Change-Id: I431120e5d1b44c65f423addfff1330f994fed71b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-11 09:59:16 -05:00
Allan Stephens 0cdcc6c08c unified: Extend unified kernel sanity test coverage
Updates unified kernel sanity test to include more
applications that are known to work properly.

Change-Id: Ice15bd1034f92269ef6ce9e3cd08599497814bd8
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-11 09:54:44 -05:00
Peter Mitsis 223b962e0b unified: Enable tickless idle test
Change-Id: I4cd1603266686f907dbc4398b6bc3dfea1e4502c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-04 20:02:50 +00:00
Andy Ross 6b3c5e8bb2 x86 link: Specify ALIGN_WITH_INPUT for XIP data sections
Binutils ld has an annoying misfeature (apparently a regression from a
few years ago) that alignment directives (and alignment specifiers on
symbols) apply only to the runtime addresses and not, apparently, to
the load address region specified with the "AT>" syntax.  The net
result is that by default the LMA output ends up too small for the
addresses generated in RAM.  See here for some details:

    https://sourceware.org/ml/binutils/2013-06/msg00246.html
    https://sourceware.org/ml/binutils/2014-01/msg00350.html

The required workaround/fix is that AFAICT any section which can have
inherit a separate VMA vs. LMA from a previous section must specify an
"ALIGN_WITH_INPUT" attribute.  Otherwise the sections will get out of
sync and the XIP data will be wrong at runtime.

No, I don't know why this isn't the default behavior.

A further complexity is that this feature only works as advertised
when the section is declared with the "AT> region" syntax after the
block and not "AT(address)" in the header.  If you use the header
syntax (with or without ALIGN_WITH_INPUT), ld appears to DOUBLE-apply
padding and the LMA ends up to big.  This is almost certainly a
binutils bug, but it's trivial to work around (and the working syntax
is actually cleaner) so we adjust the usage here.

Note finally that this patch includes an effective reversion of commit
d82e9dd9 ("x86: HACK force alignment for _k_task_list section"), which
was an earlier workaround for what seems to be the same issue.

Jira: ZEP-955

Change-Id: I2accd92901cb61fb546658b87d6752c1cd14de3a
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-10-01 01:41:50 +00:00
Andrew Boie e56f61f5aa x86: exceptions: simplify exception stubs
Exception stubs now just push the handler and in some cases a dummy
error code before jumping to the exception handling code, never to
return.

Change-Id: I6a79d9243deb3fc7ccdae003dd0917364c0aa304
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-28 20:28:07 +00:00
Andrew Boie edeb1f1c52 x86: interrupts: optimize and simplify IRQ stubs
Interrupt stubs now just push the ISR and parameter onto the stack
and jump to the common interrupt code, never to return.

Change-Id: I82543d8148b5c7dfe116c43f41791f852614bb28
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-28 20:28:06 +00:00
Dmitriy Korovkin 5a92f4b54f unified: Make test_pend unified capable.
test_pend test checks task_offload_to_fiber() routine.

Change-Id: I1d23e371accd633cce94db71b94f224b9b99a385
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-09-23 18:51:07 +00:00
Andy Ross 8d8b2acb26 k_timer: Don't allocate dynamic timers by default
Most apps run fine with static k_timer objects.  Don't pay the cost
for the timer pool if no one asks for it.

Also turn off the allocate/free API in the header if it can't possibly
work at runtime as it's an obviously-detectable error that would
otherwise be visible only at runtime.

Change-Id: I492e6e01c4213e3544f707247eea6e4bc601fefd
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-09-23 18:25:37 +00:00
Anas Nashif 572f4a1a14 boards: remove obsolete board basic_cortex_m3
This board is not being used or tested and does not actually
run on any hardware, remove it in favor of well supported boards
for this CPU.

Jira: ZEP-850
Change-Id: Ied681b6059ad74f9d019054292c919a9f938e7d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-22 22:09:33 +00:00
Benjamin Walsh bee1c0655f test_mem_safe: fix breakage in unified kernel
Linker scripts had not been updated following the addition of
_k_mem_pool sections.

Change-Id: Ic58e893b5296d0f814253e714f8858c272e79913
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-22 21:09:44 +00:00
Dmitriy Korovkin e3be818115 unified: Make memory pool test unified capable
Add the tag for unified kernel

Change-Id: I56953ade864580a68786fd39c459ed70bde0787c
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-09-20 22:04:47 +00:00
Dmitriy Korovkin 7f14618227 unified: Enable memory pools in mailbox tests
Change-Id: I216fbff4db7e97bfca3574f6bfc5294d73ae8e9c
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-09-20 22:04:46 +00:00
Benjamin Walsh 3fb21ac39c test_mem_safe: bring x86 linker script up-to-date
Some modifications to the base linker scripts were not propagated.

Change-Id: I73ab016d861779ad7e633ce8602d2e57845bde85
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-20 21:45:07 +00:00
Andrew Boie 757dae5b7d x86: introduce new segmentation.h header
This header has a bunch of data structure definitions and macros useful
for manipulating segment descriptors on X86. The old IDT_ENTRY defintion
is removed in favor of the new 'struct segment_descriptor' which can be
used for all segment descriptor types and not just IRQ gates.

We also add some inline helper functions for examining segment registers,
descriptor tables, and doing far jumps/calls.

Change-Id: I640879073afa9765d2a214c3fb3c3305fef94b5e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-20 20:46:45 +00:00
Peter Mitsis a4b4f5ca20 unified: Enable semaphore group use in test_mail
Change-Id: I4b8821480d2d03fa1dfc4602c00fef12da59a1a2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-09-20 11:45:28 -04:00
Peter Mitsis 95b75d7e6e unified: Fix semaphore group tests
Threads usings semaphore groups require a larger stack.

Also suppresses warnings in test_sema/microkernel due to Zephyr's
__printf_like() toolchain macro as variable types being printed
have changed between the microkernel and unified kernel.

Change-Id: If7490e0c68c299cc7a45010b9e6db7c01c826a6c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-09-20 11:45:28 -04:00
Paul Sokolovsky 824fd85b1c tests/kernel/test_multilib: Test for proper multilib selection.
This test is prompted by incorrect multilib selection for Cortex-M4
(armv7e-m subarchitecture) in Zephyr SDK 0.8.1 toolchain. The idea
is do an operation which guaranteedly results in a call to a support
routine in libgcc, which is part of multilib set. Long long division
is used as such, with a fault produced (see README) when built for
BOARD=frdm_k64f.

This test now passed with SDK 0.8.2 for frdm_k64f, but is added in
the hope of preventing/easing diagnosis of future regressions.

Change-Id: I07f01b0e70921703fc0d261fc6c48a2b13b29873
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-09-19 13:58:11 +03:00
Anas Nashif 5e4b62c35c boards: rename Quark SE Devboard to Quark SE C1000 (Sensor Subsystem)
Jira: ZEP-758
Change-Id: I8ee5a2f9e4a6ecbd15214e59321bf27a502ef6ee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:30 +00:00
Anas Nashif 2aa754497d tests: fp_sharing: removing dependency on ARCH
Change-Id: I389f93aad4b785f286bd83be6c5ed688115592f8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-15 21:16:40 +00:00
Anas Nashif 50492618e6 tests: remove dependency on architecture and use one prj.conf
No need for architecture based configuration, they are the same
for ARM and X86.

Change-Id: Iea7a62221a09bcc035bb8c81e4f49cd4c9b02229
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-15 21:16:39 +00:00
Benjamin Walsh 0e6aebf2c9 tests/mem_safe: place test buffers at the edges of RAM
This test checks if it can write at the edges of RAM within the kernel
image. The problem is that this memory is not meant to be trampled on.

With the help of custom linker scripts, place 32-byte buffers at those
edges.

Only linker scripts for QEMU on x86 and Cortex-M3 are provided, to avoid
having to maintain too many of them, in case the reference linker
scripts in the kernel change.

JIRA: ZEP-707

Change-Id: Icd5d680ce2cf064cce083c3d244a196e292bd453
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-15 09:42:24 -04:00
Benjamin Walsh 87f1232770 unified/tests: tag working some tests kernel as 'unified_capable'
This allows running the sanitycheck with:

  --tag unified_capable -x KERNEL_TYPE=unified

to run the unified kernel with the tests it is currently known to be
able to run.

Change-Id: Ic145fc6adca162745887672372226fd67447b34a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Benjamin Walsh 8011221712 unified/test_mutex: adapt to run on unified kernel
- Use a more limited range of priorities, since the current
  implementation of the unified kernel only works with 32 priorities
  total. Instead of starting at 10 and going up by 5 up to  50, start
  at 5 and go up by 1 up to 12.

- The definition of kmutex_t has changed from a uint32_t to a struct
  k_mutex *, causing this to not work anymore:

    const kmutex_t private_mutex;

  since this makes the object constant instead of the reference to it.
  Private object must be referenced like this instead:

    kmutex_t const private_mutex;

  since const is left-associative.

Change-Id: I9d70bfa3944ea46033a6b49251a4993e9bd2b588
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Benjamin Walsh 2a669da7bc unified/test_fp: mark test so that it runs the nanokernel version
The test does not run out-of-the-box currently, mark it with a #error.

Change-Id: Ia720c674290e59e95db1c2948c508c0464caa672
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Benjamin Walsh 68a8059603 unified/test_sema: fix isr wrapper names
isr wrapper names conflicted with real kernel APIs.

Change-Id: Ia85245fcd3025f9d15175523982883e16e97010c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Benjamin Walsh 45054a6e02 unified: Fix test_sema/microkernel
Fixes test_sema/microkernel so that the variable assigned the return
value from task_sem_group_take() is of type 'ksem_t' instead of 'int'.

Work by: Peter Mitsis <peter.mitsis@windriver.com>

Change-Id: Iee9f321a6bd51ca3bc0cd8b0c7eceae8a5bf7ce0
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Benjamin Walsh 3bcd880594 unified/test_timer: adapt for unified kernel
Test is poking into microkernel private data structuresa, but the
unified kernel provides an API to retrieve that value.

Abstract the call in the microkernel case to minic the unified kernel
API.

Work by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>

Change-Id: Ic3195d470fda178164268d9c71c55a2a6daa61a3
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Benjamin Walsh c24d844eec unified/test_pipe: adapt to not use sem groups
Not available yet on unified kernel.

Change-Id: I70c7c07ab26a66b7a89246a335fa2af0db2ec72c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Benjamin Walsh cda52c7adb unified/test_mail: adapt test to not use sem groups and mem pools
Not available on unified kernel yet.

Change-Id: I834482f3ad94d1c6ecc67c70c1fce78e43db31c5
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Benjamin Walsh 6f4b9a64cf unified/test_context: adapt test to run on unified kernel
Fixing issues with the test itself really:

- reply_timeout semaphore was not initialized, causing its limit value
  to be 0 on unified kernel

- There is no API to set a fiber's priority after it is started in a
  nanokernel. However, tcs.prio can be written to and this works without
  issues. On unified kernel, this does not work however because the
  thread has to move between linked lists representing each priority in
  the ready queue.

Change-Id: I3c5585da05cbc4ac3d2f0f9ae0297d24d41b1309
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Andrew Boie c579ca43ac test_context: use correct timer IRQ for mint valley
LOAPIC timer driver is used by both LOAPIC and MVIC, but the
correct #define needs to be used for the IRQ line.

Issue: ZEP-848
Change-Id: Ib682dd95c08ba437d1ff409e0e0352944d13b633
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-12 17:53:21 +00:00
Genaro Saucedo Tejada 59b06e2860 fix: previously uninitialized variables break DEBUG sanity
Fix several compiler warnings that were preventing sanity from
completing successfully when running with the CONFIG_DEBUG=y setting.
(related to compiler flag -Werror=maybe-uninitialized)

JIRA: ZEP-735

Change-Id: I3cb79eb0f254f15d18f18ace50b0cf24e9ef5f10
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-09-12 02:25:22 +00:00
Andrew Boie 0279d9b2cb test_context: don't test dynamic exceptions
This API has been deprecated and scheduled for removal.
It was only implemented on X86, and ARM systems that
aren't XIP.

Static exceptions (only implemented on x86) will
continue to be tested by test_static_idt.

Change-Id: I6d63347ead8200002ee1edd8dd4572b418800400
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 16:15:59 +00:00
Andrew Boie 73e5bfda5a tests: kernel: fix incorrect printk() usage
Change-Id: Id7c18edd93eac71d31eaba628158a2badc306238
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Andrew Boie 0ef0136a04 tests: test_printk: crude printk test case
Print some stuff, and verify that the output is as expected.
Not comprehensive (yet).

Change-Id: Ib1ce8dff8165d8ee6b02ff6272513fd76a7be842
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Andrew Boie d02b96d5a7 test_ipm: disable on Quark SE ARC core
This test can't run properly because it already defines
an IPM console sender, and instantiating the dummy one
prevents any messages from being forwarded to the x86 side.

Issue: ZEP-708
Change-Id: Ib13c5df5db67f3d9fde960f8e5cda354c60efae1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-17 20:52:30 +00:00
Andy Ross 5c1011a30a test_sleep: More latency workarounds
We are also seeing qemu failures in the synchronous wakeup tests,
where the fiber should be resuming instantly but in practice sees a
one-tick delay due to the emulation environment not being
deterministic.  Allow one tick of slop in those too.

Change-Id: Idab7c45ea0b10bd955b90a98d3884b5fe0571187
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-08-12 20:36:11 +00:00
Andy Ross 5a8add7821 tests/kernel/{test_task,test_sleep}: Less aggressive timer testing
On some hardware (Qemu) the timer guarantees aren't honored as well as
we like, and these tests are observed to spuriously fail in practice
(e.g. CI testing).  Allow for one tick of slop when testing sleep
durations.

Change-Id: I4b694c0a9ddfc1ee48510fa5deda2bb31499debf
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-08-10 16:42:51 +00:00
Andrew Boie 17c0b372a2 x86: improve exception APIs
Previously, exception stubs had to be declared in assembly
language files. Now we have two new APIs to regsiter exception
handlers at C toplevel:

 _EXCEPTION_CONNECT_CODE(handler, vector)
 _EXCEPTION_CONNECT_NOCODE(handler, vector)

For x86 exceptions that do and do not push error codes onto
the stack respectively.

In addition, it's now no longer necessary to #define around
exception registration. We now use .gnu.linkonce magic such that
the first _EXCEPTION_CONNECT_*() that the linker finds is used
for the specified vector. Applications are free to install their
own exception handlers which will take precedence over default
handlers such as installed by arch/x86/core/fatal.c

Some Makefiles have been adjusted so that the default exception
handlers in arch/x86/core/fatal.c are linked last. The code has
been tested that the right order of precedence is taken for
exceptions overridden in the floating point, gdb debug, or
application code. The asm SYS_NANO_CPU_EXC_CONNECT API has been
removed; it was ill- conceived as it only worked for exceptions
that didn't push error codes. All the asm NANO_CPU_EXC_CONNECT_*
APIs are gone as well in favor of the new _EXCEPTION_CONNNECT_*()
APIs.

CONFIG_EXCEPTION_DEBUG no longer needs to be disabled for test
cases that define their own exception handlers.

Issue: ZEP-203
Change-Id: I782e0143fba832d18cdf4daaa7e47820595fe041
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-28 18:13:24 +00:00
Kumar Gala 58647277ed tests: test_tickless: Fix NXP K64 symbol dependency
We filtered on CONFIG_SOC_FSL_FRDM_K64F which doesn't exist change it to
CONFIG_SOC_MK64F12 to allow this testcase to run on the K64 platform

Change-Id: Ifdd89e66aa403c3bb28c07d3a546037275a5118d
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-28 07:20:12 -05:00
Andrew Boie 96cadd1a9a arc: move special-purpose irq priorities to flags
We have already done this on x86 and ARM. The policy is as follows:

* IRQ priority levels starting at 0 all have the same semantics and
do not have special properties. The priority level is either ignored
on arches which do not support programmable priority levels, or lower
priority levels take precedence over higher ones.
* Special-case priorty levels are specified via flags, in which case
the supplied priority level is ignored.

Issue: ZEP-60
Change-Id: Ic603f49299ee1426fb9350ca29d0b8ef96a1d53a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-26 15:06:28 +00:00
Andrew Boie 8c524a291e x86: merge IAMCU and SYS V core arch code
Having two parallel implementations is a maintenance issue, especially
when some strategically placed #ifdefs will suffice.

We prefer the ASM versions for SYS V, as we need complete control of
the emitted assembly for interrupt handling and context switching.
The SYS V code is far more mature. IAMCU C code has known issues with
-fomit-frame-pointer.

The only difference between the two calling conventions is that the
first three function arguments are provided in eax, edx, ecx instead
of on the stack.

Issue: ZEP-49
Change-Id: I9245e4b0ffbeb6d890a4f08bc8a3a49faa6d8e7b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-13 17:56:39 +00:00
Andrew Boie dd2273146c test_pool: exclude on olimexino_stm32 and nucleo_f103rb
These two boards don't have enough RAM to effectively run this
test case without making the stacks so small they don't work
on other platforms. ARM is sill covered by other boards.

Change-Id: Ibf20eefaf29f989cbb6da6cd3a8eeed2faa1950b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-12 19:29:19 +00:00
Andrew Boie 8a80ce5c6f Revert "REVERTME: test_pool disable due to memory corruption bug"
Allan fixed the underlying issue, re-enable.

This reverts commit 19fa82ab91.

Change-Id: I6e517f76a6650a3e9ba5a09118187e6c965a147a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-11 17:53:45 +00:00
Juan Manuel Cruz 655a2c89f8 tracing: test includes ipc console fiber if enabled
The test test_thread_monitor fails when a platform enables
the IPC console.
This commit fixes the test to count the IPC console fiber
if it is enabled in the project or the platform.

Change-Id: I9faf9d120b35d9211e558be8f5788885f30c3081
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-07-08 20:34:30 +00:00
Andrew Boie ef29812d51 nios2: support more global pointer scenarios
We now allow use of -mgpopt=global and -mgpopt=data. The 'global'
option is now the default instead of compiler-default local, expanding
global pointer usage to all small data in the system.

For systems where all RAM is less than 64K, the 'data' option may be
appropriate.

Some fixes had to be made to the system in order to get around some
issues:

* prep_c.c no longer uses fake linker variables to figure out the size
of data or BSS, as these gave the linker fits as it tried to compute
relative addresses to them.

* _k_task_ptr_idle is create by sysgen and placed in a special section.
Any small data in a special section needs to be declared extern
with __attribute__((section)) else the compiler will assume it's in
.sdata.

* same situation with extern references to k_pipe_t (fixed pipe_priv
test)

For legacy applications being ported to Nios II which do things that
freak out global pointer calculation, it can be disabled entirely.

Change-Id: I5eb86ee8aefb8e2fac49c5cdd104ee19cea23f6f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-06 18:14:31 +00:00
Andrew Boie 19fa82ab91 REVERTME: test_pool disable due to memory corruption bug
See ZEP-514

Change-Id: I7e9c2c5f81c01e73f1f7ce892fe835ebe3a7a36b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-01 19:44:30 +00:00
Peter Mitsis b4eee20e4b test_fp_sharing: Enable for Cortex-M4
Update the FP sharing test project for use with the Cortex-M4.

Change-Id: If04a191b26291058bd7002ce8a0939eda8a5eb48
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-07-01 19:44:16 +00:00
Peter Mitsis 3490627a97 test_fp_sharing: clean up test code
Clean up test code in preparation for adding Cortex-M4 support.

Change-Id: I64a32e8aa2808b4e0348601e2fc0f7f39cdb413c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-07-01 19:44:15 +00:00
Andrew Boie 571ccee400 test_pool: increase task stack sizes
We were getting a stack overflow on Nios II.

Change-Id: Id2c9be27552f31f5cdbf72dc31e77a106082746b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-01 19:01:58 +00:00
Genaro Saucedo Tejada c8d9b6b5e3 tags: basic kernel objects test for actual hardware
Tagged some tests/kernel testcases with 'bat_commit'. Only test that
work on actual hardware are tagged, while tests with known issues
were left not tagged, test meant for emulator or build only were
also not tagged.

Change-Id: Icede6bc76788aba60d8f1fdcf624e95a7d3116a2
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-07-01 00:38:31 +00:00
Andrew Boie e3ffa67bde test_stackprot: disable for Nios II
No compiler support for -fstack-protector on this arch with the
current toolchain.

Change-Id: Ifa793599b6760c318f16748f9e71c31e0d4edbe7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 18:51:51 +00:00
Andrew Boie 5da328b07b tests: test_tickless: exclude on Nios II
Tickless idle will not be enabled on Nios II due to the
lack of a powersaving instruction.

Change-Id: Ib3c23d803d6335aeb791983e31ad7da2d0deb118
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 18:51:51 +00:00
Kumar Gala 7dcbbc39e7 build: move from srctree to ZEPHYR_BASE for app include paths
$srctree for the application might not be set to be $ZEPHYR_BASE, use
$ZEPHYR_BASE instead to be more explicit in the build.

Change-Id: Iefa5ff59f246b584949329044f7a6531adc6ed62
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-30 14:36:39 +00:00
Tomasz Bursztyka 83c82e6cd6 tests: Allow tc_util to use printf when requested
printk() is too simplistic and does not handle byte precision on formats
like %02x etc... printf does, so letting the possibility to use it when
relevant. This might be useful when dumping out some network packets,
byte by byte where a precision of 1 byte (thus 2 0's) is necessary.

It's better to have this output:
	41 d8 ...
instead of:
	00000041 000000d8 ...

Change-Id: Idc15bbae67830f41388373e2ca1947bb274fb550
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-06-29 05:19:26 +00:00
Andrew Boie ab5f6de4af test_context: build/run on ARC and Nios II
Change-Id: If3e03fef8ed9448bdba82b442ac976bfd6a7ddce
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:13 +00:00
Andrew Boie 30db3401e8 nanokernel: tests: increase stack size from 256 bytes
A recent change modified the fiber stack size of these tests
to 256 bytes, which causes a stack overflow on Nios II. (This
arch has lots of registers)

Increase to 384 bytes, which still compiles well on RAM-constrained
targets like Quark SE SS, Nucleo, etc.

Change-Id: I2152ea9fc1fac693638b8f7a00a6b6628e0c42d3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:08 +00:00
Andrew Boie 2ecb9d45d5 test_irq_offload: unit test for running functions in IRQ context
This is used in many other test cases. However when implementing this
function it's helpful to have a testcase dedicated for it, without
dependencies on other kernel objects.

Change-Id: I66a7cdd0b13712665384d5ad4e79050c82d32e3a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-28 15:56:05 -07:00
Andrew Boie 54b58827b0 test_intmath: new Nios II test case for integer math
Not all CPUs implemement the mul, div, or mulx instructions. Ensure
that any runtime handling of these works correctly.

Change-Id: I50426bd5704cd913f290c9677d1760d53c9e4b56
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-28 22:48:28 +00:00
Inaky Perez-Gonzalez 9e66787a33 test_timer: give it more time, in real HW it seems 60s is not enough
Change-Id: Ifea72f4b0e40aa9351f4d377a032c6133b167055
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-14 23:49:57 +00:00
Inaky Perez-Gonzalez fcec9e37c0 testcases: sanity check TCs get more language for real HW
Add more specifications or qualify some to the sanity check test cases
for them to be ran in real hardware:

 - kernel types (micro vs nano)
 - platforms / arches to exclude / include
 - one that is removed (for the PCI sample) as it cannot be ran
   without extra information

Change-Id: Id14dc15eb89358c3656d2814ea41bb6fec051278
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-14 23:49:56 +00:00
Benjamin Walsh 53c3106520 tests: test nano_fifo_put_list and nano_fifo_put_slist.
Change-Id: I35ab267070126dcf7c8649ed79a7a4a5479b1f55
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-06-13 20:24:42 +00:00
Anas Nashif b67baefefd tests: fix build test configuration
Change-Id: I14f2c0a1c80f0c128db6a5d24830cc31c46308d1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-06-03 18:42:33 +00:00
Luiz Augusto von Dentz 8b1afeaaa3 tests: Add tests for delayed workqueue
Change-Id: If62f44a989012047008c0d782aef2aa7b6016190
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-31 22:52:52 +00:00
Anas Nashif 60b18711f3 tests: remove duplicate kernel configs and usage of ARCH
Many test configs are the same, remove complexity and duplication by
using just one kernel config where applicable.

This removes the usage of ARCH which is a remnant from the days where
we had to specify the architecture of the board, the architecture is now
part of Kconfig and determined basded on the board configuration.

This will also make it easy adding new architectures to test cases without
having to add an architecture specific config file when it is actually not
needed, for example now that we will enable micro-kernel support on ARC.

Jira: ZEP-238
Change-Id: I143fa3c4629c58329cfeb0c761c7a896fc1ef63a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 16:46:08 +00:00
Luiz Augusto von Dentz 21fabb3d39 nano_work: Add nano_work_init
Change-Id: I2e54e3e6ad048ff0d85cbef83e415ad436ecf720
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-21 12:02:57 +00:00
Peter Mitsis 1434d49539 test_fp_sharing: Add testcase.ini files
Adds testcase.ini files for the floating point sharing tests to
ensure that there are run on a daily basis.

Change-Id: I206b1734700f6e998c19d7ad1b36a84400284899
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-20 00:09:24 +00:00
Vlad Dogaru efa3b6fa99 tests: Add nano_work test
Change-Id: I78359bdd75aa2aa5e2f4b34347d838747d60015f
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-12 15:27:24 +00:00
Anas Nashif aaa508a2f8 tests: build using newlib also on ARC
A recent issue due to a change to ARC was not caught because we
do not build on ARC. Now that we have libc with ARC toolchain,
built for all arches.

Change-Id: I8c9b7d37802cb582dcb50e6c61d040078d8ecd26
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-05 14:08:50 +00:00
Andrew Boie 0c4590d252 test_tickless: improve testcase.ini filter
The filter specification now matches the code. We can run on any x86,
or those ARM boards where the test's timestamp.c has _Timestamp*
implementations.

Change-Id: Ib81e5379f892beb3783dd3c345cd536c883a74de
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 22:57:39 +00:00
Andrew Boie 3ea7892410 sanitycheck: allow for more expressive filtering in testcase.ini
The old 'config_whitelist' directive in testcase.ini has been removed.
We use the new expr_parser module to parse a 'filter' directive which
is a boolean expression. This gives a great deal more flexibility
in how tests can be filtered.

To keep the tree bisectable, use of config_whitelist in testcase.ini
converted to the new expression language.

Change-Id: I0617319818c5559c0f0569d2fa73d09b681cac51
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 22:57:39 +00:00
Peter Mitsis 2cac7eea6a tests: Pend microkernel tasks on nanokernel objects
Adds a test for pending microkernel tasks on nanokernel objects.
This explicitly covers the nanokernel FIFOs, LIFOs and timers
while implicitly covering nanokernel sempahores.

Change-Id: Ic044b731da13dea337e199499c23ea425056fae4
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:34 +00:00
Luiz Augusto von Dentz e2c1b2b7be tests: test_slist: Add test for sys_slist_insert
Change-Id: I7b478c78050027013f386146bae6198a554f2005
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-04-28 11:41:15 +00:00
Andrew Boie edc81265b4 test_timer: nanokernel: use empty config for all arches
Extra config for x86 was unnecessary.

Change-Id: Ic86979e80db2c63e07b328375027acec97e751c7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:41:09 +00:00
Andrew Boie 3e156748d0 test_xip: nanokernel: use common proj.conf
They were all the same anyway...

Change-Id: I4cf54d7a837d585885990bfcd168e96059349c4a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:41:04 +00:00
Andrew Boie 7571cdfd59 test_obj_tracing: nanokernel: use common config
The extra config in x86 isn't necessary.

Change-Id: I967a58ae5c04d55c144e9f711a708f43dc023ebb
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:40:59 +00:00
Andrew Boie 1bf37fb6d3 test_errno: remove unnecessary use of nanokernel API
Change-Id: I7bc26e11f82f697b980f9eb9105941bc9caeb6c6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:40:49 +00:00
Anas Nashif 65c06afa58 kinetis: reorganise soc directory using soc family
Add Kinetis SoC family and rename fsl_frdm_k64f to mk64f12.
This will allow adding new SoCs of the same family and the reuse of code
among SoCs of the family and series.

Change-Id: Iea1a663aef7ce0487f147bdd36f668bebe80deb5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:58 +00:00
Anas Nashif 9bf2da7ef4 stm32: rename CONFIG_SOC_STM32 -> CONFIG_SOC_FAMILY_STM32
Use CONFIG_SOC_FAMILY for the top level SoC family. A family
will have different SoCs or different SoC series with multiple
SoCs.
Adding the Family string to the config variable to avoid confusion
between actual SoCs and families and to prevent name collisions.

Change-Id: Ic99a2c1df7850dee3a45641027af82464dd6fadb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:58 +00:00
Andrew Boie a83f895dd5 microkernel: deprecate task IRQs
This mechanism does not add enough value to the kernel to be worth
maintaining it. Drivers that need deferred processing of interrupts
can simply define their own task and have the interrupt handler
release an event that the task waits on.

The API is marked as deprecated and it is removed from unit test
coverage as well as the documentation.

Change-Id: Ib87b91cb41e9b6d7fdf0dc62b240a531b6a8889f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-15 16:02:12 +00:00
Tomasz Bursztyka 1c827b9721 tests: test_early_sleep: Let's test at all initialization level
Not only SECONDARY, but also the following ones:
- NANOKERNEL
- MICROKERNEL
- APPLICATION

Change-Id: Id41fa572c830727166101fa3c6254398857b31c7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-08 15:08:33 +00:00
Maciek Borzecki 54a055426d test_tickless: disable test for STM32 SoCs
Disable the test for STM32 based platforms until an implementation of
timestamp counter becomes available.

Change-Id: I2e50dac36dbfdc61081610c0e0cf1ace8892f602
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-04-01 13:12:57 +00:00
Peter Mitsis 28e5d0287e test_fifo: Reorganize directories
Splits the test into two clear sub-categories: microkernel and nanokernel.
This is done to maintain consistency with other tests that do the same
(e.g. test_obj_tracing, test_sema, test_stackprot, test_timer).

Change-Id: Iddb1ec8d569a9d953fb8af5ce08e87b51995f821
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-04-01 00:07:28 +00:00
Tomasz Bursztyka 71e26d0d03 tests: Add a test suite for the single linked list generic
It will extensively test all provided functions within a normal usage of
the API.

Change-Id: I723203a29c3f3416b464030a7fe34eac5fff6095
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-01 00:01:58 +00:00
Peter Mitsis 30aa2602ad test_fifo: Fix issues flagged by checkpatch
Fixes line length and whitespace issues flagged by the checkpatch tool.

Change-Id: Id49cd5341571ac7893929a2836fe5e06166abe06
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-04-01 00:00:34 +00:00
Yannis Damigos ee587d08a8 tests: kernel: test_context: reduce ram requirements
Reduces the amount of memory allocated for fiber's stack.
This permits the test_context to compile on boards like
nucleo-f103rb. Sanitycheck script passes all test for
test-context.

This patch was verified on the emulated platforms and not
against real hardware boards.

Change-Id: I219f63063ee2dca5b0326e25141d8b37f4cd1d74
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-31 23:17:52 +00:00
Yannis Damigos 32e450024e tests: kernel: test_pool: reduce ram requirements
Reduces the amount of memory allocated for task's stack.
This permits the test_pool to compile on boards like
nucleo-f103rb. Sanitycheck script passes all test for test-nano.

This patch was verified on the emulated platforms and not
against real hardware boards.

Change-Id: Ib8041f6d91e8ffc5fcb16dc73de1f7662d9596da
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-31 23:17:51 +00:00
Yannis Damigos 60695b18a0 tests: kernel: reduce ram requirements
Reduces the amount of memory allocated for stack (both fiber
and task). This permits test_sema and test_mutex to compile
on boards like nucleo-f103rb. Sanitycheck script passes all
tests for test_sema and test_mutex.

This patch was verified on the emulated platforms and not
against real hardware boards.

Change-Id: Ie25288bbbbfa64bfc5f7463639bfb09639cc184f
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-31 23:17:51 +00:00
Yannis Damigos 560e6a3cf4 tests: kernel: test-fifo: reduce ram requirements
Reduces the amount of memory allocated for fiber's stack.
This permits the test_nano to compile on boards like
nucleo-f103rb and arduino 101 sss. Sanitycheck script passes
all test for test-fifo.

This patch was verified on the emulated platforms and not against
real hardware boards.

Change-Id: Icf30c4056d9f9ebdc82c100305bf761e49b64491
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-30 22:21:25 +00:00
Yannis Damigos f004330589 tests: kernel: test-lifo: reduce ram requirements
Reduces the amount of memory allocated for fiber's stack.
This permits the test to compile on boards like
nucleo-f103rb and arduino 101 sss.
Sanitycheck script passes all test for test-lifo.

This patch was verified on the emulated platforms and not
against real hardware boards.

Change-Id: I1dd514c9d273bcf490e0eb4f1fadee1a8a94bcc5
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-30 20:02:54 +00:00
Anas Nashif e444363cb9 sanity: add quark_se_devboard to tested boards
Change-Id: I82cefb1baaa0c7174cebcd35c527fec3d133241e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-30 11:04:36 +00:00
Ramesh Thomas bb19e6f82f power_mgmt: Make names consistent with new RFC
Changed names of Kconfig flags, variables, functions, files and
return codes consistent with names used in the RFC. Updated
relevant comments to match the changes.

Origin: Original
Change-Id: Ie7941032d7ad7af61fc02928f74538745e7966e8
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-26 14:35:11 -04:00
Dmitriy Korovkin 0986684e62 tests: Add test for microkernel early sleep functionality
Test verifies that a task_sleep() function can be used during the system
initialization, then it tests that when the k_server() starts, task_sleep()
call makes another task run.

For fibers, test that fiber_sleep() called during the system
initialization puts a fiber to sleep for the provided amount of ticks,
then check that fiber_sleep() called from a fiber running on the
fully functioning microkernel puts that fiber to sleep for the proiveded
amount of ticks.

Change-Id: Iec20b61d7e802a19b1ec074d2511345eed9f2407
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-03-26 10:17:22 +00:00
Andre Guedes 54337aa736 test: Convert returning code to errno.h
Change-Id: Ib4e3fb2e3c1cecf7e1646c7dc03b16e9ce4b6da2
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-23 15:49:40 +00:00
Juan Manuel Cruz 6d040a89ff debug: add task tracing to sanity test
Change-Id: I2d9691d094a764b9e884ef5f7a2700bedcf71745
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:13:43 +00:00
Juan Manuel Cruz 5f566034e5 debug: object tracing sanity test includes thread monitor.
Change-Id: Ic57ed69374b2075bcdf5cd5d72b83b03b59fbac5
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:10:23 +00:00
Anas Nashif 63ec21c451 Revert "tests: Add test for microkernel early sleep functionality"
This reverts commit b1a0041de6.

This breaks sanitychecks in CI. The early_sleep kernel test case is failing
randomly.

Change-Id: I129b649f7010da90f52616f6fd63eec8b63f8247
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-11 22:09:42 +00:00
Anas Nashif 3d9759c9c5 Revert "sanitychecks: skip early_sleep test"
This reverts commit f9d1d56153.

This breaks sanitychecks in CI. The early_sleep kernel test case is failing
randomly.

Change-Id: I4b21f926198af9f0703f042fc170226ed6ab4331
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-11 22:09:31 +00:00
Juan Manuel Cruz 83cbf63431 debug: sanity test for kernel object tracing
Adds the sanity test to integrate the kernel object tracing
API. The test implements the philosophers demo and adds
an additional test thread that uses the kernel object tracing
API and test for the correct output.

Change-Id: I2f01f7b3386afd4783ae58b5311eb7d6ee5a3cea
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
Origin: Original
2016-03-11 22:07:15 +00:00
Anas Nashif f9d1d56153 sanitychecks: skip early_sleep test
Test fails in CI, disabling until we have a resolution.

Change-Id: Ie8e1ca00b08238c2c2a4feefbe08140c762e6d2f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-11 11:40:49 -05:00
Dmitriy Korovkin b1a0041de6 tests: Add test for microkernel early sleep functionality
Test verifies that a task_sleep() function can be used during the system
initialization, then it tests that when the k_server() starts, task_sleep()
call makes another task run.

For fibers, test that fiber_sleep() called during the system
initialization puts a fiber to sleep for the provided amount of ticks,
then check that fiber_sleep() called from a fiber running on the
fully functioning microkernel puts that fiber to sleep for the proiveded
amount of ticks.

Change-Id: Ibe20ca1ca966575aaaad0b6ffd66ca43512801f0
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-03-10 18:39:33 +00:00
Anas Nashif e81053ee03 samples/tests: remove old message about standard security
Change-Id: I52bb6731a8c7b2c3ba38b867ac57ff82332ae7f2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-07 16:07:35 +00:00
Andrew Boie 7393a00a5f test_bitfield: exercise sys_*_bit and sys_bitfield_*_bit
Origin: original code
Change-Id: I16c324e1124a58d77386236f4c0cc597041c220e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-04 15:12:07 +00:00
Peter Mitsis e0f8162a8b test: Add nanokernel test_sleep project
The 'test_sleep' nanokernel project tests the following functionality:
   1. Normal expiration of fiber_sleep()
   2. Waking a sleeping fiber via fiber_fiber_wakeup()
   3. Waking a sleeping fiber via isr_fiber_wakeup()
   4. Waking a sleeping fiber via task_fiber_wakeup()
   5. Normal expiration of task_sleep()

Change-Id: Ie51997ace9a4413f62d77daacd6dff97b6b3a4dd
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-23 10:48:54 -05:00
Peter Mitsis 06e2b4e129 nanokernel: Change fiber_delayed_start() return type
Instead of returning a 'void *', the nanokernel fiber_delayed_start()
family of routines now return a handle of type nano_thread_id_t.

Consequently, the nanokernel fiber_delayed_start_cancel() family of
routines now accept a parameter of type nano_thread_id_t instead of
'void *'.

The complete list of affected nanokernel routines is:
    fiber_delayed_start()        fiber_delayed_start_cancel()
    fiber_fiber_delayed_start()  fiber_fiber_delayed_start_cancel()
    task_fiber_delayed_start()   task_fiber_delayed_start_cancel()

Change-Id: Ibd4658df3ef07e79a81b7643a8be9ea5ffe08ba0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-23 10:48:54 -05:00
Anas Nashif 1e57226ae6 boards: remove obsolete CTB board
This board is not supported and not available for general public.
Use the Quark SE CRB/Devboard instead.

Change-Id: Id0f8c08bbacb812ef00fe9502b4acecf4f31ffd7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-17 17:07:08 +00:00
Anas Nashif 2250c4d397 tests: test_fifo: unify nano and micro tests into one directory
Manage this test using one testcase.ini for both nano and micro
kernel cases.

Change-Id: I9757299cdced17e7fcbfa1fbbbcf87693b48bf41
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00
Anas Nashif d746f2726f test_rand32: only microkernel version exist
eliminate one directory level since we only have one kernel variant.
Remove one level in the hierarchy.

Change-Id: I0924b5a40357b1a892f7ed3ecf512f617edc99a3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00
Anas Nashif 7e44279399 test_ring_buf: only nanokernel version exist
eliminate one directory level since we only have one kernel variant.

Change-Id: I53dc387c15c6a6efc74f88c477015b2e422c5d6c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00
Anas Nashif bc19b72974 test_task_priv: only microkernel version exist
eliminate one directory level since we only have one kernel variant.

Change-Id: I72597e8253d027cd134dd58cc3051f21dce376d0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00
Anas Nashif 1642796202 test_task_irq: only microkernel version exist
eliminate one directory level since we only have one kernel variant.

Change-Id: Ia9f457db372729f403be24c7a502a896623db5b9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00
Anas Nashif 8bbf02d3f3 test_task: only microkernel version exist
eliminate one directory level since we only have one kernel variant.

Change-Id: I7d7c31e7dc5b98ad8ea0ad9e17a05694ac89770a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00
Anas Nashif 65f538238b move driver samples to samples/drivers
All SoC specific driver tests go to samples/drivers.

Change-Id: Ia9aa2140465320a548504ddb7a44569e2d2af6bd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00
Anas Nashif 8290b4c795 move include directory for tests cases to tests/
Make the test case routines reside under tests.

Change-Id: Iea59a68e8b537954250d63923a88df267639e716
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 18:08:08 +00:00
Anas Nashif 13b3727e6e tests: move kernel tests to tests/
Move all kernel testcases to tests/ and change Makefiles
accordingly where applicable.

Change-Id: I130cc3919174e93b7130d55fb101bed1d5d7552d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 18:06:33 +00:00