diff options
Diffstat (limited to 'source/session.d')
-rw-r--r-- | source/session.d | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/session.d b/source/session.d index ef2a9e7..277353f 100644 --- a/source/session.d +++ b/source/session.d @@ -9,6 +9,13 @@ import util; import dyaml; +struct TestExtended_t { + string name; + string[string] runtime; + string test_args; + string[] commands; +} + struct Session_t { string delivery_name; string delivery_version; @@ -28,6 +35,7 @@ struct Session_t { bool run_tests = false; string test_program = "pytest"; string test_args = "-v"; + TestExtended_t[] test_extended; string[] test_conda_requirements; string[] test_pip_requirements; string[] test_filter_git_orgs; @@ -144,5 +152,28 @@ Session_t getconf(string filename) { foreach (Node v; data) session.test_filter_git_projects ~= v.as!string; } + + if (root.containsKey("test_extended")) { + TestExtended_t te; + data = root["test_extended"]; + + foreach (Node parent_1, Node child_1; data) { + te.name = parent_1.as!string; + if (child_1.containsKey("runtime")) { + foreach (Node parent_2, Node child_2; child_1["runtime"]) { + te.runtime[parent_2.as!string] = child_2.as!string; + } + } + if (child_1.containsKey("commands")) { + foreach (Node v; child_1["commands"]) { + te.commands ~= v.as!string.strip; + } + } + if (child_1.containsKey("test_args")) { + te.test_args = child_1["test_args"].as!string; + } + session.test_extended ~= te; + } + } return session; } |