Skip to content
Snippets Groups Projects
Commit 3cb9c74b authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

Merge branch 'feature/andre/jcdb-allow-no-directory' into 'master'

[Kernel] allow entries without directory in compile_commands.json

See merge request frama-c/frama-c!2088
parents db9de905 3ad308cb
No related branches found
No related tags found
No related merge requests found
...@@ -128,7 +128,7 @@ let quote_define_argument arg = Format.sprintf "%S" arg ...@@ -128,7 +128,7 @@ let quote_define_argument arg = Format.sprintf "%S" arg
let parse_entry ?(cwd=Sys.getcwd()) (r : Yojson.Basic.json) = let parse_entry ?(cwd=Sys.getcwd()) (r : Yojson.Basic.json) =
let open Yojson.Basic.Util in let open Yojson.Basic.Util in
let filename = r |> member "file" |> to_string in let filename = r |> member "file" |> to_string in
let dirname = r |> member "directory" |> to_string in let dirname = r |> member "directory" |> to_string_option |> Extlib.opt_conv "" in
let path = Datatype.Filepath.of_string ~base_name:dirname filename in let path = Datatype.Filepath.of_string ~base_name:dirname filename in
(* get the list of arguments, and a flag indicating if the arguments (* get the list of arguments, and a flag indicating if the arguments
......
...@@ -10,5 +10,9 @@ ...@@ -10,5 +10,9 @@
{ "directory": "tests/jcdb", { "directory": "tests/jcdb",
"command": "/usr/bin/clang++ -D'MSG=\"a \\\" \\\"b\"' -D'SINGLE_DOUBLE(a)=\"a \\\"with spaces and tab \"' -DSOMEDEF=\"With spaces, quotes and \\-es.\" -D\"DOUBLE_SINGLE(a)=a \\\"macro with spaces and non-escaped \\\\'\\\"\" -DEMPTY='' -DEMPTY2= -DTEST=42 -D'MACRO_FOR_INCR(s)=s+1' -DTOUNDEF -UTOUNDEF", "command": "/usr/bin/clang++ -D'MSG=\"a \\\" \\\"b\"' -D'SINGLE_DOUBLE(a)=\"a \\\"with spaces and tab \"' -DSOMEDEF=\"With spaces, quotes and \\-es.\" -D\"DOUBLE_SINGLE(a)=a \\\"macro with spaces and non-escaped \\\\'\\\"\" -DEMPTY='' -DEMPTY2= -DTEST=42 -D'MACRO_FOR_INCR(s)=s+1' -DTOUNDEF -UTOUNDEF",
"file": "jcdb.c" "file": "jcdb.c"
},
{
"command": "testing entry without 'directory' key",
"file": "jcdb.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