From patchwork Fri Aug 19 17:00:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9290649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 57C016077B for ; Fri, 19 Aug 2016 17:04:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4509F294E4 for ; Fri, 19 Aug 2016 17:04:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39E1A294E8; Fri, 19 Aug 2016 17:04:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A96DC294E4 for ; Fri, 19 Aug 2016 17:04:38 +0000 (UTC) Received: from localhost ([::1]:58227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1banDh-0005zs-QA for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Aug 2016 13:04:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ban9m-0002oo-NY for qemu-devel@nongnu.org; Fri, 19 Aug 2016 13:00:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ban9k-0000C4-Ck for qemu-devel@nongnu.org; Fri, 19 Aug 2016 13:00:33 -0400 Received: from mail-yb0-x244.google.com ([2607:f8b0:4002:c09::244]:35708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ban9k-0000Bz-7S for qemu-devel@nongnu.org; Fri, 19 Aug 2016 13:00:32 -0400 Received: by mail-yb0-x244.google.com with SMTP id x37so1527204ybh.2 for ; Fri, 19 Aug 2016 10:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=igha7WYrbqLcjELTQADfN6UuGh1l+YjZFDehcS+Rx/w=; b=C+ww4fIiAmKfP4/3oiwVpOaGGh65DcnAq9BVXB7rwuweiCtMsoQrpMqK01WzLNM3op pcb1FmN9ETXNAEBuS3ZAeUKstFZU6HnWY13gM6us1xMa32FYze73oaxfCm/HPj7f4l9R dqpF2LXrmWt89tLrU7yFe/pSoKNaubmi34VqNbSYkI8FCN3q7U+nhh+K5p3IO3pzmy1N u/pbOsQHrLsZGOAVPoIJuJJkjRF8ulQ2C5Q7JYIoTx+hwojED/I841ixA78rOxdZnrpX 7bpXf22r+V2Kbm8vstizH5kO6JOFyS/yuPPLHP3qpYLrl6/pCUL/aNlbE7to5ca89ds/ pgJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=igha7WYrbqLcjELTQADfN6UuGh1l+YjZFDehcS+Rx/w=; b=UhlfjBhzfqdJgIDozHDxIgH8SZevgzifOdAPKiOgVkInqKpCPoZm0AzK3+E9tMQbLt FdwXdhQuLT+Ak29hdnLaC2D+nOQFX1j0Er8C2IIku1rl5LZnJTyYKsc+na6C44oSdTmD RKt4opZNqYPKax+YzpIDHhFGeTszAUL5Y3n8qaVh6wF4oIYZhCsRpX1KHYKlWLSbsr9X 8BftAn/ia+ywCmdPxzajZXerbLmS79/35/vzy9TgEIxH4gIgepevc0Xo1h/IuzaswyBt zHoed9puh16bgr2fHZZRvt3u7CT6WXS/vJhUsPlxSQEEzoBV6ynvQGULG4NP/twy99Z2 OXlw== X-Gm-Message-State: AEkoousdRmfpssakkeZ5D6Us/uft9PlLCyKoVjrprCZm20XY7zNBNkVnKotdmtProboW3w== X-Received: by 10.37.104.79 with SMTP id d76mr6828324ybc.101.1471626031680; Fri, 19 Aug 2016 10:00:31 -0700 (PDT) Received: from evgadesktop.attlocal.net (108-232-152-155.lightspeed.tukrga.sbcglobal.net. [108.232.152.155]) by smtp.gmail.com with ESMTPSA id o78sm1951766ywo.40.2016.08.19.10.00.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Aug 2016 10:00:31 -0700 (PDT) From: Pranith Kumar To: qemu-devel@nongnu.org, Veronia Bahaa , Paolo Bonzini Date: Fri, 19 Aug 2016 13:00:25 -0400 Message-Id: <20160819170025.22345-5-bobby.prani@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160819170025.22345-1-bobby.prani@gmail.com> References: <20160819170025.22345-1-bobby.prani@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c09::244 Subject: [Qemu-devel] [RFC PATCH 4/4] tests/tcg: misc tests holds arch independent tests 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: peter.maydell@linaro.org, alex.bennee@linaro.org, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Pranith Kumar --- tests/tcg/misc/Makefile | 75 +++++++++++++++++++++++++++++++++++++++ tests/tcg/{ => misc}/linux-test.c | 3 ++ tests/tcg/{ => misc}/sha1.c | 0 tests/tcg/{ => misc}/test-mmap.c | 0 tests/tcg/{ => misc}/test_path.c | 0 tests/tcg/{ => misc}/testthread.c | 0 6 files changed, 78 insertions(+) create mode 100644 tests/tcg/misc/Makefile rename tests/tcg/{ => misc}/linux-test.c (99%) rename tests/tcg/{ => misc}/sha1.c (100%) rename tests/tcg/{ => misc}/test-mmap.c (100%) rename tests/tcg/{ => misc}/test_path.c (100%) rename tests/tcg/{ => misc}/testthread.c (100%) diff --git a/tests/tcg/misc/Makefile b/tests/tcg/misc/Makefile new file mode 100644 index 0000000..39c316b --- /dev/null +++ b/tests/tcg/misc/Makefile @@ -0,0 +1,75 @@ +BUILD_DIR=../../../build/ +SRC_PATH=../../../ +include $(BUILD_DIR)/config-host.mak +include $(SRC_PATH)/rules.mak + +$(call set-vpath, $(SRC_PATH)/tests/tcg/misc) + +QEMU=$(BUILD_DIR)/$(ARCH)-linux-user/qemu-$(ARCH) + +QEMU_INCLUDES += -I$(BUILD_DIR) +CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I$(SRC_PATH)/include -I$(BUILD_DIR) +#CFLAGS+=-msse2 +LDFLAGS= + +# TODO: automatically detect ARM and MIPS compilers, and run those too + +# runcom maps page 0, so it requires root privileges +# also, pi_10.com runs indefinitely + +TESTS=linux-test \ + testthread \ + sha1 \ + test-mmap \ + test_path + # runcom + +all: $(patsubst %,run-%,$(TESTS)) +test: all + +# rules to run tests + +run-%: % + -$(QEMU) ./$* + +run-linux-test: linux-test +run-testthread: testthread +run-sha1: sha1 +run-test_path: test_path + +run-test-mmap: test-mmap + -$(QEMU) ./test-mmap + -$(QEMU) -p 8192 ./test-mmap 8192 + -$(QEMU) -p 16384 ./test-mmap 16384 + -$(QEMU) -p 32768 ./test-mmap 32768 + +run-test_path: test_path + +# rules to compile tests + +test_path: test_path.o + $(CC) $^ -o $@ -lglib-2.0 + +test_path.o: test_path.c + $(CC) $^ -c -o $@ $(QEMU_INCLUDES) `pkg-config --cflags --libs glib-2.0` + +testthread: testthread.c + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread + +# generic Linux and CPU test +linux-test: linux-test.c + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm + +test-mmap: test-mmap.c + $(CC) $(CFLAGS) -Wall -O2 $(LDFLAGS) -o $@ $< -static + +# speed test +sha1: sha1.c + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< + +speed: sha1 + time ./sha1 + time $(QEMU) ./sha1 + +clean: + rm -f *~ *.o $(TESTS) diff --git a/tests/tcg/linux-test.c b/tests/tcg/misc/linux-test.c similarity index 99% rename from tests/tcg/linux-test.c rename to tests/tcg/misc/linux-test.c index 5070d31..41ad91c 100644 --- a/tests/tcg/linux-test.c +++ b/tests/tcg/misc/linux-test.c @@ -39,6 +39,9 @@ #include #include #include +#include +#include +#include "qemu/compiler.h" #include "qemu/cutils.h" #define TESTPATH "/tmp/linux-test.tmp" diff --git a/tests/tcg/sha1.c b/tests/tcg/misc/sha1.c similarity index 100% rename from tests/tcg/sha1.c rename to tests/tcg/misc/sha1.c diff --git a/tests/tcg/test-mmap.c b/tests/tcg/misc/test-mmap.c similarity index 100% rename from tests/tcg/test-mmap.c rename to tests/tcg/misc/test-mmap.c diff --git a/tests/tcg/test_path.c b/tests/tcg/misc/test_path.c similarity index 100% rename from tests/tcg/test_path.c rename to tests/tcg/misc/test_path.c diff --git a/tests/tcg/testthread.c b/tests/tcg/misc/testthread.c similarity index 100% rename from tests/tcg/testthread.c rename to tests/tcg/misc/testthread.c