mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
bios-tables-test: default diff command
Most people probably just want diff -u. So let's use that as the default. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
c01e905f3a
commit
34b1429ca9
1 changed files with 11 additions and 18 deletions
|
@ -465,25 +465,18 @@ static void test_acpi_asl(test_data *data)
|
||||||
exp_sdt->asl_file, exp_sdt->aml_file);
|
exp_sdt->asl_file, exp_sdt->aml_file);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
if (getenv("V")) {
|
if (getenv("V")) {
|
||||||
const char *diff_cmd = getenv("DIFF");
|
const char *diff_env = getenv("DIFF");
|
||||||
if (diff_cmd) {
|
const char *diff_cmd = diff_env ? diff_env : "diff -u";
|
||||||
char *diff = g_strdup_printf("%s %s %s", diff_cmd,
|
char *diff = g_strdup_printf("%s %s %s", diff_cmd,
|
||||||
exp_sdt->asl_file, sdt->asl_file);
|
exp_sdt->asl_file, sdt->asl_file);
|
||||||
int out = dup(STDOUT_FILENO);
|
int out = dup(STDOUT_FILENO);
|
||||||
int ret G_GNUC_UNUSED;
|
int ret G_GNUC_UNUSED;
|
||||||
|
|
||||||
dup2(STDERR_FILENO, STDOUT_FILENO);
|
dup2(STDERR_FILENO, STDOUT_FILENO);
|
||||||
ret = system(diff) ;
|
ret = system(diff) ;
|
||||||
dup2(out, STDOUT_FILENO);
|
dup2(out, STDOUT_FILENO);
|
||||||
close(out);
|
close(out);
|
||||||
g_free(diff);
|
g_free(diff);
|
||||||
} else {
|
|
||||||
fprintf(stderr, "acpi-test: Warning. not showing "
|
|
||||||
"difference since no diff utility is specified. "
|
|
||||||
"Set 'DIFF' environment variable to a preferred "
|
|
||||||
"diff utility and run 'make V=1 check' again to "
|
|
||||||
"see ASL difference.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue