mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
test to run SpecsDetectors globally without a project
This commit is contained in:
parent
e101cace9e
commit
c82202c144
1 changed files with 22 additions and 0 deletions
|
@ -335,6 +335,28 @@ public class GCCBuiltinSpecsDetectorTest extends TestCase {
|
|||
assertEquals(expected, entries.get(0));
|
||||
}
|
||||
|
||||
public void testAbstractBuiltinSpecsDetector_RunGlobal() throws Exception {
|
||||
AbstractBuiltinSpecsDetector detector = new GCCBuiltinSpecsDetector() {
|
||||
@Override
|
||||
protected boolean runProgram(String command, String[] env, IPath workingDirectory, IProgressMonitor monitor,
|
||||
OutputStream consoleOut, OutputStream consoleErr) throws CoreException, IOException {
|
||||
printLine(consoleOut, "#define MACRO VALUE");
|
||||
consoleOut.close();
|
||||
consoleErr.close();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
detector.setLanguageScope(new ArrayList<String>() {{add(LANGUAGE_ID);}});
|
||||
|
||||
detector.run((IProject)null, LANGUAGE_ID, null, null, null);
|
||||
assertFalse(detector.isEmpty());
|
||||
|
||||
List<ICLanguageSettingEntry> entries = detector.getSettingEntries(null, null, LANGUAGE_ID);
|
||||
ICLanguageSettingEntry expected = new CMacroEntry("MACRO", "VALUE", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY);
|
||||
assertEquals(expected, entries.get(0));
|
||||
}
|
||||
|
||||
public void testAbstractBuiltinSpecsDetector_RunOnce() throws Exception {
|
||||
// Create model project and accompanied descriptions
|
||||
String projectName = getName();
|
||||
|
|
Loading…
Add table
Reference in a new issue