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
0ec0b078
Commit
0ec0b078
authored
3 years ago
by
Patrick Baudin
Browse files
Options
Downloads
Patches
Plain Diff
[ptests] %{bin:tool} is replaced by ./bin/tool
parent
3a648312
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
ptests/ptests.ml
+66
-64
66 additions, 64 deletions
ptests/ptests.ml
with
66 additions
and
64 deletions
ptests/ptests.ml
+
66
−
64
View file @
0ec0b078
...
...
@@ -1359,71 +1359,73 @@ end = struct
let
expand_macros
=
let
dune_cmd_features
=
Str
.
regexp
"%{[a-z][a-z-]*:
\\
([^}]*
\\
)}"
in
let
dune_bin_features
=
Str
.
regexp
"%{bin:
\\
([^}]*
\\
)}"
in
fun
~
defaults
cmd
->
let
ptest_config
=
if
!
special_config
=
""
then
""
else
"_"
^
!
special_config
in
let
ptest_file
=
get_ptest_file
cmd
in
let
ptest_name
=
try
Filename
.
chop_extension
cmd
.
file
with
Invalid_argument
_
->
cmd
.
file
in
let
ptest_file
=
Filename
.
sanitize
ptest_file
in
let
ptest_load_plugin
=
Macros
.
get
"PTEST_LOAD_PLUGIN"
cmd
.
macros
in
let
ptest_load_module
=
Macros
.
get
"PTEST_LOAD_MODULE"
cmd
.
macros
in
let
ptest_load_libs
=
Macros
.
get
"PTEST_LOAD_LIBS"
cmd
.
macros
in
let
ptest_load_script
=
Macros
.
get
"PTEST_LOAD_SCRIPT"
cmd
.
macros
in
let
macros
=
[
"PTEST_CONFIG"
,
ptest_config
;
"PTEST_DIR"
,
SubDir
.
get
cmd
.
directory
;
"PTEST_RESULT"
,
SubDir
.
get
cmd
.
directory
^
"/"
^
redefine_name
"result"
;
"PTEST_FILE"
,
ptest_file
;
"PTEST_NAME"
,
ptest_name
;
"PTEST_NUMBER"
,
string_of_int
cmd
.
n
;
"PTEST_OPT"
,
cmd
.
options
;
"PTEST_LOAD_OPTIONS"
,
(
String
.
concat
" "
[
ptest_load_plugin
;
ptest_load_libs
;
ptest_load_module
;
ptest_load_script
;
])
]
in
let
macros
=
Macros
.
add_list
macros
cmd
.
macros
in
let
macros
=
Macros
.
add_defaults
~
defaults
macros
in
let
process_macros
s
=
Macros
.
expand
macros
s
in
let
toplevel
=
let
in_toplevel
,
toplevel
=
Macros
.
does_expand
macros
cmd
.
toplevel
in
if
not
cmd
.
execnow
then
begin
let
has_ptest_file
,
options
=
if
in_toplevel
.
has_ptest_opt
then
in_toplevel
.
has_ptest_file
,
[]
else
let
in_option
,
options
=
Macros
.
does_expand
macros
cmd
.
options
in
(
in_option
.
has_ptest_file
||
in_toplevel
.
has_ptest_file
)
,
(
if
in_toplevel
.
has_frama_c_exe
then
[
process_macros
"@PTEST_PRE_OPTIONS@"
;
options
;
process_macros
"@PTEST_POST_OPTIONS@"
;
]
else
[
options
])
in
String
.
concat
" "
(
toplevel
::
(
if
has_ptest_file
then
options
else
ptest_file
::
options
))
end
else
toplevel
in
let
toplevel
=
(* removes dune feature such as %{deps:...} *)
str_global_replace
dune_cmd_features
"
\\
1"
toplevel
in
{
cmd
with
macros
;
toplevel
;
options
=
""
;
(* no more usable *)
log_files
=
List
.
map
process_macros
cmd
.
log_files
;
filter
=
match
cmd
.
filter
with
|
None
->
None
|
Some
filter
->
Some
(
process_macros
filter
)
}
let
ptest_config
=
if
!
special_config
=
""
then
""
else
"_"
^
!
special_config
in
let
ptest_file
=
get_ptest_file
cmd
in
let
ptest_name
=
try
Filename
.
chop_extension
cmd
.
file
with
Invalid_argument
_
->
cmd
.
file
in
let
ptest_file
=
Filename
.
sanitize
ptest_file
in
let
ptest_load_plugin
=
Macros
.
get
"PTEST_LOAD_PLUGIN"
cmd
.
macros
in
let
ptest_load_module
=
Macros
.
get
"PTEST_LOAD_MODULE"
cmd
.
macros
in
let
ptest_load_libs
=
Macros
.
get
"PTEST_LOAD_LIBS"
cmd
.
macros
in
let
ptest_load_script
=
Macros
.
get
"PTEST_LOAD_SCRIPT"
cmd
.
macros
in
let
macros
=
[
"PTEST_CONFIG"
,
ptest_config
;
"PTEST_DIR"
,
SubDir
.
get
cmd
.
directory
;
"PTEST_RESULT"
,
SubDir
.
get
cmd
.
directory
^
"/"
^
redefine_name
"result"
;
"PTEST_FILE"
,
ptest_file
;
"PTEST_NAME"
,
ptest_name
;
"PTEST_NUMBER"
,
string_of_int
cmd
.
n
;
"PTEST_OPT"
,
cmd
.
options
;
"PTEST_LOAD_OPTIONS"
,
(
String
.
concat
" "
[
ptest_load_plugin
;
ptest_load_libs
;
ptest_load_module
;
ptest_load_script
;
])
]
in
let
macros
=
Macros
.
add_list
macros
cmd
.
macros
in
let
macros
=
Macros
.
add_defaults
~
defaults
macros
in
let
process_macros
s
=
Macros
.
expand
macros
s
in
let
toplevel
=
let
in_toplevel
,
toplevel
=
Macros
.
does_expand
macros
cmd
.
toplevel
in
if
not
cmd
.
execnow
then
begin
let
has_ptest_file
,
options
=
if
in_toplevel
.
has_ptest_opt
then
in_toplevel
.
has_ptest_file
,
[]
else
let
in_option
,
options
=
Macros
.
does_expand
macros
cmd
.
options
in
(
in_option
.
has_ptest_file
||
in_toplevel
.
has_ptest_file
)
,
(
if
in_toplevel
.
has_frama_c_exe
then
[
process_macros
"@PTEST_PRE_OPTIONS@"
;
options
;
process_macros
"@PTEST_POST_OPTIONS@"
;
]
else
[
options
])
in
String
.
concat
" "
(
toplevel
::
(
if
has_ptest_file
then
options
else
ptest_file
::
options
))
end
else
toplevel
in
let
toplevel
=
(* removes dune feature such as %{deps:...} *)
let
x
=
str_global_replace
dune_bin_features
"./bin/
\\
1"
toplevel
in
str_global_replace
dune_cmd_features
"
\\
1"
x
in
{
cmd
with
macros
;
toplevel
;
options
=
""
;
(* no more usable *)
log_files
=
List
.
map
process_macros
cmd
.
log_files
;
filter
=
match
cmd
.
filter
with
|
None
->
None
|
Some
filter
->
Some
(
process_macros
filter
)
}
let
basic_command_string
=
fun
command
->
...
...
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