aboutsummaryrefslogtreecommitdiff
path: root/test/aarch64
diff options
context:
space:
mode:
authorEvgeny Astigeevich <evgeny.astigeevich@linaro.org>2019-02-28 12:38:03 +0000
committerEvgeny Astigeevich <evgeny.astigeevich@linaro.org>2019-03-05 16:15:37 +0000
commite1ac18930c68b2c129caf2a83c58aa5fa50361f0 (patch)
tree61a0f77ae882e3747bc92b01cc3f2aa5e193caaa /test/aarch64
parent0bfb9be274d2f0830a67d3a0165452e9d568cfeb (diff)
downloadvixl-e1ac18930c68b2c129caf2a83c58aa5fa50361f0.tar.gz
In MaskAddresses sed is used to preprocess traces. In I575ae9db8d94cbec811d0029691df98373f8fe35 switching to use toybox sed instead of sed(1) for build tools was done. Command line options and regular expressions for GNU sed don't work for toybox sed causing test failures: 1. Toybox sed does not support '--in-place --regexp-extended'. 2. Toybox sed does not support hexadecimal expressions. The CL changes MaskAddresses to work with toybox sed: 1. Use '-i -E' instead of '--in-place --regexp-extended' because they have the same meaning. GNU sed also supports '-i -E' instead of '--in-place --regexp-extended'. 2. Use '.' instead of a hexadecimal expression '\x1b' because regular expressions have enough information for an exact match. As the CL makes some macros redundant the macros are removed. Test: mma test-art-host-vixl Change-Id: I03701adfe5c62ff98d88125ed6208dc162ab7668
Diffstat (limited to 'test/aarch64')
-rw-r--r--test/aarch64/test-trace-aarch64.cc13
1 files changed, 3 insertions, 10 deletions
diff --git a/test/aarch64/test-trace-aarch64.cc b/test/aarch64/test-trace-aarch64.cc
index eac16c6b..e061e0cf 100644
--- a/test/aarch64/test-trace-aarch64.cc
+++ b/test/aarch64/test-trace-aarch64.cc
@@ -2739,21 +2739,14 @@ static void GenerateTestSequenceNEONFP(MacroAssembler* masm) {
static void MaskAddresses(const char* trace) {
-// Hexadecimal expressions of the form `\xab` do not work out-of-the box with
-// BSD `sed`. So we use ANSI-C quoting to have the regular expressions below
-// work both on Linux and BSD (and macOS).
#ifdef __APPLE__
-#define MAYBE_ANSI_C_QUOTE "$"
-#define HEX(val) "\\x" #val
#define ESCAPE(c) "\\\\" #c
const char* sed_options = "-i \"\" -E";
#else
-#define MAYBE_ANSI_C_QUOTE
-#define HEX(val) "\\x" #val
#define ESCAPE(c) "\\" #c
- const char* sed_options = "--in-place --regexp-extended";
+ const char* sed_options = "-i -E";
#endif
-#define COLOUR "(" HEX(1b) ESCAPE([) "[01];([0-9][0-9])?m)?"
+#define COLOUR "(." ESCAPE([) "[01];([0-9][0-9])?m)?"
struct {
const char* search;
const char* replace;
@@ -2775,7 +2768,7 @@ static void MaskAddresses(const char* trace) {
for (size_t i = 0; i < patterns_length; i++) {
size_t length = snprintf(command,
sizeof(command),
- "sed %s " MAYBE_ANSI_C_QUOTE "'s/%s/%s/' '%s'",
+ "sed %s 's/%s/%s/' '%s'",
sed_options,
patterns[i].search,
patterns[i].replace,