[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/16] meson: convert migration/initrd-stress
From: |
marcandre . lureau |
Subject: |
[PATCH 16/16] meson: convert migration/initrd-stress |
Date: |
Fri, 28 Aug 2020 15:07:34 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
tests/Makefile.include | 14 --------------
tests/meson.build | 1 +
tests/migration/initrd-stress.sh | 10 ++++++++++
tests/migration/meson.build | 14 ++++++++++++++
4 files changed, 25 insertions(+), 14 deletions(-)
create mode 100755 tests/migration/initrd-stress.sh
create mode 100644 tests/migration/meson.build
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 30d4c6f932..0d36bd11d4 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -38,20 +38,6 @@ export SRC_PATH
SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
$(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
-QEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest
-
-tests/migration/stress$(EXESUF): tests/migration/stress.o
- $(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $<
,"LINK","$(TARGET_DIR)$@")
-
-INITRD_WORK_DIR=tests/migration/initrd
-
-tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
- mkdir -p $(INITRD_WORK_DIR)
- cp $< $(INITRD_WORK_DIR)/init
- (cd $(INITRD_WORK_DIR) && (find | cpio --quiet -o -H newc | gzip -9)) >
$@
- rm $(INITRD_WORK_DIR)/init
- rmdir $(INITRD_WORK_DIR)
-
SPEED = quick
# gtester tests, possibly with verbose output
diff --git a/tests/meson.build b/tests/meson.build
index 4d6bcf06b3..257a474daa 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -268,3 +268,4 @@ endif
subdir('qapi-schema')
subdir('qtest')
+subdir('migration')
diff --git a/tests/migration/initrd-stress.sh b/tests/migration/initrd-stress.sh
new file mode 100755
index 0000000000..0f20ac29a6
--- /dev/null
+++ b/tests/migration/initrd-stress.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+INITRD="$1"
+STRESS="$2"
+
+INITRD_DIR=$(mktemp -d -p '' "initrd-stress.XXXXXX")
+trap 'rm -rf $INITRD_DIR' EXIT
+
+cp "$STRESS" "$INITRD_DIR/init"
+(cd "$INITRD_DIR" && (find | cpio --quiet -o -H newc | gzip -9)) > "$INITRD"
diff --git a/tests/migration/meson.build b/tests/migration/meson.build
new file mode 100644
index 0000000000..f215ee7d3a
--- /dev/null
+++ b/tests/migration/meson.build
@@ -0,0 +1,14 @@
+stress = executable(
+ 'stress',
+ files('stress.c'),
+ dependencies: [glib],
+ link_args: ['-static'],
+ build_by_default: false,
+)
+
+custom_target(
+ 'initrd-stress.img',
+ output: 'initrd-stress.img',
+ input: stress,
+ command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@']
+)
--
2.26.2
- [PATCH 06/16] meson: convert the unit tests, (continued)
- [PATCH 06/16] meson: convert the unit tests, marcandre . lureau, 2020/08/28
- [PATCH 07/16] meson: move keyutils dependency check, marcandre . lureau, 2020/08/28
- [PATCH 08/16] meson: remove old socket_scm_helper rule, marcandre . lureau, 2020/08/28
- [PATCH 09/16] meson: convert vhost-user-bridge, marcandre . lureau, 2020/08/28
- [PATCH 10/16] meson: convert atomic*-bench, marcandre . lureau, 2020/08/28
- [PATCH 11/16] tests/Makefile.include: update check-build, marcandre . lureau, 2020/08/28
- [PATCH 12/16] tests: do not print benchmark output to stdout, marcandre . lureau, 2020/08/28
- [PATCH 13/16] meson: convert the speed tests, marcandre . lureau, 2020/08/28
- [PATCH 14/16] tests/migration/stress: remove unused exit_success, marcandre . lureau, 2020/08/28
- [PATCH 15/16] meson: fix migration/stress compilation with glib>=2.30, marcandre . lureau, 2020/08/28
- [PATCH 16/16] meson: convert migration/initrd-stress,
marcandre . lureau <=
- Re: [PATCH 00/16] meson: convert unit tests in tests/Makefile.include, Thomas Huth, 2020/08/28