All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: qemu-devel@nongnu.org, famz@redhat.com, cota@braap.org
Subject: Re: [Qemu-devel] [PATCH v1 09/24] tests/tcg: move architecture independent tests into subdir
Date: Mon, 16 Apr 2018 10:01:03 +0100	[thread overview]
Message-ID: <878t9nbk4w.fsf@linaro.org> (raw)
In-Reply-To: <9011098f-f881-8426-6781-ca088bb8e32d@amsat.org>


Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> Hi Alex,
>
> On 04/10/2018 04:39 PM, Alex Bennée wrote:
>> We will want to build these for all supported guest architectures so
>> lets move them all into one place. We also drop test_path at this
>> point because it needs qemu utils and glib bits which is hard to
>> support for cross compiling.
>
> Can we keep it for the $target==$host case (or when NOT cross
> compiling)? Maybe move it to tests/tcg/host/test_path.c

I'd rather not have tests/tcg/ including anything from QEMU as that
implies more libraries and hence a trickier cross-compile environment.
That said I didn't actually dig into what exactly
init_paths("/tmp/qemu-test_path") was intended to achieve.

>
>> 
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>>  tests/tcg/README                       |  10 +--
>>  tests/tcg/multiarch/README             |   1 +
>>  tests/tcg/{ => multiarch}/linux-test.c |   0
>>  tests/tcg/{ => multiarch}/sha1.c       |   0
>>  tests/tcg/{ => multiarch}/test-mmap.c  |   0
>>  tests/tcg/{ => multiarch}/testthread.c |   0
>>  tests/tcg/test_path.c                  | 157 ---------------------------------
>>  7 files changed, 5 insertions(+), 163 deletions(-)
>>  create mode 100644 tests/tcg/multiarch/README
>>  rename tests/tcg/{ => multiarch}/linux-test.c (100%)
>>  rename tests/tcg/{ => multiarch}/sha1.c (100%)
>>  rename tests/tcg/{ => multiarch}/test-mmap.c (100%)
>>  rename tests/tcg/{ => multiarch}/testthread.c (100%)
>>  delete mode 100644 tests/tcg/test_path.c
>> 
>> diff --git a/tests/tcg/README b/tests/tcg/README
>> index 5dcfb4852b..0890044cf0 100644
>> --- a/tests/tcg/README
>> +++ b/tests/tcg/README
>> @@ -1,9 +1,7 @@
>> -This directory contains various interesting programs for
>> -regression testing.
>> -
>> -The target "make test" runs the programs and, if applicable,
>> -runs "diff" to detect mismatches between output on the host and
>> -output on QEMU.
>> +This directory contains various interesting guest programs for
>> +regression testing. Tests are either multi-arch, meaning they can be
>> +built for all guest architectures that support linux-user executable,
>> +or they are architecture specific.
>>  
>>  i386
>>  ====
>> diff --git a/tests/tcg/multiarch/README b/tests/tcg/multiarch/README
>> new file mode 100644
>> index 0000000000..522c9d2ea3
>> --- /dev/null
>> +++ b/tests/tcg/multiarch/README
>> @@ -0,0 +1 @@
>> +Multi-architecture linux-user tests
>> diff --git a/tests/tcg/linux-test.c b/tests/tcg/multiarch/linux-test.c
>> similarity index 100%
>> rename from tests/tcg/linux-test.c
>> rename to tests/tcg/multiarch/linux-test.c
>> diff --git a/tests/tcg/sha1.c b/tests/tcg/multiarch/sha1.c
>> similarity index 100%
>> rename from tests/tcg/sha1.c
>> rename to tests/tcg/multiarch/sha1.c
>> diff --git a/tests/tcg/test-mmap.c b/tests/tcg/multiarch/test-mmap.c
>> similarity index 100%
>> rename from tests/tcg/test-mmap.c
>> rename to tests/tcg/multiarch/test-mmap.c
>> diff --git a/tests/tcg/testthread.c b/tests/tcg/multiarch/testthread.c
>> similarity index 100%
>> rename from tests/tcg/testthread.c
>> rename to tests/tcg/multiarch/testthread.c
>> diff --git a/tests/tcg/test_path.c b/tests/tcg/test_path.c
>> deleted file mode 100644
>> index 1c29bce263..0000000000
>> --- a/tests/tcg/test_path.c
>> +++ /dev/null
>> @@ -1,157 +0,0 @@
>> -/* Test path override code */
>> -#include "config-host.h"
>> -#include "util/cutils.c"
>> -#include "util/hexdump.c"
>> -#include "util/iov.c"
>> -#include "util/path.c"
>> -#include "util/qemu-timer-common.c"
>> -#include <stdarg.h>
>> -#include <sys/stat.h>
>> -#include <fcntl.h>
>> -
>> -void qemu_log(const char *fmt, ...);
>> -
>> -/* Any log message kills the test. */
>> -void qemu_log(const char *fmt, ...)
>> -{
>> -    va_list ap;
>> -
>> -    fprintf(stderr, "FATAL: ");
>> -    va_start(ap, fmt);
>> -    vfprintf(stderr, fmt, ap);
>> -    va_end(ap);
>> -    exit(1);
>> -}
>> -
>> -#define NO_CHANGE(_path)						\
>> -	do {								\
>> -	    if (strcmp(path(_path), _path) != 0) return __LINE__;	\
>> -	} while(0)
>> -
>> -#define CHANGE_TO(_path, _newpath)					\
>> -	do {								\
>> -	    if (strcmp(path(_path), _newpath) != 0) return __LINE__;	\
>> -	} while(0)
>> -
>> -static void cleanup(void)
>> -{
>> -    unlink("/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -    unlink("/tmp/qemu-test_path/DIR1/DIR2/FILE2");
>> -    unlink("/tmp/qemu-test_path/DIR1/DIR2/FILE3");
>> -    unlink("/tmp/qemu-test_path/DIR1/DIR2/FILE4");
>> -    unlink("/tmp/qemu-test_path/DIR1/DIR2/FILE5");
>> -    rmdir("/tmp/qemu-test_path/DIR1/DIR2");
>> -    rmdir("/tmp/qemu-test_path/DIR1/DIR3");
>> -    rmdir("/tmp/qemu-test_path/DIR1");
>> -    rmdir("/tmp/qemu-test_path");
>> -}
>> -
>> -static unsigned int do_test(void)
>> -{
>> -    if (mkdir("/tmp/qemu-test_path", 0700) != 0)
>> -	return __LINE__;
>> -
>> -    if (mkdir("/tmp/qemu-test_path/DIR1", 0700) != 0)
>> -	return __LINE__;
>> -
>> -    if (mkdir("/tmp/qemu-test_path/DIR1/DIR2", 0700) != 0)
>> -	return __LINE__;
>> -
>> -    if (mkdir("/tmp/qemu-test_path/DIR1/DIR3", 0700) != 0)
>> -	return __LINE__;
>> -
>> -    if (close(creat("/tmp/qemu-test_path/DIR1/DIR2/FILE", 0600)) != 0)
>> -	return __LINE__;
>> -
>> -    if (close(creat("/tmp/qemu-test_path/DIR1/DIR2/FILE2", 0600)) != 0)
>> -	return __LINE__;
>> -
>> -    if (close(creat("/tmp/qemu-test_path/DIR1/DIR2/FILE3", 0600)) != 0)
>> -	return __LINE__;
>> -
>> -    if (close(creat("/tmp/qemu-test_path/DIR1/DIR2/FILE4", 0600)) != 0)
>> -	return __LINE__;
>> -
>> -    if (close(creat("/tmp/qemu-test_path/DIR1/DIR2/FILE5", 0600)) != 0)
>> -	return __LINE__;
>> -
>> -    init_paths("/tmp/qemu-test_path");
>> -
>> -    NO_CHANGE("/tmp");
>> -    NO_CHANGE("/tmp/");
>> -    NO_CHANGE("/tmp/qemu-test_path");
>> -    NO_CHANGE("/tmp/qemu-test_path/");
>> -    NO_CHANGE("/tmp/qemu-test_path/D");
>> -    NO_CHANGE("/tmp/qemu-test_path/DI");
>> -    NO_CHANGE("/tmp/qemu-test_path/DIR");
>> -    NO_CHANGE("/tmp/qemu-test_path/DIR1");
>> -    NO_CHANGE("/tmp/qemu-test_path/DIR1/");
>> -
>> -    NO_CHANGE("/D");
>> -    NO_CHANGE("/DI");
>> -    NO_CHANGE("/DIR");
>> -    NO_CHANGE("/DIR2");
>> -    NO_CHANGE("/DIR1.");
>> -
>> -    CHANGE_TO("/DIR1", "/tmp/qemu-test_path/DIR1");
>> -    CHANGE_TO("/DIR1/", "/tmp/qemu-test_path/DIR1");
>> -
>> -    NO_CHANGE("/DIR1/D");
>> -    NO_CHANGE("/DIR1/DI");
>> -    NO_CHANGE("/DIR1/DIR");
>> -    NO_CHANGE("/DIR1/DIR1");
>> -
>> -    CHANGE_TO("/DIR1/DIR2", "/tmp/qemu-test_path/DIR1/DIR2");
>> -    CHANGE_TO("/DIR1/DIR2/", "/tmp/qemu-test_path/DIR1/DIR2");
>> -
>> -    CHANGE_TO("/DIR1/DIR3", "/tmp/qemu-test_path/DIR1/DIR3");
>> -    CHANGE_TO("/DIR1/DIR3/", "/tmp/qemu-test_path/DIR1/DIR3");
>> -
>> -    NO_CHANGE("/DIR1/DIR2/F");
>> -    NO_CHANGE("/DIR1/DIR2/FI");
>> -    NO_CHANGE("/DIR1/DIR2/FIL");
>> -    NO_CHANGE("/DIR1/DIR2/FIL.");
>> -
>> -    CHANGE_TO("/DIR1/DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -    CHANGE_TO("/DIR1/DIR2/FILE2", "/tmp/qemu-test_path/DIR1/DIR2/FILE2");
>> -    CHANGE_TO("/DIR1/DIR2/FILE3", "/tmp/qemu-test_path/DIR1/DIR2/FILE3");
>> -    CHANGE_TO("/DIR1/DIR2/FILE4", "/tmp/qemu-test_path/DIR1/DIR2/FILE4");
>> -    CHANGE_TO("/DIR1/DIR2/FILE5", "/tmp/qemu-test_path/DIR1/DIR2/FILE5");
>> -
>> -    NO_CHANGE("/DIR1/DIR2/FILE6");
>> -    NO_CHANGE("/DIR1/DIR2/FILE/X");
>> -
>> -    CHANGE_TO("/DIR1/../DIR1", "/tmp/qemu-test_path/DIR1");
>> -    CHANGE_TO("/DIR1/../DIR1/", "/tmp/qemu-test_path/DIR1");
>> -    CHANGE_TO("/../DIR1", "/tmp/qemu-test_path/DIR1");
>> -    CHANGE_TO("/../DIR1/", "/tmp/qemu-test_path/DIR1");
>> -    CHANGE_TO("/DIR1/DIR2/../DIR2", "/tmp/qemu-test_path/DIR1/DIR2");
>> -    CHANGE_TO("/DIR1/DIR2/../DIR2/../../DIR1/DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -    CHANGE_TO("/DIR1/DIR2/../DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -
>> -    NO_CHANGE("/DIR1/DIR2/../DIR1");
>> -    NO_CHANGE("/DIR1/DIR2/../FILE");
>> -
>> -    CHANGE_TO("/./DIR1/DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -    CHANGE_TO("/././DIR1/DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -    CHANGE_TO("/DIR1/./DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -    CHANGE_TO("/DIR1/././DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -    CHANGE_TO("/DIR1/DIR2/./FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -    CHANGE_TO("/DIR1/DIR2/././FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -    CHANGE_TO("/./DIR1/./DIR2/./FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE");
>> -
>> -    return 0;
>> -}
>> -
>> -int main(int argc, char *argv[])
>> -{
>> -    int ret;
>> -
>> -    ret = do_test();
>> -    cleanup();
>> -    if (ret) {
>> -	fprintf(stderr, "test_path: failed on line %i\n", ret);
>> -	return 1;
>> -    }
>> -    return 0;
>> -}
>> 


-- 
Alex Bennée

  reply	other threads:[~2018-04-16  9:01 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 19:38 [Qemu-devel] [PATCH v1 00/24] fix building of tests/tcg Alex Bennée
2018-04-10 19:38 ` [Qemu-devel] [PATCH v1 01/24] configure: add test for docker availability Alex Bennée
2018-04-11  8:50   ` Fam Zheng
2018-04-11 10:58     ` Alex Bennée
2018-04-11 12:59       ` Fam Zheng
2018-04-10 19:38 ` [Qemu-devel] [PATCH v1 02/24] configure: add support for --cross-cc-FOO Alex Bennée
2018-04-16  2:04   ` Philippe Mathieu-Daudé
2018-04-16  8:49     ` Alex Bennée
2018-04-10 19:38 ` [Qemu-devel] [PATCH v1 03/24] configure: move i386_cc to cross_cc_i386 Alex Bennée
2018-04-16  0:01   ` Philippe Mathieu-Daudé
2018-04-16  9:02     ` Alex Bennée
2018-04-16 10:30       ` Philippe Mathieu-Daudé
2018-04-10 19:38 ` [Qemu-devel] [PATCH v1 04/24] Makefile: Rename TARGET_DIRS to TARGET_LIST Alex Bennée
2018-04-12 14:33   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 05/24] docker: Add "cc" subcommand Alex Bennée
2018-04-16  1:48   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 06/24] docker: extend "cc" command to accept compiler Alex Bennée
2018-04-12  8:07   ` Fam Zheng
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 07/24] docker: allow "cc" command to run in user context Alex Bennée
2018-04-12  8:08   ` Fam Zheng
2018-04-16  0:02   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 08/24] docker: Makefile.include introduce DOCKER_SCRIPT Alex Bennée
2018-04-11 15:10   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 09/24] tests/tcg: move architecture independent tests into subdir Alex Bennée
2018-04-11 10:22   ` Thomas Huth
2018-04-16  0:05   ` Philippe Mathieu-Daudé
2018-04-16  9:01     ` Alex Bennée [this message]
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 10/24] tests/tcg/multiarch: Build fix for linux-test Alex Bennée
2018-04-11 10:25   ` Thomas Huth
     [not found]   ` <4bc22552-25b4-2a04-dc73-dc17201a2251@amsat.org>
     [not found]     ` <3b680ef4-3304-99d5-75ef-c4d5d570bb3a@amsat.org>
2018-04-16  8:51       ` Alex Bennée
2018-05-25 10:21       ` Alex Bennée
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 11/24] tests/tcg: move i386 specific tests into subdir Alex Bennée
2018-04-11 10:30   ` Thomas Huth
2018-04-16  0:08   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 12/24] tests/tcg/i386: Build fix for hello-i386 Alex Bennée
2018-04-11 10:30   ` Thomas Huth
2018-04-16  0:11   ` Philippe Mathieu-Daudé
2018-04-16  8:57     ` Alex Bennée
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 13/24] tests/tcg/i386: move test-i386-sse.c to tests/tcg/x86_64/test-sse.c Alex Bennée
2018-04-11 15:33   ` Thomas Huth
2018-04-11 16:19     ` Alex Bennée
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 14/24] tests/tcg/i386: fix test-i386 Alex Bennée
2018-04-11 15:36   ` Thomas Huth
2018-04-16  0:13   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 15/24] tests/tcg/i368: fix hello-i386 Alex Bennée
2018-04-11 15:38   ` Thomas Huth
2018-04-16  0:14   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 16/24] tests/tcg/i386: fix test-i386-fprem Alex Bennée
2018-04-11 15:14   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 17/24] tests/tcg: move ARM specific tests into subdir Alex Bennée
2018-04-11 15:40   ` Thomas Huth
2018-04-16  0:14   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 18/24] tests/tcg/arm: fix hello-arm Alex Bennée
2018-04-11 15:42   ` Thomas Huth
2018-04-16  1:28   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 19/24] tests/tcg: move MIPS specific tests into subdir Alex Bennée
2018-04-16  1:02   ` Philippe Mathieu-Daudé
2018-04-16  1:33     ` Philippe Mathieu-Daudé
2018-04-16  8:56     ` Alex Bennée
2018-04-16 10:21       ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 20/24] tests/tcg: enable building for s390x Alex Bennée
2018-04-11  8:36   ` Cornelia Huck
2018-04-16  1:33   ` Philippe Mathieu-Daudé
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 21/24] tests/tcg: enable building for ppc64 Alex Bennée
2018-04-16  1:36   ` Philippe Mathieu-Daudé
2018-04-16  8:54     ` Alex Bennée
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 22/24] tests/tcg/Makefile: update to be called from Makefile.target Alex Bennée
2018-04-12  8:13   ` Fam Zheng
2018-04-12  8:47     ` Alex Bennée
2018-04-12  9:14       ` Fam Zheng
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 23/24] Makefile.target: add (clean-)guest-tests targets Alex Bennée
2018-04-16  1:12   ` Philippe Mathieu-Daudé
2018-04-16  1:52   ` Philippe Mathieu-Daudé
2018-04-16  8:53     ` Alex Bennée
2018-04-16 10:24       ` Philippe Mathieu-Daudé
2018-04-16 17:14       ` Philippe Mathieu-Daudé
2018-04-16 20:08         ` Alex Bennée
2018-04-17 14:41           ` Philippe Mathieu-Daudé
2018-04-17 15:09             ` Alex Bennée
2018-04-10 19:39 ` [Qemu-devel] [PATCH v1 24/24] tests/Makefile.include: add (clean-)check-tcg targets Alex Bennée
2018-04-16  1:53   ` Philippe Mathieu-Daudé
2018-04-10 20:07 ` [Qemu-devel] [PATCH v1 00/24] fix building of tests/tcg no-reply
2018-04-16 10:37 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878t9nbk4w.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=cota@braap.org \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.