Commit 5104d394 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[sarif] slightly more json generated

parent 596e38e8
......@@ -379,33 +379,64 @@ type t = {
properties: (Properties.t [@default Properties.default]);
}[@@deriving yojson]
let default = {
commandLine = "/bin/cat";
arguments = [];
responseFiles = [];
attachments = [];
startTime = "";
endTime = "";
exitCode = 0;
toolNotifications = [];
configurationNotifications = [];
exitCodeDescription = "";
exitSignalName = "";
exitSignalNumber = 0;
processStartFailureMessage = "";
toolExecutionSuccessful = true;
machine = "";
account = "";
processId = 0;
executableLocation = FileLocation.default;
workingDirectory = FileLocation.default;
environmentVariables = Additional_properties.default;
stdin = FileLocation.default;
stdout = FileLocation.default;
stderr = FileLocation.default;
stdoutStderr = FileLocation.default;
properties = Properties.default;
}
let create
~commandLine
?(arguments = [])
?(responseFiles = [])
?(attachments = [])
?(startTime = "")
?(endTime = "")
?(exitCode = 0)
?(toolNotifications = [])
?(configurationNotifications = [])
?(exitCodeDescription = "")
?(exitSignalName = "")
?(exitSignalNumber = 0)
?(processStartFailureMessage = "")
?(toolExecutionSuccessful = true)
?(machine = "")
?(account = "")
?(processId = 0)
?(executableLocation = FileLocation.default)
?(workingDirectory = FileLocation.default)
?(environmentVariables = Additional_properties.default)
?(stdin = FileLocation.default)
?(stdout = FileLocation.default)
?(stderr = FileLocation.default)
?(stdoutStderr = FileLocation.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
module Conversion = struct
......
......@@ -6,7 +6,7 @@ let frama_c_sarif =
let semanticVersion = Config.version in
let fullName = name ^ "-" ^ version in
let downloadUri = "https://frama-c.com/download.html" in
let sarifLoggerVersion = Mdr_params.version in
let sarifLoggerVersion = Mdr_version.version in
Tool.create
~name ~version ~semanticVersion
~fullName ~downloadUri ~sarifLoggerVersion ()
......@@ -16,9 +16,14 @@ let get_remarks () =
if f <> "" then Parse_remarks.get_remarks f
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 tool = frama_c_sarif in
let invocations = [] in
let invocations = [gen_invocation ()] in
Run.create ~tool ~invocations ()
let generate () =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment