summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2019-05-21 17:38:47 -0400
committerMichael S. Tsirkin <mst@redhat.com>2019-05-29 18:00:58 -0400
commitab50f22309a17c772c51931940596e707c200739 (patch)
treeb4c78f325da4ee7e0cc9f721c4ab08522710f0e0
parent386cff49ebd1748b0319c88e5282236f9e56b81b (diff)
downloadfocaccia-qemu-ab50f22309a17c772c51931940596e707c200739.tar.gz
focaccia-qemu-ab50f22309a17c772c51931940596e707c200739.zip
bios-tables-test: add diff allowed list
Expected table change is then handled like this:
1. add table to diff allowed list
2. change generating code (can be combined with 1)
3. maintainer runs a script to update expected +
   blows away allowed diff list

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--tests/bios-tables-test-allowed-diff.h1
-rw-r--r--tests/bios-tables-test.c19
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/bios-tables-test-allowed-diff.h b/tests/bios-tables-test-allowed-diff.h
new file mode 100644
index 0000000000..dfb8523c8b
--- /dev/null
+++ b/tests/bios-tables-test-allowed-diff.h
@@ -0,0 +1 @@
+/* List of comma-separated changed AML files to ignore */
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 11e07be093..28d7d427e0 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -342,6 +342,22 @@ try_again:
     return exp_tables;
 }
 
+static bool test_acpi_find_diff_allowed(AcpiSdtTable *sdt)
+{
+    const gchar *allowed_diff_file[] = {
+#include "bios-tables-test-allowed-diff.h"
+        NULL
+    };
+    const gchar **f;
+
+    for (f = allowed_diff_file; *f; ++f) {
+        if (!g_strcmp0(sdt->aml_file, *f)) {
+            return true;
+        }
+    }
+    return false;
+}
+
 /* test the list of tables in @data->tables against reference tables */
 static void test_acpi_asl(test_data *data)
 {
@@ -396,7 +412,8 @@ static void test_acpi_asl(test_data *data)
                             "see ASL difference.");
                     }
                 }
-          }
+            }
+            g_assert(test_acpi_find_diff_allowed(exp_sdt));
         }
         g_string_free(asl, true);
         g_string_free(exp_asl, true);