|
|
|
@ -22,15 +22,19 @@ import utils.InferException;
|
|
|
|
|
import utils.InferRunner;
|
|
|
|
|
|
|
|
|
|
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 {
|
|
|
|
|
|
|
|
|
|
String test_src = pathToSrcFile;
|
|
|
|
|
String test_dotty = pathToSrcFile + ".dot";
|
|
|
|
|
ImmutableList<String> inferCmd =
|
|
|
|
|
InferRunner.createCPPInferCommandFrontend(
|
|
|
|
|
folder,
|
|
|
|
|
test_src);
|
|
|
|
|
ImmutableList<String> inferCmd;
|
|
|
|
|
if (headers)
|
|
|
|
|
inferCmd = InferRunner.createCPPInferCommandIncludeHeaders(folder, test_src);
|
|
|
|
|
else
|
|
|
|
|
inferCmd = InferRunner.createCPPInferCommandFrontend(folder, test_src);
|
|
|
|
|
File newDotFile = InferRunner.runInferFrontend(inferCmd);
|
|
|
|
|
assertThat(
|
|
|
|
|
"In the capture of " + test_src +
|
|
|
|
@ -38,6 +42,18 @@ public class ClangFrontendUtils {
|
|
|
|
|
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)
|
|
|
|
|
throws InterruptedException, IOException, InferException {
|
|
|
|
|
|
|
|
|
|