From: Warner Losh <imp@bsdimp.com>
To: qemu-devel@nongnu.org
Cc: arrowd@freebsd.org, kevans@freebsd.org,
richard.henderson@linaro.org, f4bug@amsat.org, def@freebsd.org,
Warner Losh <imp@bsdimp.com>
Subject: [PATCH for 7.0 5/5] bsd-user-smoke: Add to build
Date: Sat, 27 Nov 2021 13:18:46 -0700 [thread overview]
Message-ID: <20211127201846.64187-6-imp@bsdimp.com> (raw)
In-Reply-To: <20211127201846.64187-1-imp@bsdimp.com>
Add a simple bsd-user smoke test for ensuring bsd-user is minimally
functional. This runs only when bsd-user has been configured. It adds a
simple execution of 'hello world' type binaries for bsd-user. At the
present these are tiny, hand-crafted binaries that are statically linked
and do not depend on any host libraries being present (they also take
advantage of the fact that on FreeBSD all system call numbers are
uniform on all architectures). This was done both for building and
testing simplicity, as well as recognizing the current state of bsd-user
in qemu upstream is extremely basic.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
tests/bsd-user-smoke/meson.build | 31 +++++++++++++++++++++++++++++++
tests/meson.build | 1 +
2 files changed, 32 insertions(+)
create mode 100644 tests/bsd-user-smoke/meson.build
diff --git a/tests/bsd-user-smoke/meson.build b/tests/bsd-user-smoke/meson.build
new file mode 100644
index 00000000000..586697ab3b6
--- /dev/null
+++ b/tests/bsd-user-smoke/meson.build
@@ -0,0 +1,31 @@
+if not have_bsd_user
+ subdir_done()
+endif
+
+smoke_bsd_user = find_program('smoke-bsd-user')
+
+bsd_user_archs = [ 'armv7', 'amd64', 'i386' ]
+targs = []
+foreach i : bsd_user_archs
+ h = 'h.' + i
+ targs += custom_target('bsd-user h.' + i,
+ output : h,
+ input : h + '.S',
+ command : ['clang',
+ '-target',
+ i + '-unknown-freebsd14.0',
+ '-o',
+ '@OUTPUT@',
+ '@INPUT@',
+ '-nostdlib',
+ '-Wl,-e',
+ '-Wl,qemu_start',
+ '-static'],
+ install : false)
+endforeach
+
+test('bsd-user-smoke', smoke_bsd_user,
+ args: [meson.project_build_root(), meson.current_build_dir()],
+ suite: 'smoke',
+ depends: targs
+)
diff --git a/tests/meson.build b/tests/meson.build
index 3f3882748ae..3b95efe8896 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,6 +1,7 @@
py3 = import('python').find_installation()
subdir('bench')
+subdir('bsd-user-smoke')
test_qapi_outputs = [
'qapi-builtin-types.c',
--
2.33.0
next prev parent reply other threads:[~2021-11-27 20:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-27 20:18 [PATCH for 7.0 0/5] bsd-user-smoke: A simple smoke test for bsd-user Warner Losh
2021-11-27 20:18 ` [PATCH for 7.0 1/5] h.armv7: Simple hello-world test for armv7 Warner Losh
2021-11-27 20:18 ` [PATCH for 7.0 2/5] h.i386: Simple hello-world test for i386 Warner Losh
2021-11-27 20:18 ` [PATCH for 7.0 3/5] h.amd64: Simple hello-world test for x86_64 Warner Losh
2021-11-27 20:18 ` [PATCH for 7.0 4/5] smoke-bsd-user: A test script to run all the FreeBSD binaries Warner Losh
2021-11-27 20:18 ` Warner Losh [this message]
2022-01-04 23:25 ` [PATCH for 7.0 5/5] bsd-user-smoke: Add to build Philippe Mathieu-Daudé
2022-01-04 23:28 ` Warner Losh
2021-12-03 23:46 ` [PATCH for 7.0 0/5] bsd-user-smoke: A simple smoke test for bsd-user Warner Losh
2022-01-04 17:20 ` Alex Bennée
2022-01-04 17:39 ` Warner Losh
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=20211127201846.64187-6-imp@bsdimp.com \
--to=imp@bsdimp.com \
--cc=arrowd@freebsd.org \
--cc=def@freebsd.org \
--cc=f4bug@amsat.org \
--cc=kevans@freebsd.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).