Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Bur <cyrilbur@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/kvm-unit-tests: new package
Date: Thu, 18 Aug 2016 09:02:36 +1000	[thread overview]
Message-ID: <20160817230236.8255-1-cyrilbur@gmail.com> (raw)

The unit tests are tiny guest operating systems that generally execute
only tens of lines of C and assembler test code in order to obtain its
PASS/FAIL result. Unit tests provide KVM and virt hardware functional
testing by targeting the features through minimal implementations of
their use per the hardware specification. The simplicity of unit tests
make them easy to verify they are correct, easy to maintain, and easy
to use in timing measurements. Unit tests are also often used for
quick and dirty bug reproducers. The reproducers may then be kept as
regression tests. It's strongly encouraged that patches implementing
new KVM features are submitted with accompanying unit tests.
http://www.linux-kvm.org/page/KVM-unit-tests

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
---
 package/Config.in                        |  1 +
 package/kvm-unit-tests/Config.in         | 17 ++++++++++++
 package/kvm-unit-tests/kvm-unit-tests.mk | 45 ++++++++++++++++++++++++++++++++
 3 files changed, 63 insertions(+)
 create mode 100644 package/kvm-unit-tests/Config.in
 create mode 100644 package/kvm-unit-tests/kvm-unit-tests.mk

diff --git a/package/Config.in b/package/Config.in
index e1ddcea..60f7d6e 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -82,6 +82,7 @@ menu "Debugging, profiling and benchmark"
 	source "package/kexec/Config.in"
 	source "package/kexec-lite/Config.in"
 	source "package/ktap/Config.in"
+	source "package/kvm-unit-tests/Config.in"
 	source "package/kyua/Config.in"
 	source "package/latencytop/Config.in"
 	source "package/lmbench/Config.in"
diff --git a/package/kvm-unit-tests/Config.in b/package/kvm-unit-tests/Config.in
new file mode 100644
index 0000000..cf0da58
--- /dev/null
+++ b/package/kvm-unit-tests/Config.in
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_KVM_UNIT_TESTS
+	bool "kvm-unit-tests"
+	depends on BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64 || BR2_i386 || BR2_arm
+	help
+	  kvm-unit-tests is a project as old as KVM. As its name suggests,
+	  it's purpose is to provide unit tests for KVM. The unit tests are tiny
+	  guest operating systems that generally execute only tens of lines of C
+	  and assembler test code in order to obtain its PASS/FAIL result. Unit
+	  tests provide KVM and virt hardware functional testing by targeting
+	  the features through minimal implementations of their use per the
+	  hardware specification. The simplicity of unit tests make them easy to
+	  verify they are correct, easy to maintain, and easy to use in timing
+	  measurements. Unit tests are also often used for quick and dirty bug
+	  reproducers. The reproducers may then be kept as regression tests.
+	  It's strongly encouraged that patches implementing new KVM features
+	  are submitted with accompanying unit tests.
+	  http://www.linux-kvm.org/page/KVM-unit-tests
diff --git a/package/kvm-unit-tests/kvm-unit-tests.mk b/package/kvm-unit-tests/kvm-unit-tests.mk
new file mode 100644
index 0000000..457e656
--- /dev/null
+++ b/package/kvm-unit-tests/kvm-unit-tests.mk
@@ -0,0 +1,45 @@
+################################################################################
+#
+# kvm-unit-tests
+#
+################################################################################
+
+KVM_UNIT_TESTS_VERSION = 682187afcc998bc3dd25061e98b43792cc340b33
+KVM_UNIT_TESTS_SITE = $(BR2_KERNEL_MIRROR)/scm/virt/kvm/kvm-unit-tests.git
+KVM_UNIT_TESTS_SITE_METHOD = git
+KVM_UNIT_TESTS_LICENSE = LGPLv2
+KVM_UNIT_TESTS_LICENSE_FILES = COPYRIGHT
+KVM_UNIT_TESTS_ARCH = "$(ARCH)"
+
+ifeq ($(ARCH),powerpc64)
+KVM_UNIT_TESTS_ARCH = "ppc64"
+endif
+ifeq ($(ARCH),powerpc64le)
+KVM_UNIT_TESTS_ARCH = "ppc64"
+endif
+
+ifeq ($(BR2_ENDIAN),"LITTLE")
+KVM_UNIT_TESTS_ENDIAN = "little"
+else
+KVM_UNIT_TESTS_ENDIAN = "big"
+endif
+
+KVM_UNIT_TESTS_CONF_OPTS = --arch="$(KVM_UNIT_TESTS_ARCH)" \
+						   --cross-prefix="$(TARGET_CROSS)" \
+						   --endian="$(KVM_UNIT_TESTS_ENDIAN)" \
+						   --prefix="$(TARGET_DIR)"
+
+define KVM_UNIT_TESTS_CONFIGURE_CMDS
+	cd $(@D) && ./configure $(KVM_UNIT_TESTS_CONF_OPTS)
+endef
+
+define KVM_UNIT_TESTS_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) standalone
+endef
+
+define KVM_UNIT_TESTS_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
+endef
+
+# Does use configure script but not an autotools one
+$(eval $(generic-package))
-- 
2.9.3

             reply	other threads:[~2016-08-17 23:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 23:02 Cyril Bur [this message]
2016-09-19 14:48 ` [Buildroot] [PATCH] package/kvm-unit-tests: new package Thomas Petazzoni
2016-09-19 21:07   ` Peter Korsgaard
2016-09-19 23:12   ` Cyril Bur
2016-09-21  7:24 ` Thomas Petazzoni
2016-09-22  0:01   ` Cyril Bur
2016-09-22  5:18     ` Peter Korsgaard
2016-09-22  9:34       ` Thomas Petazzoni
2016-09-22  9:42         ` Peter Korsgaard
2016-09-23  6:06       ` Cyril Bur
2016-09-23  6:12         ` Thomas Petazzoni
2016-09-23  6:14           ` Cyril Bur

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=20160817230236.8255-1-cyrilbur@gmail.com \
    --to=cyrilbur@gmail.com \
    --cc=buildroot@busybox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox