[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 03/30] bios-tables-test: default diff command
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 03/30] bios-tables-test: default diff command |
Date: |
Wed, 26 Feb 2020 04:01:13 -0500 |
Most people probably just want diff -u. So let's use that
as the default.
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
tests/qtest/bios-tables-test.c | 29 +++++++++++------------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 1aed0ee7df..0a597bbacf 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -465,25 +465,18 @@ static void test_acpi_asl(test_data *data)
exp_sdt->asl_file, exp_sdt->aml_file);
fflush(stderr);
if (getenv("V")) {
- const char *diff_cmd = getenv("DIFF");
- if (diff_cmd) {
- 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;
+ const char *diff_env = getenv("DIFF");
+ const char *diff_cmd = diff_env ? diff_env : "diff -u";
+ 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 "
- "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.");
- }
+ dup2(STDERR_FILENO, STDOUT_FILENO);
+ ret = system(diff) ;
+ dup2(out, STDOUT_FILENO);
+ close(out);
+ g_free(diff);
}
}
}
--
MST
- [PULL v2 00/30] virtio, pc: fixes, features, Michael S. Tsirkin, 2020/02/26
- [PULL v2 01/30] bios-tables-test: tell people how to update, Michael S. Tsirkin, 2020/02/26
- [PULL v2 02/30] bios-tables-test: fix up DIFF generation, Michael S. Tsirkin, 2020/02/26
- [PULL v2 03/30] bios-tables-test: default diff command,
Michael S. Tsirkin <=
- [PULL v2 04/30] rebuild-expected-aml.sh: remind about the process, Michael S. Tsirkin, 2020/02/26
- [PULL v2 06/30] vhost-user-fs: convert to the new virtio_delete_queue function, Michael S. Tsirkin, 2020/02/26
- [PULL v2 05/30] vhost-user-fs: do delete virtio_queues in unrealize, Michael S. Tsirkin, 2020/02/26
- [PULL v2 07/30] virtio-pmem: do delete rq_vq in virtio_pmem_unrealize, Michael S. Tsirkin, 2020/02/26
- [PULL v2 08/30] virtio-crypto: do delete ctrl_vq in virtio_crypto_device_unrealize, Michael S. Tsirkin, 2020/02/26
- [PULL v2 09/30] vhost-user-blk: delete virtioqueues in unrealize to fix memleaks, Michael S. Tsirkin, 2020/02/26
- [PULL v2 10/30] vhost-user-blk: convert to new virtio_delete_queue, Michael S. Tsirkin, 2020/02/26
- [PULL v2 11/30] virtio: gracefully handle invalid region caches, Michael S. Tsirkin, 2020/02/26
- [PULL v2 13/30] virtio-iommu: Decode the command payload, Michael S. Tsirkin, 2020/02/26
- [PULL v2 12/30] virtio-iommu: Add skeleton, Michael S. Tsirkin, 2020/02/26