Skip to content
Snippets Groups Projects
Commit 78fd8922 authored by François Bobot's avatar François Bobot
Browse files

[Ptests] Add filters for stdout

parent cc3a684e
No related branches found
No related tags found
No related merge requests found
......@@ -1081,6 +1081,12 @@ let command_string ~result_fmt ~oracle_fmt command =
* in
* Some (exec_name ^ params)
* in *)
let filter_stdout_begin,filter_stdout_end = match command.filter with
| None -> "",""
| Some filter ->
"(pipe-stdout ",
Format.sprintf "(system %S))" filter
in
let command_string = basic_command_string command in
(* let command_string = match filter with
* | None -> command_string
......@@ -1114,7 +1120,7 @@ let command_string ~result_fmt ~oracle_fmt command =
"(rule\n \
(targets %S %S %a)\n \
(deps %a %S (package frama-c)%a (universe))\n \
(action (with-stderr-to %S (with-stdout-to %S (with-accepted-exit-codes (or 0 1 125) (system %S)))))\n\
(action (with-stderr-to %S (with-stdout-to %S %s(with-accepted-exit-codes (or 0 1 125) (system %S))%s)))\n\
)@."
errlog
res
......@@ -1124,7 +1130,9 @@ let command_string ~result_fmt ~oracle_fmt command =
Fmt.(list (package_as_deps (quote plugin_as_package))) command.plugins
errlog
res
filter_stdout_begin
command_string
filter_stdout_end
;
Format.fprintf result_fmt
"(rule\n \
......
/* run.config
CMXS: machdep_char_unsigned
OPT:-print -load-module machdep_char_unsigned -machdep unsigned_char -then -constfold -rte
OPT:-print -load-module %{dep:machdep_char_unsigned.cmxs} -machdep unsigned_char -then -constfold -rte
*/
char t[10];
......
/* run.config*
FILTER: sed 's:/\(tmp\|var\|build\)/[^ ]*\.i:/tmp/FILE.i:g'
FILTER: sed -e 's:/\(tmp\|var\|build\)/[^ ]*\.i:/tmp/FILE.i:g' -e 's:-I.*share/frama-c/share/libc:-I LIBC:g'
OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo [\$(basename '%1') \$(basename '%1') \$(basename '%i') \$(basename '%input')] ['%2' '%2' '%o' '%output'] ['%args']"
OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo %%1 = \$(basename '%1') %%2 = '%2' %%args = '%args'"
OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "printf \"%s\" \"using \\% has no effect : \$(basename \"\%input\")\""
......
[kernel] Parsing anon_enum_libc.c (with preprocessing)
[kernel] User Error: failed to run: gcc -E -C -I. -I/home/bobot/Sources/frama-c/_build/install/default/share/frama-c/share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -I tests/syntax -dD -nostdinc -m32 -o '/tmp/anon_enum_libc.c98bd8a.i' '/home/bobot/Sources/frama-c/_build/default/tests/syntax/result/anon_enum_libc.c'
See chapter "Preparing the Sources" in the Frama-C user manual for more details.
[kernel] User Error: stopping on file "anon_enum_libc.c" that has errors. Add '-kernel-msg-key pp'
for preprocessing command.
[kernel] Frama-C aborted: invalid user input.
[kernel] Parsing anon_enum_libc.tmp.c (with preprocessing)
/* Generated by Frama-C */
#include "PTESTS_DIR/anon_enum_libc.h"
struct __anonstruct_s1_1 {
int x ;
float y ;
};
enum __anonenum_2 {
BLA = 4,
BLI = 12
};
struct __anonstruct_s1_1 s1;
int f(void)
{
int __retres;
__retres = BLA + s1.x;
return __retres;
}
int g(void)
{
int __retres;
__retres = (int)((unsigned long)FOO + s2.t);
return __retres;
}
[kernel] Parsing cpp-command.c (with preprocessing)
[cpp-command.c cpp-command.c cpp-command.c cpp-command.c] [/tmp/cpp-command.cd485c4.i /tmp/cpp-command.cd485c4.i /tmp/cpp-command.cd485c4.i /tmp/cpp-command.cd485c4.i] [ -I/home/bobot/Sources/frama-c/_build/install/default/share/frama-c/share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32]
[cpp-command.c cpp-command.c cpp-command.c cpp-command.c] [/tmp/FILE.i /tmp/FILE.i /tmp/FILE.i /tmp/FILE.i] [ -I LIBC -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32]
[kernel] Parsing cpp-command.c (with preprocessing)
%1 = cpp-command.c %2 = /tmp/cpp-command.c125b21.i %args = -I/home/bobot/Sources/frama-c/_build/install/default/share/frama-c/share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32
%1 = cpp-command.c %2 = /tmp/FILE.i %args = -I LIBC -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32
[kernel] Parsing /home/bobot/Sources/frama-c/_build/default/share/libc/string.h (with preprocessing)
[kernel] Parsing SHARE/libc/string.h (with preprocessing)
[kernel] Parsing multiple_decls_contracts.c (with preprocessing)
[kernel] Parsing multiple_decls_contracts.c (with preprocessing)
[kernel] multiple_decls_contracts.c:11: Warning:
......
[kernel] Parsing multiple_decls_contracts.c (with preprocessing)
[kernel] Parsing /home/bobot/Sources/frama-c/_build/default/share/libc/string.h (with preprocessing)
[kernel] Parsing SHARE/libc/string.h (with preprocessing)
[kernel] Parsing multiple_decls_contracts.c (with preprocessing)
[kernel] multiple_decls_contracts.c:11: Warning:
dropping duplicate def'n of func strdup at multiple_decls_contracts.c:11 in favor of that at multiple_decls_contracts.c:11
......
[kernel] Parsing multiple_decls_contracts.c (with preprocessing)
[kernel] Parsing multiple_decls_contracts.c (with preprocessing)
[kernel] Parsing /home/bobot/Sources/frama-c/_build/default/share/libc/string.h (with preprocessing)
[kernel] Parsing SHARE/libc/string.h (with preprocessing)
[kernel] multiple_decls_contracts.c:11: Warning:
dropping duplicate def'n of func strdup at multiple_decls_contracts.c:11 in favor of that at multiple_decls_contracts.c:11
/* Generated by Frama-C */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment