aboutsummaryrefslogtreecommitdiff
path: root/gcc/json.cc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-10-29 13:00:54 +0100
committerMartin Liska <marxin@gcc.gnu.org>2018-10-29 12:00:54 +0000
commitc8fda30f0cc084626af70dea607fc081f67d95f1 (patch)
tree0712a4f4a8835243bcd37abe2d4cdd6c0470e151 /gcc/json.cc
parentd4eb0305b8581368fb5f9ed88dd501e13d1cdd3e (diff)
downloadgcc-c8fda30f0cc084626af70dea607fc081f67d95f1.zip
gcc-c8fda30f0cc084626af70dea607fc081f67d95f1.tar.gz
gcc-c8fda30f0cc084626af70dea607fc081f67d95f1.tar.bz2
GCOV: introduce --json-format.
2018-10-29 Martin Liska <mliska@suse.cz> * Makefile.in: Make dependency to json.o. * doc/gcov.texi: Document new JSON format, remove old intermediate format documentation. * gcov.c (struct function_info): Come up with m_name and m_demangled_name. (function_info::function_info): Initialize it. (function_info::~function_info): Release it. (main): Rename flag_intermediate_format to flag_json_format. (print_usage): Describe --json-format. (process_args): Set flag_json_format. (output_intermediate_line): Remove. (output_intermediate_json_line): Likewise. (get_gcov_intermediate_filename): Return new extension ".gcov.json.gz". (output_intermediate_file): Implement JSON emission. (output_json_intermediate_file): Implement JSON emission. (generate_results): Use ::get_name for function name. Handle JSON output file. (read_graph_file): Use ::get_name instead of cplus_demangle. (read_count_file): Likewise. (solve_flow_graph): Likewise. (add_line_counts): Likewise. (accumulate_line_counts): Use new flag_json_format. (output_function_details): Use ::get_name instead of cplus_demangle. (output_lines): Likewise. * json.cc (test_writing_literals): Add new tests. * json.h (class literal): Add new boolean constructor. 2018-10-29 Martin Liska <mliska@suse.cz> * g++.dg/gcov/gcov-8.C: Do not check intermediate format. * lib/gcov.exp: Remove legacy verify-intermediate. From-SVN: r265587
Diffstat (limited to 'gcc/json.cc')
-rw-r--r--gcc/json.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/json.cc b/gcc/json.cc
index 3ead980..a0c43956 100644
--- a/gcc/json.cc
+++ b/gcc/json.cc
@@ -296,6 +296,9 @@ test_writing_literals ()
assert_print_eq (literal (JSON_TRUE), "true");
assert_print_eq (literal (JSON_FALSE), "false");
assert_print_eq (literal (JSON_NULL), "null");
+
+ assert_print_eq (literal (true), "true");
+ assert_print_eq (literal (false), "false");
}
/* Run all of the selftests within this file. */