Support memory alignment tests for string_benchmark.cpp
Test: Manually verify that benchmark times are similar and add a unit test.
Change-Id: Idaaeb4c8c3629f797ffd8d0c86c8d7b7b9653181
diff --git a/benchmarks/Android.bp b/benchmarks/Android.bp
index 3f95aa1..0edba65 100644
--- a/benchmarks/Android.bp
+++ b/benchmarks/Android.bp
@@ -35,6 +35,17 @@
"time_benchmark.cpp",
"unistd_benchmark.cpp",
],
+ static_libs: ["libBionicBenchmarksUtils"],
+}
+
+cc_defaults {
+ name: "bionic-benchmarks-extras-defaults",
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ "-Wunused",
+ ],
}
// Build benchmarks for the device (with bionic's .so). Run with:
@@ -63,3 +74,19 @@
},
},
}
+
+cc_library_static {
+ name: "libBionicBenchmarksUtils",
+ defaults: ["bionic-benchmarks-extras-defaults"],
+ srcs: ["util.cpp"],
+ host_supported: true,
+}
+
+cc_test {
+ name: "bionic-benchmarks-tests",
+ defaults: ["bionic-benchmarks-extras-defaults"],
+ srcs: [
+ "tests/benchmark_test.cpp",
+ ],
+ static_libs: ["libBionicBenchmarksUtils"],
+}