diff options
author | linux_geek <taseer94@gmail.com> | 2016-11-11 21:57:09 +0500 |
---|---|---|
committer | linux_geek <taseer94@gmail.com> | 2016-11-13 15:23:05 +0500 |
commit | f382579700d646978ce69f28f53948aa48003ce8 (patch) | |
tree | 436ffdd332fe61f9d06a88c92c8fcaf66db0a569 /qtip/cli/commands/cmd_suite.py | |
parent | 42cbcd2e3e67cc2893ba765b89441951d104922a (diff) |
Rename command files.
Change-Id: I5bae535e9c6c81903b91e08396a020f9a0b3132b
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
Diffstat (limited to 'qtip/cli/commands/cmd_suite.py')
-rw-r--r-- | qtip/cli/commands/cmd_suite.py | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/qtip/cli/commands/cmd_suite.py b/qtip/cli/commands/cmd_suite.py new file mode 100644 index 00000000..757f11a1 --- /dev/null +++ b/qtip/cli/commands/cmd_suite.py @@ -0,0 +1,52 @@ +############################################################################## +# Copyright (c) 2016 ZTE Corp and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +from prettytable import PrettyTable +import os +import click + + +class Suite: + + def __init__(self): + self.path = os.path.join(os.path.dirname(__file__), '..', '..', 'benchmarks/suite') + + def list(self): + table = PrettyTable(["Name"]) + table.align = 'l' + suites = os.listdir(self.path) + for suite in suites: + table.add_row([suite]) + click.echo(table) + + def run(self): + print("Run a suite") + + +@click.group() +def cli(): + pass + + +@cli.group() +@click.pass_context +def suite(ctx): + pass + +_suite = Suite() + + +@suite.command("list", help="Lists all the available suites") +def list(): + _suite.list() + + +@suite.command("run", help="Execute one complete suite") +def execute(): + _suite.run() |