Otherwise bt_diff() returns 0 (happy) with a nonexistent file.
This change reveals that `tests/plugins/src.ctf.fs/field/test-field.sh`
passes, but for the wrong reason: run_python() doesn't exist (I replaced
it with bt_run_in_py_env() a while ago), therefore that line doesn't
create any expectation file and bt_diff() returns 0. Change it to
use bt_run_in_py_env().
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I259123f5c0946ece7f58e4ef185313bf26354b46
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12534
Tested-by: jenkins <jenkins@lttng.org>
local -r mp_path=$1
local -r output_dir=$(mktemp -d)
local -r mp_path=$1
local -r output_dir=$(mktemp -d)
- run_python "$BT_TESTS_PYTHON_BIN" "$data_dir/data_from_mp.py" "$mp_path" "$output_dir"
+ bt_run_in_py_env "$BT_TESTS_PYTHON_BIN" "$data_dir/data_from_mp.py" "$mp_path" "$output_dir"
local -r res_path=$(mktemp)
local -r res_path=$(mktemp)
local -r expected_file=$1
local -r actual_file=$2
local -r expected_file=$1
local -r actual_file=$2
+ if [[ ! -e $expected_file ]]; then
+ echo "ERROR: expected file \`$expected_file\` doesn't exist" >&2
+ return 1
+ fi
+
+ if [[ ! -e $actual_file ]]; then
+ echo "ERROR: actual file \`$actual_file\` doesn't exist" >&2
+ return 1
+ fi
+
diff -u <(bt_remove_cr_inline "$expected_file") <(bt_remove_cr_inline "$actual_file") 1>&2
}
diff -u <(bt_remove_cr_inline "$expected_file") <(bt_remove_cr_inline "$actual_file") 1>&2
}