tests: make `bt_diff()` able to write expected files
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 3 Oct 2024 01:56:50 +0000 (21:56 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 9 Oct 2024 02:56:57 +0000 (22:56 -0400)
commit65d80ff71e685213c40db5e5e5b8327915a4c5ca
treec296ac7096ae8eadac5c81f972b019f04a46913e
parentbd15267952abb83a0292be56efce8e7b7916e645
tests: make `bt_diff()` able to write expected files

Make `bt_diff()` copy the "actual" file over to the "expected" file, if:

 - the comparison between "actual" and "expected" failed
 - the "expected" file is a regular file
 - the `BT_TESTS_DIFF_WRITE_EXPECTED` env var is set and not `0`

This makes it much easier to update `.expect` files than doing it by
hand.

Change-Id: Ia55b55035591d521c627b1022d6dcbde9ed541a7
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/13313
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/utils/utils.sh
This page took 0.024265 seconds and 4 git commands to generate.