Commit graph

165 commits

Author SHA1 Message Date
Anas Nashif c364e06ccb tests: move spi test under tests/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif 68d7a207ae ethernet: fix Kconfig option for ETHERNET
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Punit Vara fe882f407d tests: Remove camel case and fix coding style
Test whichever had Camel case defined for functions and variables have
been replaced.

Following warnings have been fixed in test cases as well.
- line over 80 characters
- Macros with flow control statements should be avoided
- Macros with complex values should be enclosed in parentheses
- break quoted strings at a space character
- do not add new typedefs
- Comparisons should place the constant on the right
  side of the test
- suspect code indent for conditional statements
- Missing a blank line after declarations
- macros should not use a trailing semicolon
- Macros with multiple statements should be
  enclosed in a do - while loop
- do not use C99 // comments

JIRA: ZEP-2249

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-06-29 07:00:50 -04:00
Anas Nashif b3ae274a62 tests: fix PCI test using 'supported' keyword
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-28 09:51:40 -05:00
Anas Nashif 3c50f7aa12 tests: samples: remove duplicate filtering
We have many testcases doing filtering both on the architecture level
and the platform level, which is redundant. Also many testcases are
running the same test twice on the same SoC for no good reason, cleanup
the tests and cleanup the filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Johann Fischer 6dbe738d0e tests: dma: fix chan_blen_transfer
Use sizeof instead of strlen to get the correct buffer
length and initialize rx buffer with zeros before the dma
transfer.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-23 15:56:08 -04:00
Anas Nashif 470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif cc24f4b03c tests: samples: convert testcase files to yaml
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif 31ff9f2ad5 tests: move ipm test to drivers
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
David B. Kinder ddbf1255a9 test: fix misspellings
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-17 22:34:45 -04:00
Anas Nashif ea1addbb3c tests: rename test directory test_loop_transfer -> loop_transfer
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif fcb1d175e6 tests: rename test directory test_chan_blen_transfer
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Youvedeep Singh ff5b3249f4 tests: aio: Change reference voltage for AIO
Change reference voltage for Analog comparator to Internal reference
voltage.

Currently AIO is using External reference voltage (Reference A) and
external reference is set at 3.3V. In this usecase both reference
Voltage and AIO IP are set at 3.3V. So rising edge interrupt behaviour
will be unpredictable.

So by changing internal reference voltage to Internal (set at 1.09V)
interrupt will be generated as soon as Voltage on I/P will exceed it.

Jira: ZEP-1927

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-18 20:26:56 -04:00
Qiu Peiyang b0962e3bac tests: aio: port AIO cases to run on more platforms
AIO should be supported on more platforms. Adapt
this case to make it run on more platforms.
Also keep reference voltage for comprator as internal.

Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-05-18 20:26:56 -04:00
Paul Sokolovsky b7f6aaaa72 tests: uart_basic_api: Don't assume we can drink from IRQ firehose.
There're (at least) 2 UART TX interrupt causes: "tx fifo has more
room" and "transmission of tx fifo complete". Zephyr API has only
one function to enable TX interrupts, uart_irq_tx_enable(), so it's
fair to assume it enables interrupt for both conditions. But then
immediately after enabling TX IRQ, it will be fired with "tx fifo
has more room" cause. If ISR doesn't do anything to fill FIFO, on
some architectures, immediately after return from ISR, it will be
fired again (with no instruction progress in the main application
thread). That's exactly the situation with this test, and on ARM,
it leads to inifnite IRQ loop.

So, instead move call to uart_fifo_fill() inside ISR, and be sure
to disable TX IRQ after we transmitted enough characters.

Change-Id: Ibbd05acf96b01fdb128f08054819fd104d6dfae8
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-05-02 09:31:36 -04:00
Andrew Boie 7827b7bf4a x86: exception-assisted panic/oops support
We reserve a specific vector in the IDT to trigger when we want to
enter a fatal exception state from software.

Disabled for drivers/build_all tests as we were up to the ROM limit
on Quark D2000.

Issue: ZEP-843
Change-Id: I4de7f025fba0691d07bcc3b3f0925973834496a0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-22 10:31:49 -04:00
Kumar Gala eaaa175b92 tests: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I6c676bc6c5e850a8725785554cd535e32067f33e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:53:49 -05:00
Kumar Gala c7bc909914 tests/ztest: rename assert macros to be zephyr specific
ztest has a number of assert style macros and used a baseline assert()
that varies from the system definition of assert() so lets rename
everything as zassert to be clear.

Change-Id: I7f176b3bae94d1045054d665be8b5bda947e5bb0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-13 21:17:33 +00:00
Anas Nashif b84dc2e124 kernel: remove all remaining references to nanokernel
Change-Id: I43067508898bc092879f7fe9d656ccca6fd92ab2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-10 20:21:10 +00:00
Qiu Peiyang 9f98bb44ae tests: driver: uart: fix unchecked return value
Coverity points out that uart_irq_update() return value
should be checked.

Coverity-CID: 166776

Change-Id: I3a754dae9e8f1563f4879e2fadfd89621785de8f
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-04-09 15:07:44 +00:00
Jon Medhurst a89ed6d7d5 tests: dma: Initialise callback enable flags
The test failed to initilise these to known states, so fix this by
asking for end of transfer and error callbacks.

Change-Id: I523168381329062ec0c17aa41cb4033b78d8ed99
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2017-04-05 17:18:23 +00:00
Qiu Peiyang fe415dbf62 tests: drivers: spi: fix variable type mismatches
These were flagged by icx build.

Jira: ZEP-1887

Change-Id: Iaeedb13be23e86ebfb29a6441574b7384ae836e1
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-04-01 20:36:03 +00:00
Anas Nashif 25aa9e8e36 tests: enable syslog for sensors
Change-Id: If866083d5707a83b1df0a3411f3a848fdf40dbcb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-25 12:00:30 +00:00
Qiu Peiyang 8d4f1bcb78 tests/gpio: enable gpio cases to run on more platforms
Add pin definitions to enable GPIO cases to run on
Quark D2000.
Add pin definitions to enable GPIO cases to run on
arduino_101_sss.

Change-Id: I97eadb8316b1f80b899b167a01effab815626dae
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-03-07 23:03:01 +00:00
Qiu Peiyang 935663f05e tests: fix disabling of GPIO interrupt issue
According to ZEP-1717, removing the callback from
the gpio is not enough to disable interruptions.
You also need to call gpio_pin_configure() on
the input pin without the GPIO_INT flag to totally
disable the interrupt for the pin.

This commit will stop level interrupt from being
fired constantly.

Change-Id: I019d7cea0bc0d5e5ff4b74165472ed11de1733bb
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-03-07 23:01:52 +00:00
Qiu Peiyang 2d033483de tests: add zephyr pinmux driver api test case
This commit verifies the following pinmux driver apis:
	pinmux_pin_set()
	pinmux_pin_get()

Change-Id: Iedf1b4e918b518b2205e9059b3b08f41cd243d37
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-03-07 23:01:28 +00:00
Qiu Peiyang 1124da16de tests: add zephyr SPI driver api test case
This commit verifies the below SPI driver apis:
	spi_configure()
	spi_slave_select()
	spi_write()
	spi_transceive()

Verify SPI work in SPI_MODE_CPOL, SPI_MODE_CPHA,
and SPI_MODE_CPOL | SPI_MODE_CPHA.

Jira: ZEP-1626

Change-Id: I1985ac6ff8269ac908817644a844720f2d7a125c
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-07 23:00:54 +00:00
Jithu Joseph fbde97d44a tests: drivers: uart: fix variable type mismatches
These were flagged by icx build.

Jira: ZEP-1864

Change-Id: I5b8fce64d9e20d768fabf02e2a799e9390e3679a
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-03-07 12:00:33 -08:00
Erwan Gouriou e895d576db tests: update uart driver api test case
Depending on test environment, termination character could
be '/r' instead of '/n'.
Enabling both possibilities.

Change-Id: I18b47e9055667e0a4f868416ee8d01226a879712
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-23 13:30:47 +00:00
Sergio Rodriguez b6cf56e5cc tests: watchdog: Interrupt reset mode modifications
In order for interrupt reset mode to work (reset the processor
after and interrupt) the interrupt does not has to be cleared,
and the qmsi hal layer clears the interrupt after the callback
has been invoked, the callback does not return and the processor
should reset.

Jira: ZEP-1566

Change-Id: Ic951a0f15fe95fb0ef5d752b831c62e6fa3ceea0
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-02-23 13:29:13 +00:00
Kuo-Lang Tseng 4533734dc6 aon_counter test: fix misspelling in the header include guard
The include guard has a misspelling.

Jira: ZEP-1746

Change-Id: I4d8000ef5c8e037f80acbf2491d0b9466670816a
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:23:35 +00:00
Anas Nashif fe118c4e95 license: replace APL2.0 license with SPDX
Some files made it through review process with full license header.

Change-Id: I2722b127c40b4b19500042c12e4fde85a165bae9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-20 16:59:46 +00:00
Qiu Peiyang 34b53f181f tests: add zephyr uart driver api test case
This commit verifies the following uart driver apis:
	uart_irq_callback_set()
	uart_irq_rx_enable()
	uart_irq_rx_disable()
	uart_irq_rx_ready()
	uart_irq_tx_enable()
	uart_irq_tx_disable()
	uart_irq_tx_ready()
	uart_fifo_fill()
	uart_fifo_read()
	uart_irq_update()
	uart_poll_in()
	uart_poll_out()

Change-Id: I9be9341aee4357f86a2bc49f19733fb84273e89c
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-20 13:42:47 +00:00
Jithu Joseph 4462509ea7 spi_test: fix variable type mismatches
This was reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: Ib97ed8da830126c9fbfa2269c8b2327d2f1be2f4
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-14 02:13:53 +00:00
Qiu Peiyang 0c87784c84 tests/gpio: fix test GPIO_INT_EDGE bug
When test GPIO_INT_EDGE, there is no code to skip GPIO_INT_LEVEL
and jump to the end of the function. So GPIO_INT_LEVEL will
always be checked (Besides, it't always true), even if it's
testing GPIO_INT_EDGE, which will cause GPIO_INT_EDGE cases fail.

Add a goto statement for GPIO_INT_EDGE to skip GPIO_INT_LEVEL.

Jira: ZEP-1685

Change-Id: I10ce21c04c49f34aafdc2cd2f60f3e5377d6f1f5
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-12 01:04:09 +00:00
Qiu Peiyang bc2faf3737 tests/pwm: enable PWM case to work on D2000 board
This test case uses PWM0 port to test PWM on Quark Se.
However PWM0 port on Quark D2000 is initialized as tdo,
not PWM0 and disabling tdo will kill JTAG on D2000. So
use PWM1 and add PINMUX setting code to configure PIN_24
as PWM1 port, then the case will work on D2000 board.

Change-Id: Ib28d4750dac7396529388b781fb64bde048139d6
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-12 01:04:08 +00:00
jing wang 484f07cec7 tests: add zephyr adc driver api test case
the commit test below adc driver api with different resolutions
and modes
    adc_enable()
    adc_read()
    adc_disable()

move original adc test to adc_simple folder

Change-Id: I016b5e67a5d89fc8d5ae76f33799e5d3eb3e1cf8
Signed-off-by: jing wang <jing.j.wang@intel.com>
2017-02-12 00:33:59 +00:00
Qiu Peiyang 45c579a271 tests: add zephyr counter and timer api test
The commit verifies below aon counter and timer apis:
	counter_start()
	counter_read()
	counter_set_alarm()
	counter_get_pending_int()

Change-Id: Iaac9a224372ee1c1dd12a223ca222f4485957575
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-12 00:26:43 +00:00
Baohong Liu 59b8af5395 tests: dma: update dma loop transfer app
Update the dma loop transfer sample app to use the new
dma api interfaces. This change is based on the api change
and the updated dma driver.

A RFC was posted recently on this.

Jira: ZEP-873

Change-Id: I289e2e08d4c775a833bf3d585d2706a903edd0bc
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2017-02-11 05:18:22 +00:00
Baohong Liu 00210386c6 tests: dma: update dma block transfer app
Update the dma block transfer sample app to use the new
dma api interfaces. This change is based on the api change
and the updated dma driver.

A RFC was posted recently on this.

Jira: ZEP-873

Change-Id: Icf3bec7260c2e499485b07a4a579956448a1a3fd
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2017-02-10 02:18:17 +00:00
jing wang 61e5438c51 tests: add zephyr i2c driver api test
the commit verify below i2c apis by sensor
GY271 or HMC58831
    i2c_configure()
    i2c_write()
    i2c_read()
    i2c_burst_write()
    i2c_burst_read()

Change-Id: I072a9897a45636613e811baa7ff79b57206e4130
Signed-off-by: jing wang <jing.j.wang@intel.com>
2017-02-04 19:31:31 +00:00
Anas Nashif 0a3738019f pinmux: unify galileo pinmux driver
Remove dev driver and integrate it in the default pinmux driver.

Jira: ZEP-958
Change-Id: I55670240f8a21749d3a6ae22e300e16ba80a2fb6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-25 20:43:18 +00:00
Anas Nashif 42e1c9ca34 pinmux: make pinmux_dev the default pinmux driver for quark
Jira: ZEP-958
Change-Id: Ib6c528a103372d5084efa5ae8635803e2912e0dd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-25 20:43:18 +00:00
Qiu Peiyang 41ffe0240d tests/gpio: fix test GPIO_INT_LEVEL bug
According to include/gpio.h, GPIO_INT_LEVEL is 0,
which means the branch to test GPIO_INT_LEVEL is
always false and GPIO_INT_LEVEL cases will always
pass.

This patch also fixes another minor bug in main.c.

Coverity-CID: 160074

Change-Id: I1fefa978e65bf801f244b4c2960cb87a26b0829e
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-01-25 14:25:48 +00:00
Qiu Peiyang cbeac3e97d tests/gpio: don't call risk function
According to Coverity, rand() is a risk function.
So we use another method to generate random value.

Coverity-CID: 160070

Change-Id: Icb7e06cd43cb8bade6596cc37e9d04bfc59e1de7
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-01-25 14:25:03 +00:00
Maureen Helm 06bd605da3 tests: Update spi driver test for mcux
Jira: ZEP-1374
Change-Id: Ibd66df42919d085666cfd7e98bea5c808d8d54e0
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:54 -06:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Anas Nashif a1ae7f565b Merge "Merge arm branch into master" 2017-01-12 18:23:39 +00:00
jing wang ae2cf51591 tests: Add PWM driver api test
The commit verify below PWM apis
    pwm_pin_set_cycles()
    pwm_pin_set_usec

test PWM apis under always-on, half-on and alway-off modes

Change-Id: I2251be23ad9c443703dac44e138651a63d2d7211
Signed-off-by: jing wang <jing.j.wang@intel.com>
2017-01-12 15:54:16 +00:00
Maureen Helm acca033468 pinmux: Merge ksdk pinmux dev into regular ksdk pinmux driver
Merges the ksdk pinmux dev driver into the regular ksdk pinmux driver,
which now exposes the public pinmux API. Removes the private ksdk pinmux
API and converts the frdm_k64f and hexiwear_k64 boards to use the public
pinmux API.

Jira: ZEP-958, ZEP-1432
Change-Id: Ie5f60b604133093050b9c596050cad776d7b7cb3
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-12 09:46:25 -06:00
Kumar Gala 76480636f9 tests/sensors_n_z.conf: fix duplicated setting of CONFIG options
A few CONFIG options got set twice in sensors_n_z.conf, remove the
duplicates as we get warnings associated with this:

warning: override: reassigning to symbol GPIO
warning: override: reassigning to symbol SENSOR
warning: override: reassigning to symbol SPI
warning: override: reassigning to symbol SYS_LOG_SENSOR_LEVEL

Change-Id: I7a723218db8e365bdb45c004e93bd2c4f55ab5ac
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-11 19:40:01 +00:00
Anas Nashif f6e039062a kernel: remove dependency on CONFIG_NANO_TIMERS/TIMEOUTS
Remove legacy option and use SYS_CLOCK_EXISTS where appropriate.

Change-Id: I3d524ea2776e638683f0196c0cc342359d5d810f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-08 18:09:52 +00:00
Qiu Peiyang a6aa60f502 tests/gpio: fix typo
Change-Id: Ic93d1e5dcb46455abd3ea2d7fe8790b2163c1c67
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-01-05 23:54:18 +00:00
Andrew Boie 0f08bd8cf8 gpio_basic_api: fix format codes
Change-Id: I006a0c3efe24a6d41a488a466cba97e9bbd1c164
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-03 20:37:40 +00:00
Anas Nashif 66cfcc26bc tests: introduce Makefile.test
To customise test builds and support test related features such as time
stamps and a boot banner, introduce a Makefile variant that is dedicated
to testing.

Initially we introduce a new config overlay that is used for all tests, in
this case we enable BOOT_BANNER and BUILD_TIMESTAMP. This will print the
current version and the date, useful when reporting bugs and also an
indicator that the system has booted before the test has started.

For example:

[QEMU] CPU: qemu32
***** BOOTING ZEPHYR OS v1.6.99 - BUILD: Dec 21 2016 19:57:13 *****
tc_start() - Test Nanokernel CPU and thread routines
Initializing nanokernel objects
...
..

Change-Id: I224318cdeb55a301964ea366dbc577e2e3a09175
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-03 17:48:44 +00:00
Anas Nashif 7297f5db88 shell: move shell to its own subsystem
This moves the shell component into its own subsys and groups all
related files and options into a single place.

Additionally, one Kconfig option will now be required to enable the
shell:

 CONFIG_CONSOLE_SHELL=y

The header files was also moved to include/shell/shell.h and can be now
referenced with

 #include <shell/shell.h>

instead of

 #include <misc/shell.h>

Updated documentation as well.

Change-Id: Iffbba4acfa05408055e9fd28dffa213451351f94
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-25 19:35:11 +00:00
jing wang b008914e42 tests: add gpio driver test case
the commit include 5 ztest cases, cover the basic gpio APIs
including callback relevant and pin read/write functions.
It proves workable on intel quark c1000 and
arduino 101 platform

Change-Id: Iab30aa841cfa440c1f773b5a8c5ce0d68346c353
Signed-off-by: jing wang <jing.j.wang@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-24 16:24:26 +00:00
jing wang 3d99a0c878 tests: add driver aio comparator test case
the commit cover below apis by testing callback under RISE polarity
    *) aio_cmp_configure
    *) aio_cmd_disabel

Change-Id: Idc9ec3a2694950d0074b69d164ee2c1edac35c9a
Signed-off-by: jing wang <jing.j.wang@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-24 16:24:25 +00:00
jing wang d15523f223 tests: Add watchdog timer test case
The commit cover Interrupt Reset mode and Reset mode by 2 test cases.
They can't be tested in one shot, but need test separately.
api converage:
    wdt_enable()
    wdt_disable()
    wdt_set_config()
    wdt_get_config()

Change-Id: I44b20cfe97d860e8b25b2cab76f9d9398cfd8e69
Signed-off-by: jing wang <jing.j.wang@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-24 13:09:29 +00:00
jing wang ed754ecf6d tests: add rtc driver test case
the test include 2 ztest cases, verfy below apis:
    rtc_enable()
    rtc_disable()
    rtc_read()
    rtc_set_config()
    rtc_set_alarm()
    rtc_get_pending_int()

Change-Id: Ifca2541312c5ec8d450803f1b6e4f5064098e7fe
Signed-off-by: jing wang <jing.j.wang@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-24 13:09:28 +00:00
Baohong Liu 83a388e6c8 tests: spi: correct a spi buffer length issue
Make the buffer length for tx and rx are the same for
spi_transceive API call. QMSI only supports equal length.
This is clearly specifed in spi header file.

Also correct some coding style issues.

Change-Id: Ifd34683e8813dae9b692ad453176a93cb3848427
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-22 01:20:42 +00:00
Benjamin Walsh a1622472c3 drivers: hp206 driver does not need 2000 ticks/s frequency
From code inspection, the driver always took timeouts in milliseconds.
The only sub-ms wait uses k_busy_wait(), which has microseconds
granularity, but its granularity does not depend on the system clock
tick rate.

Change-Id: If48363fd1fbeeb8e5ff0f0f2ca86e671d63bc571
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-21 19:50:06 +00:00
Genaro Saucedo Tejada 1589f2ccdd sanity: filter the build-all test for ethernet
Ethernet build-all test was not being filtered base on RAM size so
build step LINK was failing with "region `RAM' overflowed by 192
bytes" error when running daily sanitycheck.

Added filter so this test is not attempted for boards with smaller
RAM such as quark_d2000_crb, which was causing daily build failure

Change-Id: I4ed3bef4f1c78e83890331db34fb1f2b2b066414
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-12-14 17:25:10 +00:00
Marcus Shawcroft 954baea90b random: Restructure RANDOM Kconfig
Restructure the RANDOM Kconfig to match the structure used in other
drivers with a single top level menu.  Move the true random number
generators to appear first in the menu, with pseudo generators at the
bottom.  Do not present pseudo generators if a true random generator
is presented.

This change implies that tests, samples and applications that require
the random driver interface must now select CONFIG_RANDOM_GENERATOR.

In order for tests and samples to build (and run) on platforms that
have no random driver it remains necessary to select
the CONFIG_TEST_RANDOM_GENERATOR.

Note that CONFIG_TEST_RANDOM_GENERATOR retains its original purpose of
enabling a random driver that delivers non random numbers for the
purpose of testing only.

Change-Id: I2e28e44b4adf800e64a885aefe36a52da8aa455a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-13 22:50:18 +00:00
Maureen Helm 4a1c31a790 k64: Change the default pinmux driver to the ksdk one
Stop using the specific k64 pinmux driver by default and start using the
more generic ksdk pinmux driver instead.

Jira: ZEP-1393
Change-Id: Id65b59518c386e6ba33cfa5c4c5bd541664d2b41
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-12-10 21:14:12 +00:00
Flavio Santes f6f60dc2c8 tests/drivers: Update pinmux application
This commit updates the pinmux test case application
to match with the hello_world sample app.

Change-Id: I86f459062527b7e2831bd7a3dfaf6bf8b28ef132
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-26 10:46:11 +00:00
Baohong Liu d5ccac16be tests: spi: add return value check
Add function return value check. This was caught by
Coverity.

Coverity-CID: 151950

Change-Id: Iee550e15d124f05f0b0514fdad22d06c617beac2
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-17 14:42:58 -08:00
Baohong Liu 16b62051fb tests: spi_test: fix variable type mismatching issue
The variable type mismatching was caught by LLVM.

Jira: ZEP-1179

Change-Id: I37934ef2ee47c521a78086564876843794688d55
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-16 00:17:52 +00:00
Inaky Perez-Gonzalez 9e1df6f21f tests/drivers/adc: move to ztest to actually test
This TC is only exercising the API, as we don't have a feedback loop
mechanism to verify whichever values are fed to the ADC.

Fixed the loop to complete after 10 runs; on each run, print the
values and actually report the difference between them. With no inputs
connected (aka: floating), they should be reporting noise relatively
close to the previous reading, so we might want to use this delta as a
testing pattern (assert if the delta is higher than some value, but
I've seen variations as high as 40M units). For now, the test is just
happy with being able to read them.

The buffer has been re-typed to uint32_t so we can iterate over it
without casting tricks -- it requires then only a single cast when
initializing sample.buffer (which shall be a void* anyway).

Duplicated the buffer, so we can flip/flop between two buffers to
compare against the entries read in the previous run.

v4: fixed missed warnings

Change-Id: If6b48b92231007202d74f5c042f6d0cf3fdcb60a
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-14 03:27:50 +00:00
Inaky Perez-Gonzalez bcb6ed95e7 tests/drivers/pci_enum: move to ztest and run in HW when possible
This test case just exercises the PCI enumeration and there is no real
way to test success/failure other than running it and the kernel not
crashing.

Moved to ztest.

Retag so it is actually ran on QEMU/x86 and galileo once we deploy in
the HW pool. Note this means that we need to force CONFIG_PCI on
Qemu/x86, which can run this testcase.

Change-Id: I85b64800f7d989357927b4a25777041047293b34
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-14 03:27:37 +00:00
Anas Nashif 3fe2575f0d drivers: sensors: use unified kernel threads
convert all sensor drivers to use threads and the unified kernel API and
remove all legacy APIs.

Change-Id: Ica43ea74ecbbf85273f718f182c413a9dcd8abc6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-11 21:00:19 +00:00
Baohong Liu c9e295932b tests: aonc: skip counter stopping
Leave the aon counter in running state after the test.

Arduino 101 loader assumes the counter is running.
Stopping the counter will cause the next app to
not start without a hard reset or power cycle.

Jira: ZEP-961

Change-Id: Ia88f0c642b1df8dc5e2b1ee6c55ff0618b6127d0
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-10 17:56:13 -08:00
Baohong Liu ab96d3648a tests: dma: update to unified kernel
Use k_sleep instead of nano timer.

Change-Id: Ic1cc68cefa23b2e291e3605f4795cbe21ad98fc0
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-11 00:47:59 +00:00
Baohong Liu 5e2f899bad tests: adc: update to unified kernel
Use k_sleep instead of nano timer.

Change-Id: Iba88b93c71dedd60bdbb842fd8e44a55593f54bf
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-10 23:16:55 +00:00
Inaky Perez-Gonzalez 5b7bfdaf48 tests/drivers/aon_counter: make a ztest testcase
Reorganize the code tree so no forward declarations are needed
(basically, move main() to the bottom).

Retag as not build only so it can be run on Quark*

Convert to actually verify counter readouts are increasing /
decreasing over busy empty loops and the alarm is being called.

Change-Id: I746efe595b8d1ac4471dccc2e87f8b36f5cc8ebe
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-10 01:08:14 +00:00
jing wang 2c311431fc tests: add a dma transfer test with different channel and burstlen
This TC cover dma transfer with different channel and burst length
It support 2 ways to execute
*) full-auto: by default, it run all sub test cases defined in array
   once flashing done and reset.
*) interactive: when CONFIG_CONFIG_CONSOLE_HANDLER_SHELL=y, it go into
   shell first, user can input test command one by one for debugging.

move original test under drivers/dma to test_loop_transfer/

Change-Id: I7e78b730592c80bf2c23b20c8b0eb65a9b353acd
Signed-off-by: jing wang <jing.j.wang@intel.com>
2016-11-09 02:38:57 +00:00
Anas Nashif d622b09bc0 samples: tests: remove obsolete KERNEL_TYPE and kernel variables
Remove those from Makefiles and testcase.ini, we now support unified kernel
only and sanitycheck script now knows how to deal with this.

Change-Id: I853ebcadfa7b56a4de5737d95f2ba096babb2e13
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 15:47:25 -04:00
Anas Nashif 5d317a0eb5 tests: do not build sensors for system with < 32k {S}RAM
Change-Id: I9cc87da7c32d9ffde5dd8f3419fdedd4683d3f0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 12:54:35 +00:00
Marcus Shawcroft db20018bad tests: Add FXOS8700 sensor to driver build_all test.
Change-Id: I60f62d54b3743335ae80bbb58b2c4ce690b43f41
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-28 10:54:45 +00:00
Anas Nashif 36e1e2dbaf move tests from samples to tests/
Change-Id: Ib183936134d27ff84d9af57e8e2e2d9f0cc2670f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:13:36 +00:00
Marcus Shawcroft e7a943385d test: drivers/build_all support HP206C
Change-Id: Ifad32d59a9786e5b1334532c5c6e7f29657c2a77
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:10 +00:00
Marcus Shawcroft f201b2e79a test: drivers/build_all add CONFIG_WATCHDOG
Change-Id: Ie28877dcb07136cf088b151d8394de606603bfa7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:08 +00:00
Marcus Shawcroft b5dba510d0 test: drivers/build_all refactor, impose some order...
Change-Id: I2fc6c43d489193e39f643d8cac1a8ba6ea57a896
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:07 +00:00
Marcus Shawcroft 1be63f3526 test: Add PINMUX to drivers build_all
Change-Id: I6d115ca5726bcc9e7b4100a3fce7fcc965b37cae
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:50:55 +00:00
Marcus Shawcroft f603981707 sensor/th02: Add missing build_all test.
Change-Id: Ib19ab95389e8867c306d44cd542e062c081bad9b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 11:31:08 +00:00
Marcus Shawcroft d70d0f93e2 sensor/sht3xd: Fix build_all sensor test.
Change-Id: Ic0f1dd745762d94bdb6ab9277a475d41fc148fd0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 11:31:07 +00:00
Marcus Shawcroft 81da76e39b tests: Add sensor HTS221 to driver/build-all test case.
Change-Id: Ifd5acf8bfaa75a44458b448001c0f2335fd6364d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-24 20:10:15 +00:00
Marcus Shawcroft f6403ecee0 tests: Add CONFIG_COUNTER to build_all driver tests.
Change-Id: I721832c86322acdb2b9d103586f9f783b9a63c77
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-24 20:10:14 +00:00
Marcus Shawcroft 9a60286f41 tests: Adjust drivers/build_all to build for more boards.
The build_all tests contain an ever growing list of device drivers to
build.  Ideally we minimize the number of images we build, but we
already observe that some of the tests, notably sensors, is too big
for some of our supported boards.

Rather disable an ever growing list of boards as the build_all tests
get bigger it would be better to split the tests into smaller chunks
that can reasonably be expected to run on any supported board.

We split the sensor test set into two, the division is arbitrary,
based on the name of the driver.  This allows us to remove the filter
on the quark_d2000.

The current split into two groups is arbirary, in the future it is
inevitable that as the list of supported drivers grows, we will need
to further subdivied the larger tests.

Change-Id: If7ee00b3c8e1749c4c827f83d7cbc2feb70e56ad
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-24 20:10:14 +00:00
Genaro Saucedo Tejada 9cb925dc70 filter: exclude sensor tests from assert build
When running sanity with asserts turned on the following tests don't
fit the ROM region of CONFIG_SOC_QUARK_D2000:
- test_build_sensor_triggers
- test_build_sensors
Added filters prevent these test from being executed when asserts are
on.

Jira: ZEP-1063

Change-Id: Ib046bcb227f4a49b524894aa5aea80debe159aae
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-10-18 23:39:30 +00:00
Maureen Helm 342e09c463 pinmux: Rename frdm_k64f pinmux driver to k64
The k64 pinmux driver can be used for any k64 board, not just frdm_k64f,
therefore renaming the driver accordingly.

Change-Id: I45e96d4a5ff6aa859d0f57fe098e44a8ae5283d1
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-10-18 21:42:31 +00:00
Genaro Saucedo Tejada af18a34a6a filter: Exclude failing drivers test at debug build
Some of tests/drivers/build_all/ test are failing link step only
when debug is enabled, these filters prevent those tests from being
executed under such configuration.

Jira: ZEP-1063

Change-Id: Ib2ff649794a1d73b133fbf998bbe8143a822c753
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-10-18 11:04:52 +00:00
Marcus Shawcroft f163e11034 tests: Add ethernet drivers to drivers/build_all
Extend the driver build_all tests to include a test for ethernet
drivers.

Change-Id: I2b01d547001d3fae45cda3bc95a74c35fd75ab2b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 16:44:07 +00:00
Anas Nashif 698ef0e3c0 test: build all possible drivers on all platforms
This also removes sensor and sensor2 tests, both are now included in this
single test.

Additionally, set footprint tag to show foorprint changes in gerrit.

Change-Id: I81a9357052adcc4fd910476e0ffc66bfdbdd3bce
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-10 21:26:33 +00:00
Marcus Shawcroft 0a83707410 tests: Add build test for quark clock driver.
Change-Id: I2863d5dc481aedf8015777dbd022f34a7f2c1070
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-08 11:40:14 +00:00
Marcus Shawcroft bf49fee348 tests: Add build test for enc28j60 SPI standalone ethernet driver.
Change-Id: Ieba53e625b2231ef9c492dbe6bfb8b01a5371226
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-08 11:40:12 +00:00
Marcus Shawcroft 9b131c7f2d tests: Build test for nsim uart.
Change-Id: Iacfee9cc21b4f4e58d525bde11cdf6feb5a79d30
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-08 11:40:10 +00:00
Marcus Shawcroft cfb5196f07 sensor/lsm9ds0_gyro: Fix failure to compile, undefined CONFIG_LSM9DS0_SENSOR_INIT_PRIORITY
Change-Id: Ibaeaa1a7df692c044310ba116285e1898d806d0e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:34:00 +00:00
Marcus Shawcroft dee749b213 sensor/lsm64s0: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: If977cc39bab3e838d1ff6d8de2cb4b667974ee17
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:33:59 +00:00
Marcus Shawcroft db35cc6838 sensor/bmi160: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: Ia4639d65ab4ee64a2ee0ba41677bab40894d65b4
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:33:55 +00:00