All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edwin Török" <edwin.torok@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: "Edwin Török" <edwin.torok@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Stewart Hildebrand" <stewart.hildebrand@amd.com>
Subject: [PATCH 0/7] Factor out common build rules and helpers in tools/tests
Date: Mon, 23 Feb 2026 10:14:04 +0000	[thread overview]
Message-ID: <cover.1771840831.git.edwin.torok@citrix.com> (raw)

There are a lot of duplicate rules and code in tools/tests.
To simplify writing new tests move common build rules into a
`tools/tests/Rules.mk`, and helper macros/functions into `common/{tests,guests}.{c,h}`.

This also ensures that CFLAGS are applied consistently across all tests (e.g. one test failed
to build now due to an unused variable error).

Guest creation also needs to test for the presence of PV, HVM HAP or HVM shadow support
in Xen and create a guest accordingly. This can be shared.

After these changes the per-test Makefile only contains entries specific
to the test (its name, dependencies, etc.) and avoids having to
copy&paste boilerplate code.

`tools/tests/x86_emulator` remains unchanged, because the Makefile
contains a lot of conditional build logic specific to that test.

An upcoming patch series will introduce new tests using the simplified
Makefile and shared helpers.

For convenience this is also available at:
https://gitlab.com/xen-project/people/edwintorok/xen/-/compare/staging...private%2Fedvint%2Fmigration-tests2?from_project_id=2336572
https://gitlab.com/xen-project/people/edwintorok/xen/-/pipelines/2342318716

Edwin Török (7):
  tools/tests/*/Makefile: factor out common PHONY rules into Rules.mk
  tools/tests/vpci/main.c: drop unused variables
  tools/tests/*/Makefile: factor out build rules
  tools/tests: factor out common helpers
  tools/tests/common: ensure error messages have a newline
  tools/tests/tsx: move guest creation to common area
  tools/tests: print more debug info

 tools/tests/Rules.mk                          | 60 +++++++++++++
 tools/tests/common/guests.c                   | 89 +++++++++++++++++++
 tools/tests/common/guests.h                   | 11 +++
 tools/tests/common/tests.c                    | 15 ++++
 tools/tests/common/tests.h                    | 18 ++++
 tools/tests/cpu-policy/Makefile               | 41 ++-------
 tools/tests/cpu-policy/test-cpu-policy.c      |  7 +-
 tools/tests/domid/Makefile                    | 37 ++------
 tools/tests/domid/test-domid.c                | 11 +--
 tools/tests/mem-claim/Makefile                | 31 +------
 tools/tests/mem-claim/test-mem-claim.c        |  9 +-
 tools/tests/paging-mempool/Makefile           | 31 +------
 .../paging-mempool/test-paging-mempool.c      |  9 +-
 tools/tests/pdx/Makefile                      | 37 +-------
 tools/tests/pdx/test-pdx.c                    |  3 +-
 tools/tests/rangeset/Makefile                 | 36 +-------
 tools/tests/rangeset/test-rangeset.c          |  3 +-
 tools/tests/resource/Makefile                 | 35 +-------
 tools/tests/resource/test-resource.c          |  9 +-
 tools/tests/tsx/Makefile                      | 35 +-------
 tools/tests/tsx/test-tsx.c                    | 88 +++---------------
 tools/tests/vpci/.gitignore                   |  1 +
 tools/tests/vpci/Makefile                     | 36 ++------
 tools/tests/vpci/main.c                       |  6 +-
 tools/tests/xenstore/Makefile                 | 37 +-------
 tools/tests/xenstore/test-xenstore.c          |  4 +-
 26 files changed, 261 insertions(+), 438 deletions(-)
 create mode 100644 tools/tests/Rules.mk
 create mode 100644 tools/tests/common/guests.c
 create mode 100644 tools/tests/common/guests.h
 create mode 100644 tools/tests/common/tests.c
 create mode 100644 tools/tests/common/tests.h
 create mode 100644 tools/tests/vpci/.gitignore

-- 
2.47.3



             reply	other threads:[~2026-02-23 10:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 10:14 Edwin Török [this message]
2026-02-23 10:14 ` [PATCH 1/7] tools/tests/*/Makefile: factor out common PHONY rules into Rules.mk Edwin Török
2026-02-23 16:37   ` Jan Beulich
2026-02-24  9:38     ` Edwin Torok
2026-02-24  9:42       ` Jan Beulich
2026-02-24 10:01         ` Edwin Torok
2026-02-24 10:30           ` Jan Beulich
2026-02-23 10:14 ` [PATCH 2/7] tools/tests/vpci/main.c: drop unused variables Edwin Török
2026-02-24 14:44   ` Roger Pau Monné
2026-02-23 10:14 ` [PATCH 3/7] tools/tests/*/Makefile: factor out build rules Edwin Török
2026-02-24 11:15   ` Jan Beulich
2026-02-23 10:14 ` [PATCH 4/7] tools/tests: factor out common helpers Edwin Török
2026-02-24 11:27   ` Jan Beulich
2026-02-23 10:14 ` [PATCH 5/7] tools/tests/common: ensure error messages have a newline Edwin Török
2026-02-24 11:36   ` Jan Beulich
2026-02-23 10:14 ` [PATCH 6/7] tools/tests/tsx: move guest creation to common area Edwin Török
2026-02-24 11:49   ` Jan Beulich
2026-02-23 10:14 ` [PATCH 7/7] tools/tests: print more debug info Edwin Török
2026-02-23 10:42 ` [PATCH 0/7] Factor out common build rules and helpers in tools/tests Jan Beulich
2026-02-27 18:00   ` Edwin Torok
2026-03-31 20:12     ` Edwin Torok

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=cover.1771840831.git.edwin.torok@citrix.com \
    --to=edwin.torok@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=stewart.hildebrand@amd.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.