aboutsummaryrefslogtreecommitdiffstats
path: root/classes/zephyrtest.bbclass
blob: aa9ee3cb5d65dd6effc01ec18a0f76515b4977d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
python zephyrtest_virtclass_handler () {
    variant = e.data.getVar("BBEXTENDVARIANT", True)

    # ipk doesn't like underscores in pacakges names. So just use dashes
    # for PN and the image name.
    variant_dashes = variant.replace('_', '-')

    pn = e.data.getVar("PN", True) + "-" + variant_dashes
    pn_underscores = e.data.getVar("PN", True) + "-" + variant

    e.data.setVar("PN", pn)
    e.data.setVar("ZEPHYR_IMAGENAME", pn + ".elf")

    testsrc = e.data.getVar("ZEPHYR_TEST_SRCDIR", True)
    e.data.setVar("ZEPHYR_IMAGE_SRCDIR", testsrc + variant)

    # Allow to build using both foo-some_test form as well as foo-some-test
    e.data.setVar("PROVIDES", e.data.getVar("PROVIDES", True) + pn_underscores)
}

addhandler zephyrtest_virtclass_handler
zephyrtest_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"