реализовал запуск анализов из консоли. осталось парсить вывод получения размерности.
This commit is contained in:
@@ -491,7 +491,18 @@ public abstract class Sapfor extends OSDComponent {
|
||||
return res;
|
||||
}
|
||||
//--
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
public String getConsoleFlags() throws Exception {
|
||||
Vector<String> res = new Vector<>();
|
||||
if (Global.getSetting(SettingName.FREE_FORM).toBoolean())
|
||||
res.add("-f90");
|
||||
if (Global.getSetting(SettingName.STATIC_SHADOW_ANALYSIS).toBoolean())
|
||||
res.add("-sh");
|
||||
res.add("-shwidth " + Global.getSetting(SettingName.MAX_SHADOW_WIDTH));
|
||||
if (Global.getSetting(SettingName.KEEP_SPF_DIRECTIVES).toBoolean())
|
||||
res.add("-keepSPF");
|
||||
return String.join(" ", res);
|
||||
}
|
||||
public static boolean checkLines(Vector<String> lines) {
|
||||
for (String line : lines) {
|
||||
if (line.toLowerCase().contains("internal error")) {
|
||||
@@ -527,6 +538,7 @@ public abstract class Sapfor extends OSDComponent {
|
||||
Utils.delete_with_check(errorsFile);
|
||||
//---
|
||||
File file = new File(data_workspace, name + (Global.isWindows ? ".bat" : ".sh"));
|
||||
System.out.println(file.getAbsolutePath());
|
||||
FileUtils.write(file,
|
||||
Utils.DQuotes(sapfor_drv)
|
||||
+ (flags.isEmpty() ? "" : (" " + flags))
|
||||
@@ -562,4 +574,24 @@ public abstract class Sapfor extends OSDComponent {
|
||||
checkLines(outputLines) &&
|
||||
checkLines(errorsLines);
|
||||
}
|
||||
public static boolean parse(File sapfor_drv, File workspace, String flags) throws Exception {
|
||||
return performScript(
|
||||
"parse",
|
||||
sapfor_drv,
|
||||
workspace,
|
||||
"-parse *.f *.for *.fdv *.f90 *.f77",
|
||||
flags,
|
||||
Constants.parse_out_file,
|
||||
Constants.parse_err_file)
|
||||
&& (new File(workspace, "dvm.proj")).exists();
|
||||
}
|
||||
public static boolean analysis(File sapfor_drv, File workspace, PassCode_2021 code, String flags) throws Exception {
|
||||
return performScript("analysis",
|
||||
sapfor_drv,
|
||||
workspace,
|
||||
code.getTestingCommand(),
|
||||
flags,
|
||||
Constants.out_file,
|
||||
Constants.err_file);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user