tests: remove carriage return when using diff
[babeltrace.git] / tests / utils / diff.sh.in
index 57f88e1847832ca400f8da67363d9d6cb6d62647..7a38c7a4297cc98b2adb29db5f3836f876f9f97f 100644 (file)
@@ -32,8 +32,10 @@ bt_diff_cli() {
        temp_output_file="$(mktemp)"
        temp_diff="$(mktemp)"
 
-       # Run the CLI to get a detailed file
-       echo "$args" | xargs "$BT_BIN" 2>/dev/null >"$temp_output_file"
+       # Run the CLI to get a detailed file. Strip any \r present due to
+       # Windows (\n -> \r\n). "diff --string-trailing-cr" is not used since it
+       # is not present on Solaris.
+       echo "$args" | xargs "$BT_BIN" 2>/dev/null | tr -d "\r" > "$temp_output_file"
 
        # Compare output with expected output
        if ! diff "$temp_output_file" "$expected_file" 2>/dev/null >"$temp_diff"; then
This page took 0.025194 seconds and 4 git commands to generate.