From 8405dd0641f438b321ab5b361fcbd523feb911cf Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 9 Jan 2021 21:21:37 -0800 Subject: [PATCH] Add some support for logging the source line in ktest files --- testing/bin/ktest-to-cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testing/bin/ktest-to-cxx b/testing/bin/ktest-to-cxx index 2be7c12d..f9d76f1e 100644 --- a/testing/bin/ktest-to-cxx +++ b/testing/bin/ktest-to-cxx @@ -50,6 +50,8 @@ sub load_from_text { my ( $key, $content, $comment, $error, $type ); $line_num++; chomp $line; + my $raw_line = $line; + $raw_line =~ s/"/''/g; $line =~ s/^\s+//; $line =~ s/\s+$//; @@ -181,7 +183,8 @@ sub load_from_text { content => $content, comment => $comment, data => $data, - line_num => $line_num + line_num => $line_num, + raw_line => $raw_line }; } @@ -280,6 +283,8 @@ sub generate_script { $reports_expected = 0; for my $entry (@script_lines) { + #cxx("std::cerr << \"".$entry->{raw_line}."\" << std::endl;"); + if ( $entry->{comment} && ( !$entry->{action} ) ) { cxx_comment( $entry->{comment} ); }