Commit Graph

5 Commits

Author SHA1 Message Date
Jair Gonzalez
e95ce3fe3b bitbake: tests/event: tests: Add event classes test class
This change adds EventClassesTest class to bb/tests/event.py,
including 47 new test cases for the public interfaces of the
bitbake event and related helper classes.

[YOCTO #10773]

(Bitbake rev: ee5fe4431713b8a29bdb424a29460965374b3234)

Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-07 12:14:34 +00:00
Jair Gonzalez
35226b3307 bitbake: tests/event: Remove empty assignments from event tests
Remove assignments from non-returning calls.

(Bitbake rev: a8cac827dd15227a3940ea25c673d91b5e2c2a75)

Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-07 12:14:34 +00:00
Jair Gonzalez
fda60b31ec bitbake: tests/event: Add test for bb.event.worker_fire
Test the triggering of bb.event.worker_fire callback.

(Bitbake rev: daa59a2057c811b20d75235526ac6c2079ac6e10)

Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-07 12:14:34 +00:00
Jair Gonzalez
61f409baff bitbake: tests/event: Include tests for event filtering features
This change includes unit tests for the following functions,
helper class and methods in bitbake.event:

- set_eventfilter(func)
- set_UIHmask(handlerNum, level, debug_domains, mask)
- getName(e)
- class UIEventFilter(object)
    def __init__(self, level, debug_domains)
    def update(self, eventmask, level, debug_domains)
    def filter(self, event)

[YOCTO #10773]

(Bitbake rev: 4a19dde704fd0bf262ea991ef530f991a4897d31)

Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-07 12:14:34 +00:00
Jair Gonzalez
df051ba9a2 bitbake: tests: create unit tests for event module
This change adds a new unit test module (bb.tests.event)
for bitbake event.
It includes the following items:

- Client and server stubs setup
- Testing the module's main functions including:
	- get_class_handlers
	- set_class_handlers
	- clean_class_handlers
	- enable_threadlock
	- disable_threadlock
	- get_handlers
	- set_handlers
	- execute_handler
	- fire_class_handlers
	- print_ui_queue
	- fire_ui_handlers
	- fire
	- fire_from_worker
	- register
	- remove
	- register_UIHhandler
	- unregister_UIHhandler
- Testing event handling using:
	- class Event(object)
	- class OperationStarted(Event)
	- class OperationCompleted(Event)
	- class OperationProgress(Event)
	- class ConfigParsed(Event)

[YOCTO #10368]

(Bitbake rev: 0be3ad391adc73cc0dff81bd0ed7874f2c6a00be)

Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-23 14:14:17 +01:00