|
|
@ -22,15 +22,19 @@ import utils.InferException;
|
|
|
|
import utils.InferRunner;
|
|
|
|
import utils.InferRunner;
|
|
|
|
|
|
|
|
|
|
|
|
public class ClangFrontendUtils {
|
|
|
|
public class ClangFrontendUtils {
|
|
|
|
public static void createAndCompareCppDotFiles(DebuggableTemporaryFolder folder, String pathToSrcFile)
|
|
|
|
public static void createAndCompareCppDotFiles (
|
|
|
|
|
|
|
|
DebuggableTemporaryFolder folder,
|
|
|
|
|
|
|
|
String pathToSrcFile,
|
|
|
|
|
|
|
|
boolean headers)
|
|
|
|
throws InterruptedException, IOException, InferException {
|
|
|
|
throws InterruptedException, IOException, InferException {
|
|
|
|
|
|
|
|
|
|
|
|
String test_src = pathToSrcFile;
|
|
|
|
String test_src = pathToSrcFile;
|
|
|
|
String test_dotty = pathToSrcFile + ".dot";
|
|
|
|
String test_dotty = pathToSrcFile + ".dot";
|
|
|
|
ImmutableList<String> inferCmd =
|
|
|
|
ImmutableList<String> inferCmd;
|
|
|
|
InferRunner.createCPPInferCommandFrontend(
|
|
|
|
if (headers)
|
|
|
|
folder,
|
|
|
|
inferCmd = InferRunner.createCPPInferCommandIncludeHeaders(folder, test_src);
|
|
|
|
test_src);
|
|
|
|
else
|
|
|
|
|
|
|
|
inferCmd = InferRunner.createCPPInferCommandFrontend(folder, test_src);
|
|
|
|
File newDotFile = InferRunner.runInferFrontend(inferCmd);
|
|
|
|
File newDotFile = InferRunner.runInferFrontend(inferCmd);
|
|
|
|
assertThat(
|
|
|
|
assertThat(
|
|
|
|
"In the capture of " + test_src +
|
|
|
|
"In the capture of " + test_src +
|
|
|
@ -38,6 +42,18 @@ public class ClangFrontendUtils {
|
|
|
|
newDotFile, dotFileEqualTo(test_dotty));
|
|
|
|
newDotFile, dotFileEqualTo(test_dotty));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void createAndCompareCppDotFiles(DebuggableTemporaryFolder folder,
|
|
|
|
|
|
|
|
String pathToSrcFile)
|
|
|
|
|
|
|
|
throws InterruptedException, IOException, InferException {
|
|
|
|
|
|
|
|
createAndCompareCppDotFiles(folder, pathToSrcFile, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void createAndCompareCppDotFilesIncludeHeaders(DebuggableTemporaryFolder folder,
|
|
|
|
|
|
|
|
String pathToSrcFile)
|
|
|
|
|
|
|
|
throws InterruptedException, IOException, InferException {
|
|
|
|
|
|
|
|
createAndCompareCppDotFiles(folder, pathToSrcFile, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void createAndCompareCDotFiles(DebuggableTemporaryFolder folder, String pathToSrcFile)
|
|
|
|
public static void createAndCompareCDotFiles(DebuggableTemporaryFolder folder, String pathToSrcFile)
|
|
|
|
throws InterruptedException, IOException, InferException {
|
|
|
|
throws InterruptedException, IOException, InferException {
|
|
|
|
|
|
|
|
|
|
|
|