Search in sources :

Example 1 with FilePathGenerator

use of com.synopsys.integration.detectable.detectables.clang.dependencyfile.FilePathGenerator in project synopsys-detect by blackducksoftware.

the class DependencyFileDetailGeneratorTest method testFileThatDoesNotExistIsSkipped.

@Test
public void testFileThatDoesNotExistIsSkipped() {
    File mockFile = Mockito.mock(File.class);
    Mockito.when(mockFile.toString()).thenReturn("Example");
    FilePathGenerator filePathGenerator = Mockito.mock(FilePathGenerator.class);
    Mockito.when(filePathGenerator.fromCompileCommand(mockFile, null, true)).thenReturn(Collections.singletonList("does_not_exist.h"));
    DependencyFileDetailGenerator dependencyFileDetailGenerator = new DependencyFileDetailGenerator(filePathGenerator);
    Set<File> fileDetailsSet = dependencyFileDetailGenerator.fromCompileCommands(Collections.singletonList(new CompileCommand()), null, true);
    Assertions.assertEquals(0, fileDetailsSet.size());
}
Also used : DependencyFileDetailGenerator(com.synopsys.integration.detectable.detectables.clang.dependencyfile.DependencyFileDetailGenerator) CompileCommand(com.synopsys.integration.detectable.detectables.clang.compilecommand.CompileCommand) File(java.io.File) FilePathGenerator(com.synopsys.integration.detectable.detectables.clang.dependencyfile.FilePathGenerator) Test(org.junit.jupiter.api.Test)

Aggregations

CompileCommand (com.synopsys.integration.detectable.detectables.clang.compilecommand.CompileCommand)1 DependencyFileDetailGenerator (com.synopsys.integration.detectable.detectables.clang.dependencyfile.DependencyFileDetailGenerator)1 FilePathGenerator (com.synopsys.integration.detectable.detectables.clang.dependencyfile.FilePathGenerator)1 File (java.io.File)1 Test (org.junit.jupiter.api.Test)1