aboutsummaryrefslogtreecommitdiff
path: root/src/lib/delivery/delivery_populate.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2026-04-08 11:54:30 -0400
committerGitHub <noreply@github.com>2026-04-08 11:54:30 -0400
commit2e84ea9c18c3fc86737e58f12b03181fd68e6e5a (patch)
tree0152cc1ac5651dd5f357efb1de6116da7582e2c7 /src/lib/delivery/delivery_populate.c
parentbcc480ae7ad9266f80a2eee54d3a06bb8178868b (diff)
parent152d6482696e0de0e9ad3e37f5497efeadb58359 (diff)
downloadstasis-2e84ea9c18c3fc86737e58f12b03181fd68e6e5a.tar.gz
Merge pull request #129 from jhunkeler/dynamic-tests
Dynamic tests
Diffstat (limited to 'src/lib/delivery/delivery_populate.c')
-rw-r--r--src/lib/delivery/delivery_populate.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/delivery/delivery_populate.c b/src/lib/delivery/delivery_populate.c
index 4ea93c1..d41e3a4 100644
--- a/src/lib/delivery/delivery_populate.c
+++ b/src/lib/delivery/delivery_populate.c
@@ -193,6 +193,7 @@ static void normalize_ini_list(struct INIFILE **inip, struct StrList **listp, ch
(*inip) = ini;
(*listp) = list;
}
+
int populate_delivery_ini(struct Delivery *ctx, int render_mode) {
struct INIFILE *ini = ctx->_stasis_ini_fp.delivery;
struct INIData *rtdata;
@@ -277,11 +278,17 @@ int populate_delivery_ini(struct Delivery *ctx, int render_mode) {
ctx->conda.pip_packages_defer = strlist_init();
}
- for (size_t z = 0, i = 0; i < ini->section_count; i++) {
+ ctx->tests = tests_init(TEST_NUM_ALLOC_INITIAL);
+ for (size_t i = 0; i < ini->section_count; i++) {
char *section_name = ini->section[i]->key;
if (startswith(section_name, "test:")) {
union INIVal val;
- struct Test *test = &ctx->tests[z];
+ struct Test *test = test_init();
+ if (!test) {
+ SYSERROR("%s", "unable to allocate memory for test structure");
+ return -1;
+ }
+
val.as_char_p = strchr(ini->section[i]->key, ':') + 1;
if (val.as_char_p && isempty(val.as_char_p)) {
return 1;
@@ -299,7 +306,8 @@ int populate_delivery_ini(struct Delivery *ctx, int render_mode) {
}
test->repository_remove_tags = ini_getval_strlist(ini, section_name, "repository_remove_tags", LINE_SEP, render_mode, &err);
test->build_recipe = ini_getval_str(ini, section_name, "build_recipe", render_mode, &err);
- test->runtime.environ = ini_getval_strlist(ini, section_name, "runtime", LINE_SEP, render_mode, &err);
+
+ test->runtime->environ = ini_getval_strlist(ini, section_name, "runtime", LINE_SEP, render_mode, &err);
const char *timeout_str = ini_getval_str(ini, section_name, "timeout", render_mode, &err);
if (timeout_str) {
test->timeout = str_to_timeout((char *) timeout_str);
@@ -312,7 +320,7 @@ int populate_delivery_ini(struct Delivery *ctx, int render_mode) {
return 1;
}
}
- z++;
+ tests_add(ctx->tests, test);
}
}