summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics
diff options
context:
space:
mode:
authorPaul Barker <pbarker@konsulko.com>2019-11-10 00:39:42 +0000
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2019-12-03 15:09:19 +0000
commit2fa5dae62868c63781568eeb5435ed3296c2ddc2 (patch)
treea18cfd9ea20e61b3093b4d1ca6d9ad850dab96eb /meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics
parent11a613bab398e60d8a9da1eb0d6c4c754fd8bfef (diff)
Extend intel-corei7-64 machine to support virtual targets
These changes allow images built for the intel-corei7-64 machine to be booted under qemu (by using the normal `runqemu` command) and vmware or virtualbox after a build. Functionality on real hardware should not be compromised. Bug-AGL: SPEC-2931 Change-Id: If25782bf59e145cab32a4c9a0e39b599106ce7cc Signed-off-by: Paul Barker <pbarker@konsulko.com>
Diffstat (limited to 'meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics')
-rw-r--r--meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/mesa/mesa_%.bbappend1
-rw-r--r--meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf.bbappend3
2 files changed, 4 insertions, 0 deletions
diff --git a/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/mesa/mesa_%.bbappend b/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/mesa/mesa_%.bbappend
index 49e527707..8ac343aa3 100644
--- a/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/mesa/mesa_%.bbappend
+++ b/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/mesa/mesa_%.bbappend
@@ -2,5 +2,6 @@
GALLIUM_LLVM = "gallium-llvm"
PACKAGECONFIG_append_qemux86 = " gallium ${GALLIUM_LLVM}"
PACKAGECONFIG_append_qemux86-64 = " gallium ${GALLIUM_LLVM}"
+PACKAGECONFIG_append_intel-corei7-64 = " gallium ${GALLIUM_LLVM}"
DRIDRIVERS_append_intel-corei7-64 = ",i965"
diff --git a/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf.bbappend
index 8fa08bc3b..916bd6f3d 100644
--- a/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf.bbappend
+++ b/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -7,3 +7,6 @@ OVERRIDES_prepend_qemux86-64 = "virtualmachine:"
# Switch to the Virtual section that we have when a valid DRM device is found
SRC_URI_remove_virtualmachine = "file://hdmi-a-1-270.cfg"
SRC_URI_append_virtualmachine = " file://virtual.cfg"
+
+# For intel-corei7-64 we want to support both the HDMI-A-1 and Virtual-1 outputs
+SRC_URI_append_intel-corei7-64 = " file://virtual.cfg"
f2 } /* Name.Entity */ .highlight .ne { color: #a6e22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .nt { color: #f92672 } /* Name.Tag */ .highlight .nv { color: #f8f8f2 } /* Name.Variable */ .highlight .ow { color: #f92672 } /* Operator.Word */ .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */ .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Write the tests

## Create the test tree

At the root of your project, create a test-dedicated directory that holds
all your test materials. A classic test tree looks like the following:

```tree
 test
 ├── CMakeLists.txt
 └── afb-test
     ├── CMakeLists.txt
     ├── etc
     │   ├── CMakeLists.txt
     │   └── aft-agl-middlename.json
     ├── fixtures
     │   ├── CMakeLists.txt
     │   ├── helper.sh
     │   ├── data
     │   └── plugin.lua
     └── tests
         ├── CMakeLists.txt
         ├── test01.lua
         ├── test02.lua
         └── test03.lua
 ...
```

Here is a description of each subdirectory purpose:

- *etc*`: Holds the test binding configuration in a JSON file.
- *fixtures*: contains all external needed files to run your tests.
  This subdirectory is primarily used to inject data or a plugin
  with the mock-up APIs code in a LUA or C plugin.
- *tests*: Contains only the tests written in LUA for your binding.

## Create your configuration file

The configuration file describes your test API and how it launches the tests.
A test binding does not provide verbs.
This configuration describes the API verb(s) and mocked-up APIs.
Following are the `key` descriptions for the configuration file:

### `metadata` section

- `uid`: A simple label useful for debugging.
- `version` (optional): The test's version.
- `info` (optional): Provides information about the test.
- `api`: The name your test binding takes.
  Formerly, the name was the test API name prefixed with `aft`
  (i.e. `aft-<tested-api-name>`).
- `require`: The tested API's name. This key ensure that the tested API is
  correctly launched and initialized so the test binding can test it.

### `testVerb` section

- `uid`: The verb name.
- `info` (optional): Provides information about the verb.
- `action`: A special string indicating the function to trigger when the verb is
  called. The verb is always the same about the test binding.
- `args` Contains the following:
  - `trace`: The name of the tested API you are testing. `trace` is
   needed to allow the test binding trace the tested API and retrieve through
   the binder's monitoring feature `calls` and `events`.
  - `files`: A string or an array of strings of the LUA files with your tests.
   Only provide the file name.  Do not provide the path.

### `mapis` (mocked up API), section

- `uid`: The mocked up API's name
- `info` (optional): Provides information on the mock-up API.
- `libs`: The LUA script or C plugin file name.

#### `verbs` section

Describes the implemented mocked up API verbs. Each verb maps to a function
name that is executed when the verb is called.

- `uid`: The verb's name.
- `info` (optional): Provides information on the verb.
- `action`: A URI string that points to a C plugin or LUA script's function that
  is executes when the verb is called. The format of the action URI is:
 `<lua|plugin|api>`://`<C plugin's name|api's name|lua script name>`#`<function|verb's name>`

#### `events` section.

Allows you to trigger a function when a described event is received.
The trigger can be for any event on which you need to apply modifications.
You do not have to enumerate each possible event that the mocked up API can
generate.  You could avoid this section if you do not want to execute a function
when an event is received.

- `uid`: The event's name (e.g. `<api>/<event-name>`)
- `info` (optional): Provides information about the event.
- `action`: A URI string that points to a C plugin or LUA script's function that
  is executed when an event is received. The format of the action URI is:
  `<lua|plugin|api>`://`<C plugin's name|api's name|lua script name>`#`<function|verb's name>`.
  The action `lua://AFT#_evt_catcher_` is the default `afb-test` events listener.

### Configuration examples

Here is a simple example:

```json
{
    "id": "http://iot.bzh/download/public/schema/json/ctl-schema.json#",
    "$schema": "http://iot.bzh/download/public/schema/json/ctl-schema.json#",
    "metadata": {
        "uid": "Hello_Test",
        "version": "1.0",
        "api": "aft-example",
        "info": "Binding made to test other bindings",
        "require": [
            "hello"
        ]
    },
    "testVerb": {
        "uid": "testing-hello",
        "info": "Launch the tests against hello api",
        "action": "lua://AFT#_launch_test",
        "args": {
            "trace": "hello",
            "files": ["aftTest.lua","helloworld.lua"]
        }
    }
}
```

Following is another example that uses a mocked up `low-can` API:

```json
{
    "id": "http://iot.bzh/download/public/schema/json/ctl-schema.json#",
    "$schema": "http://iot.bzh/download/public/schema/json/ctl-schema.json#",
    "metadata": {
        "uid": "Other_Tests",
        "version": "1.0",
        "api": "aft-example",
        "info": "Binding made to test other bindings",
        "require": [
            "tested-api"
        ]
    },
    "testVerb": {
        "uid": "Complete",
        "info": "Launch all the tests",
        "action": "lua://AFT#_launch_test",
        "args": {
            "trace": "low-can",
            "files": [ "aftTest.lua", "mapis-tests.lua" ]
        }
    },
    "mapis": [{
        "uid": "low-can",
        "info": "Faked low-can API",
        "libs": "mapi_low-can.lua",
        "verbs": [
            {
                "uid": "subscribe",
                "info": "Subscribe to CAN signals events",
                "action": "lua://low-can#_subscribe"
            },
            {...},
            {
                "uid": "write",
                "info": "Write a CAN messages to the CAN bus.",
                "action": "lua://low-can#_write"
            }
        ],
        "events": [{
            "uid": "low-can/diagnostic_messages",
            "action": "lua://AFT#_evt_catcher_"
        },{
            "uid": "low-can/messages_engine_speed",
            "action": "lua://AFT#_evt_catcher_"
        },{
            "uid": "low-can/messages_vehicle_speed",
            "action": "lua://AFT#_evt_catcher_"
        }]
    }]
}
```

## The LUA test files

The test framework uses the LUA language to describe the tests.

You must be aware of two things when you write tests using
this framework: *test* and *assertions* functions.

- *Assertions* functions test an atomic operation result.
  (ie: `1+1 = 2`).
- *Test* functions represent a test. These functions represent a set of one
  or more *assertions* that must all succeed in order to valid the test.

The framework comes with several *test* and *assertion* functions that
allow verb calls and received events to be tested. Use these provided
*test* functions as a start.  If you
need more functions, use the ones that call a callback. If the test is more complex or
more comprehensive then *describe* your test function using *assert* functions.
Following is an example.

See the test framework functions [References](Reference/0_BindingTestFunctions.html) for a
comprehensive list of available *tests* and *assertions* functions.

### Tests example

```lua
    function _callback(responseJ)
    _AFT.assertStrContains(responseJ.response, "Some String")
    end

    function _callbackError(responseJ)
    _AFT.assertStrContains(responseJ.request.info, "Ping Binder Daemon fails")
    end

    function _callbackEvent(eventName, eventData)
    _AFT.assertEquals(eventData, {data = { key = 'weird others data', another_key = 123.456 }})
    end

    _AFT.addEventToMonitor("hello/anEvent")
    _AFT.addEventToMonitor("hello/anotherEvent", _callbackEvent)

    _AFT.testVerbStatusSuccess('testPingSuccess','hello', 'ping', {})
    _AFT.testVerbResponseEquals('testPingSuccess','hello', 'ping', {}, "Some String")
    _AFT.testVerbResponseEquals('testPingSuccess','hello', 'ping', {}, "Unexpected String")
    _AFT.testVerbCb('testPingSuccess','hello', 'ping', {}, _callback)
    _AFT.testVerbStatusError('testPingError', 'hello', 'pingfail', {})
    _AFT.testVerbResponseEqualsError('testPingError', 'hello', 'pingfail', {}, "Ping Binder Daemon fails")
    _AFT.testVerbResponseEqualsError('testPingError', 'hello', 'pingfail', {}, "Ping Binder Daemon succeed")
    _AFT.testVerbCbError('testPingError', 'hello', 'pingfail', {}, _callbackError)

    _AFT.testVerbStatusSuccess('testEventAdd', 'hello', 'eventadd', {tag = 'event', name = 'anEvent'})
    _AFT.testVerbStatusSuccess('testEventSub', 'hello', 'eventsub', {tag = 'event'})
    _AFT.testVerbStatusSuccess('testEventPush', 'hello', 'eventpush', {tag = 'event', data = { key = 'some data', another_key = 123}})

    _AFT.testVerbStatusSuccess('testEventAdd', 'hello', 'eventadd', {tag = 'evt', name = 'anotherEvent'})
    _AFT.testVerbStatusSuccess('testEventSub', 'hello', 'eventsub', {tag = 'evt'})
    _AFT.testVerbStatusSuccess('testEventPush', 'hello', 'eventpush', {tag = 'evt', data = { key = 'weird others data', another_key = 123.456}})

    _AFT.testVerbStatusSuccess('testGenerateWarning', 'hello', 'verbose', {level = 4, message = 'My Warning message!'})

    _AFT.testEvtGrpReceived("TestEventGroupReceived",{"hello/anEvent","hello/anotherEvent"},300000)
    _AFT.testEvtGrpNotReceived("TestEventGroupNotReceived",{"hello/anEvent","hello/anotherEvent"},300000)

    _AFT.testEvtReceived("testEvent", "hello/anEvent",300000)
    _AFT.testEvtReceived("testEventCb", "hello/anotherEvent",300000)

    _AFT.describe("myTestLabel", function()
      _AFT.assertEquals(false, false)
    end)
```