validate: Only consider the first pipeline when using test files
authorThibault Saunier <tsaunier@igalia.com>
Tue, 15 Dec 2020 21:18:29 +0000 (18:18 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Thu, 17 Dec 2020 01:00:37 +0000 (22:00 -0300)
And port the deeply nested tests we have

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/233>

validate/gst/validate/validate.c

index 1c26274..875fbcb 100644 (file)
@@ -60,6 +60,7 @@ static GList *all_configs = NULL;
 static gboolean got_configs = FALSE;
 
 static GList *core_config = NULL;
+static gboolean testfile_used = FALSE;
 static GList *testfile_structs = NULL;
 static gchar *global_testfile = NULL;
 static gboolean validate_initialized = FALSE;
@@ -513,7 +514,7 @@ gst_validate_get_test_file_scenario (GList ** structs,
   GList *res = NULL, *tmp;
   GstStructure *meta = get_test_file_meta ();
 
-  if (!testfile_structs)
+  if (!testfile_structs || testfile_used)
     return FALSE;
 
   if (meta && gst_structure_has_field (meta, "scenario")) {
@@ -537,10 +538,12 @@ gst_validate_get_test_file_scenario (GList ** structs,
 
   *structs = res;
   *original_name = global_testfile;
+  testfile_used = TRUE;
 
   return TRUE;
 }
 
+/* Only the first monitor pipeline will be used */
 GstStructure *
 gst_validate_setup_test_file (const gchar * testfile, gboolean use_fakesinks)
 {