diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index 66122a3740..5de0d14fe3 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -922,10 +922,10 @@ invalid_name: } one_actions_scenario_max: { - GST_ERROR ("You can not set several actions scenario (you can " - "have set various confi scenario though, meaning you have to set" - " 'scenario, is-config=true' in the scenario file, and all actions" - " should be executable at parsing time)"); + GST_ERROR ("You can set at most only one action scenario. " + "You can have several config scenarios though (a config scenario's " + "file must have is-config=true, and all its actions must be executable " + "at parsing time)."); ret = FALSE; goto done; diff --git a/validate/tools/gst-validate-transcoding.c b/validate/tools/gst-validate-transcoding.c index 00be321a21..7fb4e8899e 100644 --- a/validate/tools/gst-validate-transcoding.c +++ b/validate/tools/gst-validate-transcoding.c @@ -708,7 +708,7 @@ main (int argc, gchar ** argv) #endif GError *err = NULL; - const gchar *scenario = NULL; + const gchar *scenario = NULL, *configs = NULL; gboolean want_help = FALSE; gboolean list_scenarios = FALSE; @@ -725,6 +725,11 @@ main (int argc, gchar ** argv) {"set-scenario", '\0', 0, G_OPTION_ARG_STRING, &scenario, "Let you set a scenario, it will override the GST_VALIDATE_SCENARIO " "environment variable", NULL}, + {"set-configs", '\0', 0, G_OPTION_ARG_STRING, &configs, + "Let you set a config scenario, the scenario needs to be set as 'config" + "' you can specify a list of scenario separated by ':'" + " it will override the GST_VALIDATE_SCENARIO environment variable,", + NULL}, {"eos-on-shutdown", 'e', 0, G_OPTION_ARG_NONE, &eos_on_shutdown, "If an EOS event should be sent to the pipeline if an interrupt is " "received, instead of forcing the pipeline to stop. Sending an EOS " @@ -765,8 +770,17 @@ main (int argc, gchar ** argv) g_option_context_free (ctx); - if (scenario) - g_setenv ("GST_VALIDATE_SCENARIO", scenario, TRUE); + if (scenario || configs) { + gchar *scenarios; + + if (scenario) + scenarios = g_strjoin (":", scenario, configs, NULL); + else + scenarios = g_strdup (configs); + + g_setenv ("GST_VALIDATE_SCENARIO", scenarios, TRUE); + g_free (scenarios); + } if (list_scenarios) gst_validate_list_scenarios (); diff --git a/validate/tools/gst-validate.c b/validate/tools/gst-validate.c index 57c020647f..bcc7e7a50b 100644 --- a/validate/tools/gst-validate.c +++ b/validate/tools/gst-validate.c @@ -99,7 +99,7 @@ int main (int argc, gchar ** argv) { GError *err = NULL; - const gchar *scenario = NULL; + const gchar *scenario = NULL, *configs = NULL; gboolean list_scenarios = FALSE; #ifdef G_OS_UNIX guint signal_watch_id; @@ -112,6 +112,11 @@ main (int argc, gchar ** argv) "environment variable", NULL}, {"list-scenarios", 'l', 0, G_OPTION_ARG_NONE, &list_scenarios, "List the avalaible scenarios that can be run", NULL}, + {"set-configs", '\0', 0, G_OPTION_ARG_STRING, &configs, + "Let you set a config scenario, the scenario needs to be set as 'config" + "' you can specify a list of scenario separated by ':'" + " it will override the GST_VALIDATE_SCENARIO environment variable,", + NULL}, {NULL} }; GOptionContext *ctx; @@ -140,8 +145,16 @@ main (int argc, gchar ** argv) exit (1); } - if (scenario) { - g_setenv ("GST_VALIDATE_SCENARIO", scenario, TRUE); + if (scenario || configs) { + gchar *scenarios; + + if (scenario) + scenarios = g_strjoin (":", scenario, configs, NULL); + else + scenarios = g_strdup (configs); + + g_setenv ("GST_VALIDATE_SCENARIO", scenarios, TRUE); + g_free (scenarios); } gst_init (&argc, &argv);