[kvm-unit-tests PATCH 2/3] arm/arm64: Add a way to specify an external directory with tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This change adds an argument to the configure script which allows a
user to specify an external directory with extra tests. When
specified, the build system will include the Makefile in that
directory allowing a user to add extra tests. For example:

For example, DIR contains a test in test.c which depends on symbols
defined in obj.c and the Makefile:

tests += $(EXT_DIR)/test.flat

cflatobjs += $(EXT_DIR)/obj.o

With this change, we can add DIR to the build process and generate the
test using

$> ./configure --ext-dir=DIR
$> make

Signed-off-by: Nikos Nikoleris <nikos.nikoleris@xxxxxxx>
---
 configure           | 7 +++++++
 arm/Makefile.common | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/configure b/configure
index cdcd34e..e734b9d 100755
--- a/configure
+++ b/configure
@@ -26,6 +26,7 @@ errata_force=0
 erratatxt="$srcdir/errata.txt"
 host_key_document=
 page_size=
+ext_dir=
 
 usage() {
     cat <<-EOF
@@ -54,6 +55,8 @@ usage() {
 	    --page-size=PAGE_SIZE
 	                           Specify the page size (translation granule) (4k, 16k or
 	                           64k, default is 64k, arm64 only)
+	    --ext-dir=DIR	   specify an additional location with more tests; when enabled
+	                           DIR/Makefile is included to the build system (arm/arm64 only)
 EOF
     exit 1
 }
@@ -112,6 +115,9 @@ while [[ "$1" = -* ]]; do
 	--page-size)
 	    page_size="$arg"
 	    ;;
+	--ext-dir)
+	    ext_dir="$arg"
+	    ;;
 	--help)
 	    usage
 	    ;;
@@ -264,6 +270,7 @@ U32_LONG_FMT=$u32_long
 WA_DIVIDE=$wa_divide
 GENPROTIMG=${GENPROTIMG-genprotimg}
 HOST_KEY_DOCUMENT=$host_key_document
+EXT_DIR=$ext_dir
 EOF
 
 cat <<EOF > lib/config.h
diff --git a/arm/Makefile.common b/arm/Makefile.common
index 19db50d..ffe1a49 100644
--- a/arm/Makefile.common
+++ b/arm/Makefile.common
@@ -13,6 +13,10 @@ tests-common += $(TEST_DIR)/psci.flat
 tests-common += $(TEST_DIR)/sieve.flat
 tests-common += $(TEST_DIR)/pl031.flat
 
+ifdef EXT_DIR
+include $(EXT_DIR)/Makefile
+endif
+
 tests-all = $(tests-common) $(tests)
 all: directories $(tests-all)
 
-- 
2.25.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux