summaryrefslogtreecommitdiff
path: root/programs/listRuns.py
diff options
context:
space:
mode:
Diffstat (limited to 'programs/listRuns.py')
-rwxr-xr-xprograms/listRuns.py76
1 files changed, 76 insertions, 0 deletions
diff --git a/programs/listRuns.py b/programs/listRuns.py
new file mode 100755
index 0000000..8ea3f8a
--- /dev/null
+++ b/programs/listRuns.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python3
+#
+# Copyright © 2012 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+__all__ = ['main']
+
+from argparse import ArgumentParser
+import os
+import os.path as path
+import re
+import time
+import sys
+
+from framework.database import ResultDatabase
+import suites
+
+def parseArguments(argv, config):
+ p = ArgumentParser(prog='robyn run', description='A GPU test runner')
+ p.add_argument('-t', '--tests', action='append', dest='includeFilters',
+ metavar='<regexp>',
+ help='Include only runs matching this regular expression')
+ p.add_argument('-x', '--exclude', action='append', dest='excludeFilters',
+ default=[],
+ metavar='<regexp>',
+ help='Exclude runs matching this regular expression')
+ p.add_argument('-r', '--results', action='store', dest='database',
+ metavar='<results database>',
+ help='Specify an alternate result database (defaults to ~/.local/share/robyn/results.db))')
+
+ options = p.parse_args(argv)
+
+ # Override config file settings with the command line options.
+ rc_options = ['threads', 'database']
+ config.read_dict({'options': dict((k, v) for k, v in vars(options).items() if k in rc_options and v is not None)})
+
+ return options
+
+def main(argv, config):
+ args = parseArguments(argv, config)
+
+ # Compile filter regular expressions
+ includeFilters = None
+ if args.includeFilters:
+ includeFilters = [re.compile(x) for x in args.includeFilters]
+ excludeFilters = [re.compile(x) for x in args.excludeFilters]
+
+ # Connect to the database
+ db = ResultDatabase(config)
+
+ #runs = filterTests(db.listRuns(), includeFilters, excludeFilters)
+ runs = db.listRuns()
+
+ for run in runs:
+ print(run['name'], time.asctime(time.gmtime(run['date'])))
+
+if __name__ == '__main__':
+ main(sys.argv[1:])