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
3f3bf8ed
Commit
3f3bf8ed
authored
2 years ago
by
Patrick Baudin
Committed by
Virgile Prevosto
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[ptests] factorize plugin name to lib package conversion
parent
63481bf7
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
tools/ptests/ptests.ml
+12
-8
12 additions, 8 deletions
tools/ptests/ptests.ml
with
12 additions
and
8 deletions
tools/ptests/ptests.ml
+
12
−
8
View file @
3f3bf8ed
...
...
@@ -1244,17 +1244,21 @@ let basic_command_string command =
else
"ulimit -t "
^
command
.
timeout
^
" && "
^
toplevel
in
raw_command
let
pp_plugin_name
fmt
s
=
Format
.
fprintf
fmt
"frama-c-%s"
s
let
pp_plugin_as_lib
fmt
s
=
Format
.
fprintf
fmt
"%a.core"
pp_plugin_name
s
let
pp_list
fmt
l
=
List
.
iter
(
Format
.
fprintf
fmt
" %S"
)
l
module
Fmt
=
struct
let
framac_plugin
fmt
s
=
Format
.
fprintf
fmt
"frama-c-%s.core"
s
let
plugin_as_package
fmt
s
=
let
pp_plugin_as_package
fmt
s
=
let
base
=
if
String
.
contains
s
'.'
then
String
.
sub
s
0
(
String
.
index
s
'.'
)
else
s
in
Format
.
fprintf
fmt
"
frama-c-%s"
base
Format
.
fprintf
fmt
"
%a"
pp_plugin_name
base
let
quote
pr
fmt
s
=
Format
.
fprintf
fmt
"%S"
(
Format
.
asprintf
"%a"
pr
s
)
let
list
pr
fmt
l
=
List
.
iter
(
fun
s
->
Format
.
fprintf
fmt
" %a"
pr
s
)
l
let
var_libavailable
pr
fmt
s
=
Format
.
fprintf
fmt
"%%{lib-available:%a}"
pr
s
...
...
@@ -1287,14 +1291,14 @@ let update_enabled_if ~enabled_if deps =
(* code similar to pp_enabled_if_content *)
Option
.
iter
(
fun
cond
->
enabled_if
:=
StringSet
.
add
cond
!
enabled_if
)
deps
.
enabled_if
;
List
.
iter
(
fun
lib
->
let
cond
=
Format
.
asprintf
"%a"
Fmt
.(
var_libavailable
framac
_plugin
)
lib
in
let
cond
=
Format
.
asprintf
"%a"
Fmt
.(
var_libavailable
pp
_plugin
_as_lib
)
lib
in
enabled_if
:=
StringSet
.
add
cond
!
enabled_if
)
(
list_of_deps
deps
.
load_plugin
)
let
pp_enabled_if_content
fmt
deps
=
Format
.
fprintf
fmt
"(and %s%a)"
(
Option
.
value
~
default
:
"true"
deps
.
enabled_if
)
Fmt
.(
list
(
var_libavailable
framac
_plugin
))
(
list_of_deps
deps
.
load_plugin
)
Fmt
.(
list
(
var_libavailable
pp
_plugin
_as_lib
))
(
list_of_deps
deps
.
load_plugin
)
let
pp_enabled_if
fmt
deps
=
Format
.
fprintf
fmt
"%s(enabled_if %a)"
...
...
@@ -1308,7 +1312,7 @@ let pp_command_deps fmt command =
(* from DEPS: LIBS: and MODULE: directives *)
pp_list_deps
(
list_of_deps
command
.
deps
.
deps_cmd
)
(* from PLUGIN directives *)
Fmt
.(
list
(
package_as_deps
(
quote
plugin_as_package
)))
(
list_of_deps
command
.
deps
.
load_plugin
)
Fmt
.(
list
(
package_as_deps
(
quote
pp_
plugin_as_package
)))
(
list_of_deps
command
.
deps
.
load_plugin
)
let
show_cmd
=
let
regexp_read
=
Str
.
regexp
"%{read:
\\
([^}]+
\\
)}"
in
...
...
@@ -1670,7 +1674,7 @@ let update_modules ~file ~modules deps =
let
load_module
=
list_of_deps
deps
.
load_module
in
if
load_module
<>
[]
then
begin
let
plugin_libs
=
StringSet
.
union
(
StringSet
.
of_list
(
List
.
map
(
Format
.
sprintf
"
frama-c-%s.core"
)
(
list_of_deps
deps
.
load_plugin
)))
(
StringSet
.
of_list
(
List
.
map
(
Format
.
a
sprintf
"
%a"
pp_plugin_as_lib
)
(
list_of_deps
deps
.
load_plugin
)))
(
StringSet
.
of_list
(
List
.
map
(
fun
s
->
Filename
.
remove_extension_opt
[
".cmxs"
;
".cma"
;
".ml"
]
(
Filename
.
basename
s
))
(
list_of_deps
deps
.
load_libs
)))
in
...
...
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