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
8db03da6
Commit
8db03da6
authored
2 years ago
by
Valentin Perrelle
Committed by
Andre Maroneze
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Analysis Scripts] add dump to CSV
parent
d9528b9d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
share/analysis-scripts/summary.py
+23
-1
23 additions, 1 deletion
share/analysis-scripts/summary.py
with
23 additions
and
1 deletion
share/analysis-scripts/summary.py
+
23
−
1
View file @
8db03da6
...
@@ -30,6 +30,7 @@ import os
...
@@ -30,6 +30,7 @@ import os
import
signal
import
signal
import
argparse
import
argparse
import
uuid
import
uuid
import
csv
from
pathlib
import
Path
from
pathlib
import
Path
import
frama_c_results
import
frama_c_results
...
@@ -145,6 +146,22 @@ def poll_results(targets, benchmark_tag):
...
@@ -145,6 +146,22 @@ def poll_results(targets, benchmark_tag):
return
results
return
results
def
dump_results_csv
(
results
,
path
):
with
open
(
path
,
'
w
'
,
newline
=
''
)
as
file
:
fieldnames
=
[
"
target_name
"
,
"
timestamp
"
,
"
sem_reach_fun
"
,
"
syn_reach_fun
"
,
"
total_fun
"
,
"
sem_reach_stmt
"
,
"
syn_reach_stmt
"
,
"
alarms
"
,
"
warnings
"
,
"
coverage
"
,
"
user_time
"
,
"
memory
"
]
writer
=
csv
.
DictWriter
(
file
,
fieldnames
=
fieldnames
,
extrasaction
=
'
ignore
'
)
writer
.
writeheader
()
writer
.
writerows
(
results
)
def
run_analyses
(
display
,
database
,
framac
,
benchmark_tag
):
def
run_analyses
(
display
,
database
,
framac
,
benchmark_tag
):
results
=
[]
results
=
[]
targets
=
list_targets
(
"
.
"
)
targets
=
list_targets
(
"
.
"
)
...
@@ -201,7 +218,9 @@ parser.add_argument("-c", "--comment",
...
@@ -201,7 +218,9 @@ parser.add_argument("-c", "--comment",
parser
.
add_argument
(
"
-p
"
,
"
--repository-path
"
,
parser
.
add_argument
(
"
-p
"
,
"
--repository-path
"
,
action
=
"
store
"
,
metavar
=
"
PATH
"
,
action
=
"
store
"
,
metavar
=
"
PATH
"
,
help
=
"
don
'
t clone Frama-C, use this git repository instead
"
)
help
=
"
don
'
t clone Frama-C, use this git repository instead
"
)
parser
.
add_argument
(
"
-o
"
,
"
--output-csv
"
,
action
=
"
store
"
,
metavar
=
"
PATH
"
,
type
=
Path
,
help
=
"
output the results to the given CSV file
"
)
errors
=
b
""
errors
=
b
""
...
@@ -241,6 +260,9 @@ try:
...
@@ -241,6 +260,9 @@ try:
print
(
"
Results:
\n
"
)
print
(
"
Results:
\n
"
)
results_display
.
PlainDisplay
().
print_table
(
results
)
results_display
.
PlainDisplay
().
print_table
(
results
)
if
args
.
output_csv
is
not
None
:
dump_results_csv
(
results
,
args
.
output_csv
)
except
OperationException
as
e
:
except
OperationException
as
e
:
errors
+=
bytearray
(
str
(
e
),
"
ascii
"
)
errors
+=
bytearray
(
str
(
e
),
"
ascii
"
)
...
...
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