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
ee84d4bd
Commit
ee84d4bd
authored
3 years ago
by
Patrick Baudin
Browse files
Options
Downloads
Patches
Plain Diff
[ptests] fixes str mutex
parent
f12cff12
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ptests/ptests.ml
+13
-7
13 additions, 7 deletions
ptests/ptests.ml
with
13 additions
and
7 deletions
ptests/ptests.ml
+
13
−
7
View file @
ee84d4bd
...
@@ -663,8 +663,8 @@ struct
...
@@ -663,8 +663,8 @@ struct
|
Str
.
Text
s
->
s
|
Str
.
Text
s
->
s
|
Str
.
Delim
s
->
|
Str
.
Delim
s
->
if
Str
.
string_match
macro_regex
s
0
then
begin
if
Str
.
string_match
macro_regex
s
0
then
begin
let
macro
=
Str
.
matched_group
1
s
in
try
try
let
macro
=
Str
.
matched_group
1
s
in
(
match
macro
with
(
match
macro
with
|
"PTEST_FILE"
->
has_ptest_file
:=
true
|
"PTEST_FILE"
->
has_ptest_file
:=
true
|
"PTEST_OPT"
->
has_ptest_opt
:=
true
|
"PTEST_OPT"
->
has_ptest_opt
:=
true
...
@@ -1921,7 +1921,11 @@ let diff_check_exist old_file new_file =
...
@@ -1921,7 +1921,11 @@ let diff_check_exist old_file new_file =
new_file
^
"
\"
;"
^
" cat "
^
new_file
new_file
^
"
\"
;"
^
" cat "
^
new_file
end
end
let
do_diff
=
function
let
do_diff
=
let
stdout_redir_regexp
=
Str
.
regexp
"[^2]> ?
\\
([-a-zA-Z0-9_/.]+
\\
)"
and
stderr_redir_regexp
=
Str
.
regexp
"2> ?
\\
([-a-zA-Z0-9_/.]+
\\
)"
;
in
function
|
Command_error
(
diff
,
kind
)
->
|
Command_error
(
diff
,
kind
)
->
let
log_prefix
=
Cmd
.
log_prefix
diff
in
let
log_prefix
=
Cmd
.
log_prefix
diff
in
let
log_ext
=
log_ext
kind
in
let
log_ext
=
log_ext
kind
in
...
@@ -1942,19 +1946,21 @@ let do_diff = function
...
@@ -1942,19 +1946,21 @@ let do_diff = function
|
Target_error
execnow
->
|
Target_error
execnow
->
let
test_file
=
SubDir
.
make_file
execnow
.
ex_dir
execnow
.
ex_file
in
let
test_file
=
SubDir
.
make_file
execnow
.
ex_dir
execnow
.
ex_file
in
lock_printf
"#------ Custom command failed for test file %s:@
\n
"
test_file
;
lock_printf
"#------ Custom command failed for test file %s:@
\n
"
test_file
;
let
print_redirected
out
redir_
str
=
let
print_redirected
out
redir_
regexp
=
try
try
ignore
(
Str
.
search_forward
(
Str
.
regexp
redir_str
)
execnow
.
ex_cmd
0
);
Mutex
.
lock
str_mutex
;
ignore
(
Str
.
search_forward
redir_regexp
execnow
.
ex_cmd
0
);
let
file
=
Str
.
matched_group
1
execnow
.
ex_cmd
in
let
file
=
Str
.
matched_group
1
execnow
.
ex_cmd
in
Mutex
.
unlock
str_mutex
;
lock_printf
"#- %s redirected to %s:@
\n
"
out
file
;
lock_printf
"#- %s redirected to %s:@
\n
"
out
file
;
if
not
(
Sys
.
file_exists
file
)
then
if
not
(
Sys
.
file_exists
file
)
then
lock_printf
"#- error: file does not exist: %s:@
\n
"
file
lock_printf
"#- error: file does not exist: %s:@
\n
"
file
else
else
ignore
(
launch
(
"cat "
^
file
));
ignore
(
launch
(
"cat "
^
file
));
with
Not_found
->
()
with
Not_found
->
lock_printf
"#- error: EXECNOW command without %s redirection: %s@
\n
"
out
execnow
.
ex_cmd
in
in
print_redirected
"stdout"
"[^2]> ?
\\
([-a-zA-Z0-9_/.]+
\\
)"
;
print_redirected
"stdout"
stdout_redir_regexp
;
print_redirected
"stderr"
"2> ?
\\
([-a-zA-Z0-9_/.]+
\\
)"
;
print_redirected
"stderr"
stderr_redir_regexp
;
lock_printf
"#- Tested file: %s #- Custom command: %s@
\n
"
test_file
execnow
.
ex_cmd
;
lock_printf
"#- Tested file: %s #- Custom command: %s@
\n
"
test_file
execnow
.
ex_cmd
;
|
Log_error
(
dir
,
test_file
,
log
)
->
|
Log_error
(
dir
,
test_file
,
log
)
->
let
test_file
=
SubDir
.
make_file
dir
test_file
in
let
test_file
=
SubDir
.
make_file
dir
test_file
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