xref: /qemu/tests/data/acpi/rebuild-expected-aml.sh (revision e6e68e32d2fac52e2f88efc0bd16dd92c2e9e88a)
1fa59483dSPhilippe Mathieu-Daudé#!/usr/bin/env bash
2cebc92a2SMarcel Apfelbaum
3cebc92a2SMarcel Apfelbaum#
4cebc92a2SMarcel Apfelbaum# Rebuild expected AML files for acpi unit-test
5cebc92a2SMarcel Apfelbaum#
6cebc92a2SMarcel Apfelbaum# Copyright (c) 2013 Red Hat Inc.
7cebc92a2SMarcel Apfelbaum#
8cebc92a2SMarcel Apfelbaum# Authors:
9cebc92a2SMarcel Apfelbaum#  Marcel Apfelbaum <marcel.a@redhat.com>
10ae3c12a0SIgor Mammedov#  Igor Mammedov <imammedo@redhat.com>
11cebc92a2SMarcel Apfelbaum#
12cebc92a2SMarcel Apfelbaum# This work is licensed under the terms of the GNU GPLv2.
13cebc92a2SMarcel Apfelbaum# See the COPYING.LIB file in the top-level directory.
14cebc92a2SMarcel Apfelbaum
15ab6b6a77SIgor Mammedovqemu_bins="x86_64-softmmu/qemu-system-x86_64 aarch64-softmmu/qemu-system-aarch64"
16cebc92a2SMarcel Apfelbaum
170ce46ab5SShameer Kolothumif [ ! -e "tests/qtest/bios-tables-test" ]; then
1890475791SPaolo Bonzini    echo "Test: bios-tables-test is required! Run make check before this script."
19cebc92a2SMarcel Apfelbaum    echo "Run this script from the build directory."
20cebc92a2SMarcel Apfelbaum    exit 1;
21cebc92a2SMarcel Apfelbaumfi
22cebc92a2SMarcel Apfelbaum
23ae3c12a0SIgor Mammedovfor qemu in $qemu_bins; do
24ae3c12a0SIgor Mammedov    if [ ! -e $qemu ]; then
25ae3c12a0SIgor Mammedov        echo "Run 'make' to build the following QEMU executables: $qemu_bins"
26ae3c12a0SIgor Mammedov        echo "Also, run this script from the build directory."
27ae3c12a0SIgor Mammedov        exit 1;
28ae3c12a0SIgor Mammedov    fi
290ce46ab5SShameer Kolothum    TEST_ACPI_REBUILD_AML=y QTEST_QEMU_BINARY=$qemu tests/qtest/bios-tables-test
30ae3c12a0SIgor Mammedovdone
31ae3c12a0SIgor Mammedov
325f6b3561SMichael S. Tsirkineval `grep SRC_PATH= config-host.mak`
335f6b3561SMichael S. Tsirkin
346ab425d8SMichael S. Tsirkinold_allowed_dif=`grep -v -e 'List of comma-separated changed AML files to ignore' ${SRC_PATH}/tests/qtest/bios-tables-test-allowed-diff.h`
356ab425d8SMichael S. Tsirkin
360ce46ab5SShameer Kolothumecho '/* List of comma-separated changed AML files to ignore */' > ${SRC_PATH}/tests/qtest/bios-tables-test-allowed-diff.h
37cebc92a2SMarcel Apfelbaum
38cebc92a2SMarcel Apfelbaumecho "The files were rebuilt and can be added to git."
39*e6e68e32SMichael S. Tsirkinecho "You can use ${SRC_PATH}/tests/data/acpi/disassemle-aml.sh to disassemble them to ASL."
406ab425d8SMichael S. Tsirkin
416ab425d8SMichael S. Tsirkinif [ -z "$old_allowed_dif" ]; then
426ab425d8SMichael S. Tsirkin    echo "Note! Please do not commit expected files with source changes"
436ab425d8SMichael S. Tsirkin    echo "Note! Please follow the process documented in ${SRC_PATH}/tests/qtest/bios-tables-test.c"
446ab425d8SMichael S. Tsirkinfi
45