Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
9ab45e6b
Commit
9ab45e6b
authored
6 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[wp] differenciate report-in and report-out for json
parent
8d5abffb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/wp/register.ml
+14
-5
14 additions, 5 deletions
src/plugins/wp/register.ml
src/plugins/wp/wpReport.ml
+14
-5
14 additions, 5 deletions
src/plugins/wp/wpReport.ml
src/plugins/wp/wpReport.mli
+1
-1
1 addition, 1 deletion
src/plugins/wp/wpReport.mli
with
29 additions
and
11 deletions
src/plugins/wp/register.ml
+
14
−
5
View file @
9ab45e6b
...
@@ -139,13 +139,22 @@ let do_wp_print_for goals =
...
@@ -139,13 +139,22 @@ let do_wp_print_for goals =
let
do_wp_report
()
=
let
do_wp_report
()
=
begin
begin
let
rfiles
=
Wp_parameters
.
Report
.
get
()
in
let
reports
=
Wp_parameters
.
Report
.
get
()
in
if
rfiles
<>
[]
then
let
jreport
=
Wp_parameters
.
ReportJson
.
get
()
in
if
reports
<>
[]
||
jreport
<>
""
then
begin
begin
let
stats
=
WpReport
.
fcstat
()
in
let
stats
=
WpReport
.
fcstat
()
in
let
jfile
=
Wp_parameters
.
ReportJson
.
get
()
in
begin
if
jfile
<>
""
then
WpReport
.
export_json
stats
jfile
;
match
Transitioning
.
String
.
split_on_char
'
:
'
jreport
with
List
.
iter
(
WpReport
.
export
stats
)
rfiles
;
|
[]
|
[
""
]
->
()
|
[
joutput
]
->
WpReport
.
export_json
stats
~
joutput
()
;
|
[
jinput
;
joutput
]
->
WpReport
.
export_json
stats
~
jinput
~
joutput
()
;
|
_
->
Wp_parameters
.
error
"Invalid format for option -wp-report-json"
end
;
List
.
iter
(
WpReport
.
export
stats
)
reports
;
end
;
end
;
if
Wp_parameters
.
MemoryContext
.
get
()
then
if
Wp_parameters
.
MemoryContext
.
get
()
then
wp_warn_memory_context
()
wp_warn_memory_context
()
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/wpReport.ml
+
14
−
5
View file @
9ab45e6b
...
@@ -864,20 +864,29 @@ let export gstat specfile =
...
@@ -864,20 +864,29 @@ let export gstat specfile =
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
let
export_json
gstat
jfile
=
let
export_json
gstat
?
jinput
~
joutput
()
=
begin
begin
Wp_parameters
.
feedback
"Report '%s'"
jfile
;
let
js
=
let
js
=
try
try
if
Sys
.
file_exists
jfile
let
jfile
=
match
jinput
with
then
Json
.
load_file
jfile
else
`Null
|
None
->
Wp_parameters
.
feedback
"Report '%s'"
joutput
;
joutput
|
Some
jinput
->
Wp_parameters
.
feedback
"Report in: '%s'"
jinput
;
Wp_parameters
.
feedback
"Report out: '%s'"
joutput
;
jinput
in
if
Sys
.
file_exists
jfile
then
Json
.
load_file
jfile
else
`Null
with
Json
.
Error
(
file
,
line
,
msg
)
->
with
Json
.
Error
(
file
,
line
,
msg
)
->
let
source
=
Log
.
source
~
file
~
line
in
let
source
=
Log
.
source
~
file
~
line
in
Wp_parameters
.
error
~
source
"Incorrect json file: %s"
msg
;
Wp_parameters
.
error
~
source
"Incorrect json file: %s"
msg
;
`Null
`Null
in
in
rankify_fcstat
gstat
js
;
rankify_fcstat
gstat
js
;
Json
.
save_file
j
file
(
json_of_fcstat
gstat
)
;
Json
.
save_file
j
output
(
json_of_fcstat
gstat
)
;
end
end
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/wpReport.mli
+
1
−
1
View file @
9ab45e6b
...
@@ -47,4 +47,4 @@ type fcstat
...
@@ -47,4 +47,4 @@ type fcstat
val
fcstat
:
unit
->
fcstat
val
fcstat
:
unit
->
fcstat
val
export
:
fcstat
->
string
->
unit
val
export
:
fcstat
->
string
->
unit
val
export_json
:
fcstat
->
string
->
unit
val
export_json
:
fcstat
->
?
jinput
:
string
->
joutput
:
string
->
unit
->
unit
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment