Skip to content

Commit

Permalink
[RFC] sanitycheck: support testcases in yaml instead of ini
Browse files Browse the repository at this point in the history
This commit changes the syntax of the testcase files and changes the
behaviour and configuration of the sanitycheck script.

To avoid having multiple files with different syntax for boards,
samples, tests; this change unifies the syntax and uses YAML instead of
INI.

We maintain the current keywords used in the old syntax and maintain the
flexibility of adding tests with different configuration by using YAML
list configuration. On top of that, the following features are added:

- We now scan for board configurations in the boards directory and look
for a YAML file describing a board and how it should be tested. This
eliminates the need for listing boards per architecture in a special ini
file under scripts/.

- We define hardware information charachterstics in the board YAML file
that helps identifying if a certain test should run on that board or
not. For example, we can specify the available RAM in the board and
filter tests that would require more RAM than the board can handle.

- Boards can be set as default for testing meaning that we always run a
test case (build and run of possible) when sanitycheck is called without
any arguments. Previously this was done only by selecting the first
board defined for a specific architecture.

- Tests can be configured to run on all possible boards, this is to make
sure we always build some basic tests for all boards to catch issues
with the core kernel features.

...

Change-Id: Ie83010f5269a6e6ffa497ab11e6b874e97188c96
Signed-off-by: Anas Nashif <[email protected]>
  • Loading branch information
nashif committed Apr 28, 2017
1 parent 213dfdb commit 45dd497
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 185 deletions.
37 changes: 37 additions & 0 deletions scripts/ini2yaml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python

import ConfigParser, os
import yaml
import sys


sample = False
in_file = sys.argv[1]
if sys.argv[2] == 'sample':
sample = True

out_file = os.path.join(os.path.dirname(in_file), sys.argv[2] + ".yaml")

config = ConfigParser.ConfigParser()
config.readfp(open(sys.argv[1]))
y = {'tests': 'tests'}

tests = []
for section in config.sections():
tc = {}
for opt in config.options(section):
value = config.get(section, opt)
if value in ['false', 'true']:
tc[opt] = True if value == 'true' else False
else:
tc[opt] = value

test = { section : tc}
tests.append(test)

y['tests'] = tests
if sample:
y['sample'] = { 'name': "TBD", 'description': "TBD" }

with open(out_file, "w") as f:
yaml.dump(y, f, width=50, indent=4, default_flow_style=False)
4 changes: 0 additions & 4 deletions scripts/sanity_chk/arches/arc.ini

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/sanity_chk/arches/arm.ini

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/sanity_chk/arches/nios2.ini

This file was deleted.

8 changes: 0 additions & 8 deletions scripts/sanity_chk/arches/riscv32.ini

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/sanity_chk/arches/unit.ini

This file was deleted.

20 changes: 0 additions & 20 deletions scripts/sanity_chk/arches/x86.ini

This file was deleted.

24 changes: 0 additions & 24 deletions scripts/sanity_chk/arches/xtensa.ini

This file was deleted.

Loading

0 comments on commit 45dd497

Please sign in to comment.