logic: indexer command refactoring

* moved SystemHeaderSearchPaths and FramewordSeearchPaths of indexer cxx indexer commands to CompilerFlags section
* added SourceGroupTestSuite to test indexer command generation of all source groups
* removed "compile_commands.json" from gitignore, because a resource file for the tests has this name
This commit is contained in:
mlangkabel
2018-09-18 17:09:28 +02:00
parent 07454f2045
commit 9dc2bcc2f9
577 changed files with 11357 additions and 9443 deletions
@@ -0,0 +1,7 @@
package hello;
public class Greeter {
public String sayHello() {
return "Hello world!";
}
}
@@ -0,0 +1,13 @@
package hello;
import org.joda.time.LocalTime;
public class HelloWorld {
public static void main(String[] args) {
LocalTime currentTime = new LocalTime();
System.out.println("The current local time is: " + currentTime);
Greeter greeter = new Greeter();
System.out.println(greeter.sayHello());
}
}
@@ -0,0 +1,40 @@
package hello;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;
public class HelloWorldTests {
private ByteArrayOutputStream baos = new ByteArrayOutputStream();
private PrintStream ps = new PrintStream(baos);
@Before
public void setup() {
System.setOut(ps);
}
@Test
public void shouldPrintTimeToConsole() {
HelloWorld.main(new String[] { });
assertThat(output(), containsString("The current local time is"));
}
@Test
public void shouldPrintHelloWorldToConsole() {
HelloWorld.main(new String[] { });
assertThat(output(), containsString("Hello world!"));
}
private String output() {
return new String(baos.toByteArray(), StandardCharsets.UTF_8);
}
}