Signed-off-by: Pierrick Bouvier <[email protected]>
---
tests/tcg/x86_64/meson.build | 2 +
tests/tcg/x86_64/system/meson.build | 62 +++++++++++++++++++++++++++++
2 files changed, 64 insertions(+)
create mode 100644 tests/tcg/x86_64/system/meson.build
diff --git a/tests/tcg/x86_64/meson.build b/tests/tcg/x86_64/meson.build
index 9d655a466d4..928fc297232 100644
--- a/tests/tcg/x86_64/meson.build
+++ b/tests/tcg/x86_64/meson.build
@@ -2,6 +2,8 @@ cc = 'x86_64-linux-gnu-gcc'
cc_dockerfile = 'debian-amd64-cross'
cc_docker_host_arch = ['x86_64']
+subdir('system')
+
tests = []
tests += tcg_tests['multiarch-linux-user']['tests']
diff --git a/tests/tcg/x86_64/system/meson.build
b/tests/tcg/x86_64/system/meson.build
new file mode 100644
index 00000000000..c5348102e8f
--- /dev/null
+++ b/tests/tcg/x86_64/system/meson.build
@@ -0,0 +1,62 @@
+tests = []
+
+minilib_dir = meson.current_source_dir() / '..' / '..' / 'minilib'
+minilib_printf = files(minilib_dir / 'printf.c')[0]
+link_script = files('kernel.ld')[0]
+boot = files('boot.S')[0]
+cflags = ['-nostdlib',
+ '-Wa,--noexecstack',
+ '-I', minilib_dir, minilib_printf, boot,
+ '-Wl,-T', link_script,
+ '-Wl,-melf_x86_64',
+ '-Wl,--no-warn-rwx-segments',
+ '-Wl,--build-id=none',
+ '-lgcc']
+qemu_def_args = ['-display', 'none',
+ '-device', 'isa-debugcon,chardev=stdio',
+ '-chardev', 'stdio,id=stdio',
+ '-device', 'isa-debug-exit,iobase=0xf4,iosize=0x4',
+ '-kernel']
+
+# Multi arch tests
+multi_src = []
+foreach t: tcg_tests['multiarch-softmmu']['tests']
+ foreach src, setup: t
+ new_cflags = cflags
+ if fs.stem(src) == 'memory'
+ new_cflags += '-DCHECK_UNALIGNED=1'
+ endif
+ if src not in multi_src
+ setup += {'cflags': [new_cflags]}
+ multi_src += src
+ endif
+ tests += {src: setup + {'qemu_args': qemu_def_args}}
+ endforeach
+endforeach
+
+tests += {
+ 'patch-target.c': {
+ 'cflags': cflags,
+ 'qemu_args': qemu_def_args,
+ 'plugin_test': {
+ 'plugin': 'patch',
+ 'args': ['target=ffc0', 'patch=9090', 'use_hwaddr=true'],
+ },
+ 'wrapper': [prog_check_plugin_output,
+ find_program('./validate-patch.py')]
+ }
+}
+
+if 'qemu-system-x86_64' in emulators
+ tcg_tests += {
+ 'x86_64-softmmu': {
+ 'cc': cc,
+ 'cc_dockerfile': cc_dockerfile,
+ 'cc_docker_host_arch': cc_docker_host_arch,
+ 'folder': 'x86_64/system',
+ 'gdb_arch': 'x86_64',
+ 'qemu': emulators['qemu-system-x86_64'],
+ 'tests': tests,
+ }
+ }
+endif
--
2.47.3