tools: Simplify the setting of action scenario vs config scenario
authorThibault Saunier <thibault.saunier@collabora.com>
Sat, 19 Oct 2013 16:41:01 +0000 (13:41 -0300)
committerThibault Saunier <thibault.saunier@collabora.com>
Mon, 25 Nov 2013 19:55:25 +0000 (16:55 -0300)
This make it easier for user to understand the difference between
the two concepts and avoids confusion.

Change-Id: Ib42913722c93a1e7e3c8b156173c458230946592

Conflicts:
validate/tools/gst-validate-transcoding.c
validate/tools/gst-validate.c

validate/gst/validate/gst-validate-scenario.c
validate/tools/gst-validate-transcoding.c
validate/tools/gst-validate.c

index 66122a3740aab011d0f024f6a1bcba7fe126f14b..5de0d14fe35428d855fb52ecbe985c3987f013c3 100644 (file)
@@ -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;
 
index 00be321a21617643f4ba0b73d704dec77ed3e025..7fb4e8899e1fd97f9e38d1b1be11affe32f4a165 100644 (file)
@@ -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 ();
index 57c020647fcd50b31c0f4a655713dc3046a4fbae..bcc7e7a50bced952a33b23a38d6e1449c2e97f92 100644 (file)
@@ -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);