mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Performance Test for the preprocessor
This commit is contained in:
parent
4466a9e819
commit
73e2035f67
2 changed files with 10 additions and 8 deletions
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.eclipse.cdt.core.parser.tests.scanner2;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.util.Collections;
|
||||
|
||||
|
@ -43,10 +44,10 @@ public class Scanner2SpeedTest extends SpeedTest2 {
|
|||
public static void main(String[] args) {
|
||||
try {
|
||||
PrintStream stream = null;
|
||||
// if (args.length > 0)
|
||||
// stream = new PrintStream(new FileOutputStream("c:/tmp/dom.txt"));
|
||||
if (args.length > 0)
|
||||
stream = new PrintStream(new FileOutputStream(args[0]));
|
||||
|
||||
new Scanner2SpeedTest().runTest(stream, 30);
|
||||
new Scanner2SpeedTest().runTest(stream, 1);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
}
|
||||
|
@ -68,7 +69,7 @@ public class Scanner2SpeedTest extends SpeedTest2 {
|
|||
"#include <iostream>\n";
|
||||
|
||||
CodeReader reader = new CodeReader(code.toCharArray());
|
||||
IScannerInfo info = msvcScannerInfo(false);
|
||||
IScannerInfo info = getScannerInfo(false);
|
||||
long totalTime = 0;
|
||||
for (int i = 0; i < n; ++i) {
|
||||
long time = testScan(reader, false, info, ParserLanguage.CPP);
|
||||
|
|
|
@ -122,16 +122,17 @@ public class SpeedTest2 extends TestCase {
|
|||
return mingwScannerInfo(false);
|
||||
}
|
||||
|
||||
protected IScannerInfo msvcScannerInfo(boolean quick) {
|
||||
private IScannerInfo msvcScannerInfo(boolean quick) {
|
||||
if( quick )
|
||||
return new ScannerInfo();
|
||||
Map definitions = new Hashtable();
|
||||
//definitions.put( "__GNUC__", "3" ); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
String [] includePaths = new String[] {
|
||||
"C:\\Program Files\\Microsoft Visual Studio\\VC98\\Include"
|
||||
// "C:\\Program Files\\Microsoft Platform SDK\\Include",
|
||||
// "C:\\Program Files\\Microsoft Visual C++ Toolkit 2003\\include"
|
||||
"C:\\Program Files\\Microsoft SDK\\Include",
|
||||
"C:\\Program Files\\Microsoft Visual C++ Toolkit 2003\\include"
|
||||
|
||||
// "C:\\Program Files\\Microsoft Visual Studio\\VC98\\Include"
|
||||
};
|
||||
return new ScannerInfo( definitions, includePaths );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue