aboutsummaryrefslogtreecommitdiff
path: root/libcpp/files.cc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2024-11-26 16:09:37 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2024-11-26 16:09:37 -0500
commit746629e22888b376f95c45779db40bfbfe2ab282 (patch)
tree00477d1ff73de43344f30b1cee8dd4369ebe2956 /libcpp/files.cc
parentb4d4e22a6232999e1a8bc11db9641fb71d118c0b (diff)
downloadgcc-746629e22888b376f95c45779db40bfbfe2ab282.zip
gcc-746629e22888b376f95c45779db40bfbfe2ab282.tar.gz
gcc-746629e22888b376f95c45779db40bfbfe2ab282.tar.bz2
selftest: invoke "diff" when ASSERT_STREQ fails
Currently when ASSERT_STREQ or ASSERT_STREQ_AT fail we print both strings to stderr. However it can be hard to figure out the problem (e.g. for 1-character differences in long strings). Extend the output by writing out the strings to tempfiles and invoking "diff -up" on them when we have such a selftest failure, to (I hope) simplify debugging. gcc/ChangeLog: * selftest.cc (selftest::print_diff): New function. (selftest::assert_streq): Call it when we have non-equal non-null strings. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'libcpp/files.cc')
0 files changed, 0 insertions, 0 deletions