tests: add and use bt_grep
[babeltrace.git] / tests / utils / utils.sh
index e2b730923685828301a158ecbba35a19e3fc1402..24f1b2d26b6c9af59655bf303c4f5e324935d476 100644 (file)
@@ -297,6 +297,10 @@ bt_diff_details_ctf_gen_single() {
        return $ret
 }
 
+# Run the grep binary configured for the tests.
+bt_grep() {
+       "$BT_TESTS_GREP_BIN" "$@"
+}
 
 ### Functions ###
 
@@ -358,7 +362,7 @@ run_python_bt2() {
        # existing ASAN_OPTIONS, such that we override the user's value if it
        # contains detect_leaks=1.
        if [ "${BT_TESTS_ENABLE_ASAN:-}" = "1" ]; then
-               if ${BT_TESTS_CC_BIN} --version | head -n 1 | grep -q '^gcc'; then
+               if ${BT_TESTS_CC_BIN} --version | head -n 1 | bt_grep -q '^gcc'; then
                        lib_asan="$(${BT_TESTS_CC_BIN} -print-file-name=libasan.so)"
                        local -x LD_PRELOAD="${lib_asan}${LD_PRELOAD:+:}${LD_PRELOAD:-}"
                fi
This page took 0.024692 seconds and 4 git commands to generate.