This allows for better delineation of tests and their resources.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
ROOT := $(abspath $(CURDIR)/../..)
-DESTDIR ?= $(ROOT)/dist/
+DESTDIR ?= $(ROOT)/dist
PREFIX ?= $(ROOT)
CC = gcc
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
.PHONY: %var
%var:
@echo "$* = $($*)"
+
+.PHONY: FORCE
+FORCE:
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.
name="test-@@ENV@@-@@NAME@@"
loader="generic"
memory=128
-kernel="@@PREFIX@@/test-@@ENV@@-@@NAME@@"
+kernel="@@PREFIX@@/tests/@@NAME@@/test-@@ENV@@-@@NAME@@"
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)
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