aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKapileshwar Singh <kapileshwarsingh@gmail.com>2015-10-27 14:40:33 +0800
committerKapileshwar Singh <kapileshwar.singh@arm.com>2015-11-11 16:36:21 +0000
commitc9211760aa45c463a384c8f90c206d091dfa7d9f (patch)
treee2c216f51cf76a82c078547f6e5ffdc33d44582a
parent2b2cc6dfef79caa242416d1037811235020d0570 (diff)
downloadbart-c9211760aa45c463a384c8f90c206d091dfa7d9f.tar.gz
sched: SchedMultiAssert: Add missing pids argument
The class should accept either pids or execnames as specified in the API reference. This fixes issue #23. Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
-rwxr-xr-xbart/sched/SchedMultiAssert.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/bart/sched/SchedMultiAssert.py b/bart/sched/SchedMultiAssert.py
index e949d2c..2792079 100755
--- a/bart/sched/SchedMultiAssert.py
+++ b/bart/sched/SchedMultiAssert.py
@@ -136,12 +136,21 @@ class SchedMultiAssert(object):
functionality
"""
- def __init__(self, run, topology, execnames):
+ def __init__(self, run, topology, execnames=None, pids=None):
- self._execnames = listify(execnames)
self._run = Utils.init_run(run)
- self._pids = self._populate_pids()
self._topology = topology
+
+ if execnames and pids:
+ raise ValueError('Either pids or execnames must be specified')
+ if execnames:
+ self._execnames = listify(execnames)
+ self._pids = self._populate_pids()
+ elif pids:
+ self._pids = pids
+ else:
+ raise ValueError('One of PIDs or execnames must be specified')
+
self._asserts = self._populate_asserts()
self._populate_methods()