OSDN Git Service

tests: Move benchmarks into a separate folder
authorThomas Huth <thuth@redhat.com>
Fri, 12 Mar 2021 09:22:38 +0000 (10:22 +0100)
committerThomas Huth <thuth@redhat.com>
Fri, 12 Mar 2021 14:46:30 +0000 (15:46 +0100)
Make it clear that these files are related to benchmarks by moving
them into a new folder called "bench".

Message-Id: <20210312092238.79509-1-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
MAINTAINERS
tests/bench/atomic64-bench.c [moved from tests/atomic64-bench.c with 100% similarity]
tests/bench/atomic_add-bench.c [moved from tests/atomic_add-bench.c with 100% similarity]
tests/bench/benchmark-crypto-cipher.c [moved from tests/benchmark-crypto-cipher.c with 100% similarity]
tests/bench/benchmark-crypto-hash.c [moved from tests/benchmark-crypto-hash.c with 100% similarity]
tests/bench/benchmark-crypto-hmac.c [moved from tests/benchmark-crypto-hmac.c with 100% similarity]
tests/bench/meson.build [new file with mode: 0644]
tests/bench/qht-bench.c [moved from tests/qht-bench.c with 100% similarity]
tests/meson.build

index e6c43c6..9a68f09 100644 (file)
@@ -2722,7 +2722,7 @@ F: crypto/
 F: include/crypto/
 F: qapi/crypto.json
 F: tests/unit/test-crypto-*
-F: tests/benchmark-crypto-*
+F: tests/bench/benchmark-crypto-*
 F: tests/unit/crypto-tls-*
 F: tests/unit/pkix_asn1_tab.c
 F: qemu.sasl
diff --git a/tests/bench/meson.build b/tests/bench/meson.build
new file mode 100644 (file)
index 0000000..00b3c20
--- /dev/null
@@ -0,0 +1,34 @@
+
+qht_bench = executable('qht-bench',
+                       sources: 'qht-bench.c',
+                       dependencies: [qemuutil])
+
+executable('atomic_add-bench',
+           sources: files('atomic_add-bench.c'),
+           dependencies: [qemuutil],
+           build_by_default: false)
+
+executable('atomic64-bench',
+           sources: files('atomic64-bench.c'),
+           dependencies: [qemuutil],
+           build_by_default: false)
+
+benchs = {}
+
+if have_block
+  benchs += {
+     'benchmark-crypto-hash': [crypto],
+     'benchmark-crypto-hmac': [crypto],
+     'benchmark-crypto-cipher': [crypto],
+  }
+endif
+
+foreach bench_name, deps: benchs
+  exe = executable(bench_name, bench_name + '.c',
+                   dependencies: [qemuutil] + deps)
+  benchmark(bench_name, exe,
+            args: ['--tap', '-k'],
+            protocol: 'tap',
+            timeout: 0,
+            suite: ['speed'])
+endforeach
similarity index 100%
rename from tests/qht-bench.c
rename to tests/bench/qht-bench.c
index af43fd1..55a7b08 100644 (file)
@@ -1,18 +1,6 @@
 py3 = import('python').find_installation()
 
-qht_bench = executable('qht-bench',
-                       sources: 'qht-bench.c',
-                       dependencies: [qemuutil])
-
-executable('atomic_add-bench',
-           sources: files('atomic_add-bench.c'),
-           dependencies: [qemuutil],
-           build_by_default: false)
-
-executable('atomic64-bench',
-           sources: files('atomic64-bench.c'),
-           dependencies: [qemuutil],
-           build_by_default: false)
+subdir('bench')
 
 test_qapi_outputs = [
   'qapi-builtin-types.c',
@@ -73,26 +61,6 @@ test_deps = {
   'test-qht-par': qht_bench,
 }
 
-benchs = {}
-
-if have_block
-  benchs += {
-     'benchmark-crypto-hash': [crypto],
-     'benchmark-crypto-hmac': [crypto],
-     'benchmark-crypto-cipher': [crypto],
-  }
-endif
-
-foreach bench_name, deps: benchs
-  exe = executable(bench_name, bench_name + '.c',
-                   dependencies: [qemuutil] + deps)
-  benchmark(bench_name, exe,
-            args: ['--tap', '-k'],
-            protocol: 'tap',
-            timeout: 0,
-            suite: ['speed'])
-endforeach
-
 if have_tools and 'CONFIG_VHOST_USER' in config_host and 'CONFIG_LINUX' in config_host
   executable('vhost-user-bridge',
              sources: files('vhost-user-bridge.c'),