use of com.synopsys.integration.common.util.parse.CommandParser in project synopsys-detect by blackducksoftware.
the class CompileCommandParserTest method testCrazyNestedQuoting.
@Test
public void testCrazyNestedQuoting() {
CompileCommand command = new CompileCommand();
command.setCommand("X=\"\\\" a b\\\"\"");
CompileCommandParser commandParser = new CompileCommandParser(new CommandParser());
List<String> result = commandParser.parseCommand(command, Collections.emptyMap());
assertEquals(1, result.size());
int i = 0;
assertEquals("X=\"\\\" a b\\\"\"", result.get(i++));
}
use of com.synopsys.integration.common.util.parse.CommandParser in project synopsys-detect by blackducksoftware.
the class CompileCommandParserTest method testComplexCompileCommand.
@Test
public void testComplexCompileCommand() {
CompileCommand command = new CompileCommand();
command.setCommand("/usr/bin/clang++-3.6 -DCMAKE_BUILD_TYPE=\\\"Debug\\\" -DCMAKE_CC_FLAGS=\"\\\" -ggdb -Wstrict-aliasing=2 -pedantic -fPIC --std=c11\\\"\" -c ./pb.cc");
CompileCommandParser commandParser = new CompileCommandParser(new CommandParser());
List<String> result = commandParser.parseCommand(command, Collections.emptyMap());
assertEquals(5, result.size());
int i = 0;
assertEquals("/usr/bin/clang++-3.6", result.get(i++));
assertEquals("-DCMAKE_BUILD_TYPE=\\\"Debug\\\"", result.get(i++));
assertEquals("-DCMAKE_CC_FLAGS=\"\\\" -ggdb -Wstrict-aliasing=2 -pedantic -fPIC --std=c11\\\"\"", result.get(i++));
assertEquals("-c", result.get(i++));
assertEquals("./pb.cc", result.get(i++));
}
Aggregations