meson.eclass: Set exe_wrapper

Currently no meson packages actually run any tests even if they have
them because we don't set a wrapper for running tests in the
sysroot. This causes meson to skip all the tests. Fix this by adding a
script to common-mk and passing it to the cross-file.

This also allows us to run meson unit tests for ARM boards.

Because this is modified from upstream it must be moved to
eclass-overlay

BUG=chromium:1227738
TEST=Ran tests on a bunch of meson packages, checked that they aren't
all skipped

Cq-Depend: 3054152, 3057340, 3058026, 3054230
Change-Id: I47c09876252ba56b2270c2251a2f60f0c132de95
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/eclass-overlay/+/3062147
Tested-by: Fergus Dall <sidereal@google.com>
Commit-Queue: Fergus Dall <sidereal@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index c9a5e0b..383c7bf 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -1,6 +1,8 @@
 # Copyright 2017-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# CROS: Modifications from upstream are marked like this
+
 # @ECLASS: meson.eclass
 # @MAINTAINER:
 # William Hubbs <williamh@gentoo.org>
@@ -180,6 +182,9 @@
 	strip = $(_meson_env_array "$(tc-getSTRIP)")
 	windres = $(_meson_env_array "$(tc-getRC)")
 
+	# CROS: set a wrapper script for running tests
+	exe_wrapper = ['/mnt/host/source/src/platform2/common-mk/meson_test.py']
+
 	[built-in options]
 	c_args = $(_meson_env_array "${CFLAGS} ${CPPFLAGS}")
 	c_link_args = $(_meson_env_array "${CFLAGS} ${LDFLAGS}")