mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Update to the speed test.
This commit is contained in:
parent
2e972fcc9a
commit
18ef4dfec9
1 changed files with 24 additions and 9 deletions
|
@ -31,16 +31,31 @@ import org.eclipse.cdt.internal.core.parser.QuickParseCallback;
|
|||
*/
|
||||
public class SpeedTest extends TestCase {
|
||||
|
||||
public void test() throws Exception {
|
||||
String code =
|
||||
"#include <windows.h>\n" +
|
||||
"#include <stdio.h>\n" +
|
||||
"#include <iostream>\n";
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
new SpeedTest().runTest(1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Reader reader = new StringReader(code);
|
||||
IScannerInfo info = mingwScannerInfo(false);
|
||||
//IScannerInfo info = msvcScannerInfo(quick);
|
||||
testParse(reader, "text", false, info, ParserLanguage.CPP);
|
||||
public void test() throws Exception {
|
||||
runTest(1);
|
||||
}
|
||||
|
||||
public void runTest(int n) throws Exception {
|
||||
for (int i = 0; i < n; ++i) {
|
||||
System.gc();
|
||||
String code =
|
||||
"#include <windows.h>\n" +
|
||||
"#include <stdio.h>\n" +
|
||||
"#include <iostream>\n";
|
||||
|
||||
Reader reader = new StringReader(code);
|
||||
IScannerInfo info = mingwScannerInfo(false);
|
||||
//IScannerInfo info = msvcScannerInfo(quick);
|
||||
testParse(reader, "text", false, info, ParserLanguage.CPP);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue