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

[sarif] slightly more json generated

parent 596e38e8
No related branches found
No related tags found
No related merge requests found
...@@ -379,33 +379,64 @@ type t = { ...@@ -379,33 +379,64 @@ type t = {
properties: (Properties.t [@default Properties.default]); properties: (Properties.t [@default Properties.default]);
}[@@deriving yojson] }[@@deriving yojson]
let default = { let create
commandLine = "/bin/cat"; ~commandLine
arguments = []; ?(arguments = [])
responseFiles = []; ?(responseFiles = [])
attachments = []; ?(attachments = [])
startTime = ""; ?(startTime = "")
endTime = ""; ?(endTime = "")
exitCode = 0; ?(exitCode = 0)
toolNotifications = []; ?(toolNotifications = [])
configurationNotifications = []; ?(configurationNotifications = [])
exitCodeDescription = ""; ?(exitCodeDescription = "")
exitSignalName = ""; ?(exitSignalName = "")
exitSignalNumber = 0; ?(exitSignalNumber = 0)
processStartFailureMessage = ""; ?(processStartFailureMessage = "")
toolExecutionSuccessful = true; ?(toolExecutionSuccessful = true)
machine = ""; ?(machine = "")
account = ""; ?(account = "")
processId = 0; ?(processId = 0)
executableLocation = FileLocation.default; ?(executableLocation = FileLocation.default)
workingDirectory = FileLocation.default; ?(workingDirectory = FileLocation.default)
environmentVariables = Additional_properties.default; ?(environmentVariables = Additional_properties.default)
stdin = FileLocation.default; ?(stdin = FileLocation.default)
stdout = FileLocation.default; ?(stdout = FileLocation.default)
stderr = FileLocation.default; ?(stderr = FileLocation.default)
stdoutStderr = FileLocation.default; ?(stdoutStderr = FileLocation.default)
properties = Properties.default; ?(properties = Properties.default)
} ()
=
{
commandLine;
arguments;
responseFiles;
attachments;
startTime;
endTime;
exitCode;
toolNotifications;
configurationNotifications;
exitCodeDescription;
exitSignalName;
exitSignalNumber;
processStartFailureMessage;
toolExecutionSuccessful;
machine;
account;
processId;
executableLocation;
workingDirectory;
environmentVariables;
stdin;
stdout;
stderr;
stdoutStderr;
properties;
}
let default = create ~commandLine:"/bin/true" ()
end end
module Conversion = struct module Conversion = struct
......
...@@ -6,7 +6,7 @@ let frama_c_sarif = ...@@ -6,7 +6,7 @@ let frama_c_sarif =
let semanticVersion = Config.version in let semanticVersion = Config.version in
let fullName = name ^ "-" ^ version in let fullName = name ^ "-" ^ version in
let downloadUri = "https://frama-c.com/download.html" in let downloadUri = "https://frama-c.com/download.html" in
let sarifLoggerVersion = Mdr_params.version in let sarifLoggerVersion = Mdr_version.version in
Tool.create Tool.create
~name ~version ~semanticVersion ~name ~version ~semanticVersion
~fullName ~downloadUri ~sarifLoggerVersion () ~fullName ~downloadUri ~sarifLoggerVersion ()
...@@ -16,9 +16,14 @@ let get_remarks () = ...@@ -16,9 +16,14 @@ let get_remarks () =
if f <> "" then Parse_remarks.get_remarks f if f <> "" then Parse_remarks.get_remarks f
else Datatype.String.Map.empty else Datatype.String.Map.empty
let gen_invocation () =
let commandLine = Array.fold_right (fun s acc -> s ^ " " ^ acc) Sys.argv "" in
let arguments = List.tl (Array.to_list Sys.argv) in
Invocation.create ~commandLine ~arguments ()
let gen_run () = let gen_run () =
let tool = frama_c_sarif in let tool = frama_c_sarif in
let invocations = [] in let invocations = [gen_invocation ()] in
Run.create ~tool ~invocations () Run.create ~tool ~invocations ()
let generate () = let generate () =
......
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