add --priority option for minimum test priority
diff --git a/oft b/oft
index 58b8912..999ce4a 100755
--- a/oft
+++ b/oft
@@ -173,6 +173,7 @@
"test_dir" : os.path.join(root_dir, "tests"),
"platform_dir" : os.path.join(root_dir, "platforms"),
"profile_dir" : os.path.join(root_dir, "profiles"),
+ "priority" : 0,
}
# Default test priority
@@ -277,6 +278,9 @@
help="Directory containing platform modules")
parser.add_option("--profile-dir", type="string",
help="Directory containing profile modules")
+ parser.add_option("--priority", type="int",
+ help="Minimum test priority",
+ default=0)
# Might need this if other parsers want command line
# parser.allow_interspersed_args = False
@@ -466,7 +470,7 @@
desc = desc.split('\n')[0]
except:
desc = "No description"
- if test_prio_get(test) < 0:
+ if test_prio_get(test) < config["priority"]:
start_str = " * " + testname + ":"
else:
start_str = " " + testname + ":"
@@ -488,7 +492,7 @@
if config["list_test_names"]:
for (modname, (mod, tests)) in test_modules.items():
for (testname, test) in tests.items():
- if test_prio_get(test) >= 0:
+ if test_prio_get(test) >= config["priority"]:
print "%s.%s" % (modname, testname)
sys.exit(0)
@@ -498,7 +502,7 @@
for (modname, (mod, tests)) in test_modules.items():
for (testname, test) in tests.items():
- if test_prio_get(test) >= 0:
+ if test_prio_get(test) >= config["priority"]:
logging.info("Adding test " + modname + "." + testname)
suite.addTest(test())