All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] bios-tables-test: add diff allowed list
@ 2019-05-23 18:46 Michael S. Tsirkin
  0 siblings, 0 replies; only message in thread
From: Michael S. Tsirkin @ 2019-05-23 18:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Igor Mammedov, Thomas Huth, Paolo Bonzini

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>
---

So I got tired of manual "remember to update AML files"
reminders. With this an AML diff asserts unless it's
explicitly allowed.

Comments?

 tests/bios-tables-test-allowed-diff.h |  1 +
 tests/bios-tables-test.c              | 20 +++++++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 tests/bios-tables-test-allowed-diff.h

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..93db1a7265 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -342,6 +342,23 @@ 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
+    };
+    int offset = strlen(data_dir) + 1;
+    const gchar **f;
+
+    for (f = allowed_diff_file; *f; ++f) {
+        if (!g_strcmp0(sdt->aml_file + offset, *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 +413,8 @@ static void test_acpi_asl(test_data *data)
                             "see ASL difference.");
                     }
                 }
-          }
+            }
+            g_assert(test_acpi_find_diff_allowed(sdt));
         }
         g_string_free(asl, true);
         g_string_free(exp_asl, true);
-- 
MST


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-23 18:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 18:46 [Qemu-devel] [PATCH] bios-tables-test: add diff allowed list Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.