summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/config.py3
-rw-r--r--framework/database.py6
-rwxr-xr-xprograms/run.py10
3 files changed, 11 insertions, 8 deletions
diff --git a/framework/config.py b/framework/config.py
index f0bd1a4..f9125b8 100644
--- a/framework/config.py
+++ b/framework/config.py
@@ -34,7 +34,8 @@ def load():
# Set default values
config.read_dict({'options': {
'platform': 'glx',
- 'threads': 5
+ 'threads': 5,
+ 'database': path.join(xdg.save_data_path('robyn'), 'results.db')
}})
# Read the robynrc file
diff --git a/framework/database.py b/framework/database.py
index fb7b1e3..9ab2983 100644
--- a/framework/database.py
+++ b/framework/database.py
@@ -27,14 +27,12 @@ import xdg.BaseDirectory as xdg
__all__ = ['load']
-databaseFile = path.join(xdg.save_data_path('robyn'), 'results.db')
-
-def load():
+def load(config):
'''Load the results database, creating it if it doesn't exist.
Will exit the program if it fails.'''
try:
- connection = apsw.Connection(databaseFile)
+ connection = apsw.Connection(config['options']['database'])
cursor = connection.cursor()
cursor.execute('''CREATE TABLE IF NOT EXISTS runs
diff --git a/programs/run.py b/programs/run.py
index 59d6aef..4d542f7 100755
--- a/programs/run.py
+++ b/programs/run.py
@@ -54,7 +54,7 @@ def parseArguments(argv, config):
p.add_argument('--valgrind', action='store_true',
help="Run tests in Valgrind's memcheck tool.",
default=False)
- p.add_argument('-r', '--results', action='store',
+ 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))')
p.add_argument('suites', nargs='+')
@@ -62,18 +62,22 @@ def parseArguments(argv, config):
options = p.parse_args(argv)
# Override config file settings with the command line options.
- rc_options = ['threads', 'results']
+ 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):
options = parseArguments(argv, config)
- framework.database.load()
+ framework.database.load(config)
tests = suites.loadTestLists(config, options.suites)
for test in sorted(tests['oglconform'].keys()):
print(test)
+ # Create test run in database
+ # Populate results with "not run yet"
+ # Resume
+
if __name__ == '__main__':
main(sys.argv[1:])