diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2020-01-22 02:21:18 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-02-25 08:23:18 -0500 |
commit | c01e905f3a34088346833f3a5518cb0efeb24e27 (patch) | |
tree | 5f294257d194f1f9591cdb2bb57fb2d628436510 /tests/qtest | |
parent | a7b4384fefbd1cbe05c8fd10fe06de8c4fdc2792 (diff) |
bios-tables-test: fix up DIFF generation
Turns out it goes to stdout which is suppressed even with V=1.
Force DIFF output to stderr to make it visible.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests/qtest')
-rw-r--r-- | tests/qtest/bios-tables-test.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 9c3c4680e4..1aed0ee7df 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -463,13 +463,19 @@ static void test_acpi_asl(test_data *data) "Actual [asl:%s, aml:%s], Expected [asl:%s, aml:%s].\n", exp_sdt->aml, sdt->asl_file, sdt->aml_file, exp_sdt->asl_file, exp_sdt->aml_file); + fflush(stderr); if (getenv("V")) { const char *diff_cmd = getenv("DIFF"); if (diff_cmd) { - int ret G_GNUC_UNUSED; char *diff = g_strdup_printf("%s %s %s", diff_cmd, exp_sdt->asl_file, sdt->asl_file); + int out = dup(STDOUT_FILENO); + int ret G_GNUC_UNUSED; + + dup2(STDERR_FILENO, STDOUT_FILENO); ret = system(diff) ; + dup2(out, STDOUT_FILENO); + close(out); g_free(diff); } else { fprintf(stderr, "acpi-test: Warning. not showing " |