projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move to kernel style SPDX license identifiers
[babeltrace.git]
/
tests
/
data
/
auto-source-discovery
/
params-log-level
/
bt_plugin_test.py
diff --git
a/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py
b/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py
index a1ac699454bef32ec8937e49a789e1a381e0c942..4464cc6b1c8afbf9e56bb2ad7d3df8075d73ce4c 100644
(file)
--- a/
tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py
+++ b/
tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py
@@
-1,3
+1,8
@@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2019 EfficiOS Inc.
+#
+
import bt2
import os
import bt2
import os
@@
-12,8
+17,9
@@
import os
class TestIter(bt2._UserMessageIterator):
class TestIter(bt2._UserMessageIterator):
- def __init__(self, output_port):
+ def __init__(self,
config,
output_port):
params = output_port.user_data['params']
params = output_port.user_data['params']
+ obj = output_port.user_data['obj']
comp_cls_name = self._component.__class__.__name__
comp_cls_name = self._component.__class__.__name__
@@
-23,6
+29,9
@@
class TestIter(bt2._UserMessageIterator):
elif params['what'] == 'log-level':
log_level = self._component.logging_level
stream_name = '{}: {}'.format(comp_cls_name, log_level)
elif params['what'] == 'log-level':
log_level = self._component.logging_level
stream_name = '{}: {}'.format(comp_cls_name, log_level)
+ elif params['what'] == 'python-obj':
+ assert type(obj) == str or obj is None
+ stream_name = '{}: {}'.format(comp_cls_name, obj)
else:
assert False
else:
assert False
@@
-44,17
+53,17
@@
class TestIter(bt2._UserMessageIterator):
class Base:
class Base:
- def __init__(self, params):
+ def __init__(self, params
, obj
):
tc = self._create_trace_class()
sc = tc.create_stream_class()
tc = self._create_trace_class()
sc = tc.create_stream_class()
- self._add_output_port('out', {'params': params, 'sc': sc})
+ self._add_output_port('out', {'params': params, '
obj': obj, '
sc': sc})
@bt2.plugin_component_class
class TestSourceA(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
@bt2.plugin_component_class
class TestSourceA(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
- def __init__(self, params, obj):
- super().__init__(params)
+ def __init__(self,
config,
params, obj):
+ super().__init__(params
, obj
)
@staticmethod
def _user_query(priv_query_exec, obj, params, method_obj):
@staticmethod
def _user_query(priv_query_exec, obj, params, method_obj):
@@
-76,8
+85,8
@@
class TestSourceA(Base, bt2._UserSourceComponent, message_iterator_class=TestIte
@bt2.plugin_component_class
class TestSourceB(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
@bt2.plugin_component_class
class TestSourceB(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
- def __init__(self, params, obj):
- super().__init__(params)
+ def __init__(self,
config,
params, obj):
+ super().__init__(params
, obj
)
@staticmethod
def _user_query(priv_query_exec, obj, params, method_obj):
@staticmethod
def _user_query(priv_query_exec, obj, params, method_obj):
This page took
0.024562 seconds
and
4
git commands to generate.