From patchwork Tue Apr 10 19:39:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 133110 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1642813ljb; Tue, 10 Apr 2018 12:55:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Ab7nu9qQ93yDmyCUOVJEsEOQNmhZzl6cbey1HP1ndaI6h2EViO4JCZYnD1gvUyXa/f/O3 X-Received: by 10.237.59.183 with SMTP id r52mr2876764qte.231.1523390111462; Tue, 10 Apr 2018 12:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523390111; cv=none; d=google.com; s=arc-20160816; b=v6ufPHJ/Vnp54sjYQ4DJkOrUgF8TwVlZxtF2B1XmWIwVvE+U29a4DrskMov94kg3JI qTr3pF2sZOUesF6qqVGSFNUgSJJFZKCRaagr3WcYmR4u+MMYU0hUj7lIywSCu6l6tUhH aGFT3yzXzO32vIklNMMwli5wsaZ9UlxK8aMP5AwsbDzWzZddtb6rGgm4DvAhhevbVGVV GBX/Xr4ujvYkualsaJ3KBA8uhKK03bJhJeS+AOw7/baGzbMlTKQO+AoGgwVzUlwqmq3t QvzrCAGfr8VJxjoCIl4qO3BP5kHaz68mhfA1eefPYvGDDph+TjSH6x89FSG7z2Zseijn tL0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=s9gEv9FVl/7gojclkswpfoyj8kCb7eaxCe7a7yfDICE=; b=uj2cEFnENGxZWp00x7ovwaJaSHf2tG8xUUthxmMG59zkb+oUb/EAU8bJXPEetDmdAO DmtPNdpZVuR0fM7P2n9qYiKIZoDt/NCiPVqOQUlRGO19VDB1ZpDURF/YmHh0hYHstocc FTEm/5WtXXVfxrx+r5U9PxMCHySJODLmlPXkoWf+K8gPfmZxPv4Sg8Wy8Jc7elDItQBV mVC9t8GkXhifKBaHkF8xIT8bwoOtdKsObOM6W/Zycla8OZOcDFJ28AWZWeoBvkDPbqf/ VhaFBADTlLWBWk8NFHMud7hvqLcPwdOhzJqGgXqdWo2t9kaMigGASHPQ+UO9S+TCdeC1 06aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iTKr0eEJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o5si563820qkb.160.2018.04.10.12.55.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 10 Apr 2018 12:55:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iTKr0eEJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5zME-00057T-Uo for patch@linaro.org; Tue, 10 Apr 2018 15:55:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5z79-0000Hi-4O for qemu-devel@nongnu.org; Tue, 10 Apr 2018 15:39:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5z75-0006NA-UG for qemu-devel@nongnu.org; Tue, 10 Apr 2018 15:39:35 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:40626) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f5z75-0006Ma-KV for qemu-devel@nongnu.org; Tue, 10 Apr 2018 15:39:31 -0400 Received: by mail-wm0-x241.google.com with SMTP id x4so25391391wmh.5 for ; Tue, 10 Apr 2018 12:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s9gEv9FVl/7gojclkswpfoyj8kCb7eaxCe7a7yfDICE=; b=iTKr0eEJttQVJolVXp5Mn+aAr42In7OtfiVWY9aiNfXbgZ7xv1t/iYaE8UyTT4bVls YayYKNNoW7l68bxHC3gcK/OkBxhm/7krc0qTF+bAw+rBPPWGQ1ahqi/rYC4pHQrbtW8f FttEyY8np2JrSNsmvK9IxZHeQDk1kOalQSohU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s9gEv9FVl/7gojclkswpfoyj8kCb7eaxCe7a7yfDICE=; b=iYKP9jH4UJVcUdZzrxoLX3cGdEU4L7+/zc9nlzbF29nitUPkj2fEFb7FxNPpFlSI8Q dKny/HtKJqeDUMN4m9ujKYSRQ8E4ioVl1IKRf6t5/TgTIokW9uXTIij7IcIJWgIInGYg cfZvbgxCoKAVdmK+Q0uj/KQVEnh5D2NwI8EX7+hxWVagVOPLZwzkKW76RHULivwpys3V ev3LTRSSQEMTdw70gY80Q3sCrESCaTNakO/uzL2QgEUp4BgHG4hYYZB9gOdXUerkPiEx /RlKOqOSTBOVYeVXTEW2HJjk/FJmvDo04vRFJh89y9Xq0mCvwGWco2F1Dv+3suo/EwoB jIiA== X-Gm-Message-State: ALQs6tBjbDRnyMZjQjJqrgfkWfvfSOv2LDs3FzM71nTgi+KQNnXYIdMz T/c1ZitfygSZjy1KeK8iTckuCQ== X-Received: by 10.28.91.203 with SMTP id p194mr588296wmb.52.1523389170382; Tue, 10 Apr 2018 12:39:30 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l131sm3592186wmb.36.2018.04.10.12.39.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Apr 2018 12:39:24 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 15C5E3E0AA7; Tue, 10 Apr 2018 20:39:20 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 10 Apr 2018 20:39:04 +0100 Message-Id: <20180410193919.28026-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180410193919.28026-1-alex.bennee@linaro.org> References: <20180410193919.28026-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH v1 09/24] tests/tcg: move architecture independent tests into subdir X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , famz@redhat.com, cota@braap.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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. Signed-off-by: Alex Bennée --- 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 -- 2.16.2 Reviewed-by: Thomas Huth 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 -#include -#include - -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; -}