Skip to content

Commit

Permalink
bios-tables-test: add diff allowed list
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mstsirkin committed May 29, 2019
1 parent 386cff4 commit ab50f22
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/bios-tables-test-allowed-diff.h
@@ -0,0 +1 @@
/* List of comma-separated changed AML files to ignore */
19 changes: 18 additions & 1 deletion tests/bios-tables-test.c
Expand Up @@ -342,6 +342,22 @@ static GArray *load_expected_aml(test_data *data)
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)
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ab50f22

Please sign in to comment.