]> xenbits.xensource.com Git - xtf.git/commitdiff
Install each test into a separate directory
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 22 Feb 2016 12:43:49 +0000 (12:43 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 22 Feb 2016 13:41:56 +0000 (13:41 +0000)
This allows for better delineation of tests and their resources.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
build/common.mk
build/gen.mk
config/default-hvm.cfg.in
config/default-pv.cfg.in
docs/mainpage.dox

index f8bf1400ac254dbbfb6ca619a60488edd48d8572..6971cd1a684c04c700ef2c94f8eeb0d9ffccddcb 100644 (file)
@@ -1,5 +1,5 @@
 ROOT := $(abspath $(CURDIR)/../..)
-DESTDIR ?= $(ROOT)/dist/
+DESTDIR ?= $(ROOT)/dist
 PREFIX ?= $(ROOT)
 CC = gcc
 
index a408d65c3118e5f298d602c863b32ad3bdc97372..5d8170cf9345edc3681bb621dbb66fb68d240f5e 100644 (file)
@@ -35,23 +35,24 @@ endif
 
 cfg-$(1) ?= $(defcfg-$(1))
 
-test-$(1)-$(NAME).cfg: $$(cfg-$(1))
-       sed -e "s/@@NAME@@/$$(NAME)/g" \
+test-$(1)-$(NAME).cfg: $$(cfg-$(1)) FORCE
+       @sed -e "s/@@NAME@@/$$(NAME)/g" \
                -e "s/@@ENV@@/$(1)/g" \
                -e "s!@@PREFIX@@!$$(PREFIX)!g" \
-               < $$< > $$@
+               < $$< > $$@.tmp
+       @if ! cmp -s $$@ $$@.tmp; then mv -f $$@.tmp $$@; else rm -f $$@.tmp; fi
 
 -include $$(link-$(1):%.lds=%.d)
 -include $$(DEPS-$(1):%.o=%.d)
 
 .PHONY: install-$(1) install-$(1).cfg
 install-$(1): test-$(1)-$(NAME)
-       @mkdir -p $(DESTDIR)
-       install -m775 -p $$< $(DESTDIR)
+       @mkdir -p $(DESTDIR)/tests/$(NAME)
+       install -m775 -p $$< $(DESTDIR)/tests/$(NAME)
 
 install-$(1).cfg: test-$(1)-$(NAME).cfg
-       @mkdir -p $(DESTDIR)
-       install -m664 -p $$< $(DESTDIR)
+       @mkdir -p $(DESTDIR)/tests/$(NAME)
+       install -m664 -p $$< $(DESTDIR)/tests/$(NAME)
 
 install-each-env: install-$(1) install-$(1).cfg
 
@@ -66,3 +67,6 @@ clean:
 .PHONY: %var
 %var:
        @echo "$* = $($*)"
+
+.PHONY: FORCE
+FORCE:
index 948d2e2b28574a73c9f3ec4850567dcd86f97609..2a395a5535fd3e5506c6c2dfd3bd048248849600 100644 (file)
@@ -1,7 +1,7 @@
 name="test-@@ENV@@-@@NAME@@"
 builder="hvm"
 memory=128
-firmware_override="@@PREFIX@@/test-@@ENV@@-@@NAME@@"
+firmware_override="@@PREFIX@@/tests/@@NAME@@/test-@@ENV@@-@@NAME@@"
 
 # The framework doesn't reboot.  A reboot signal is almost certainly a triple
 # fault instead.  Prevent it turning into a runaway domain.
index 6827d188a6f5002ca0345c455f532e179b76ed79..044e50ecad8269738dc30aab8351c79d24a10cf8 100644 (file)
@@ -1,4 +1,4 @@
 name="test-@@ENV@@-@@NAME@@"
 loader="generic"
 memory=128
-kernel="@@PREFIX@@/test-@@ENV@@-@@NAME@@"
+kernel="@@PREFIX@@/tests/@@NAME@@/test-@@ENV@@-@@NAME@@"
index bb80749ff87e0f4b807f358e24799232766f3fe9..ddc8995152abb747aa1163ea9496c74e7283430e 100644 (file)
@@ -44,8 +44,7 @@ To obtain and build:
 
 To run tests on a Xen host: (see @ref errata first)
 
-    # cd tests/example
-    # xl create test-pv64-example.cfg
+    # xl create tests/example/test-pv64-example.cfg
     # cat /var/log/xen/console/guest-test-pv64-example.log
     --- Xen Test Framework ---
     Environment: PV 64bit (Long mode 4 levels)
@@ -60,13 +59,12 @@ To run tests on a Xen host: (see @ref errata first)
   there is not clean separation between the paging settings of Xen and the
   guest.
 
-- For kernel paths, `xl` accepts either an absolute path, a path relative to
-  `/etc/xen/` or relative to `$CWD`.  The `kernel=` path for a PV guest
-  typically needs turning into an absolute path on the test system.
-
-- For firmware override, `xl` accepts either an absolute path, or a path
-  relative to `$libdir/xen/boot`.  The `firmware_override=` path for an HVM
-  test typically needs turning into an absolute path on the test system.
+- For the paths of binaries, `xl` accepts either an absolute path, or certain
+  relative paths (`/etc/xen/` or `$CWD` for `kernel=`, `$libdir/xen/boot` for
+  `firmware_override=`).  The default `PREFIX=` is configured correctly for
+  running the tests out of the build working tree.  If the tests are running
+  elsewhere, use `make install DESTDIR=$X PREFIX=$Y` to configure absolute
+  paths appropriately for the test system.
 
 
 @section further Further Information