Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2007-10-30 14:41:07 -0400
committerMarkus Schorn2007-10-30 14:41:07 -0400
commit73e2035f676900b7bfbbdd8a92144cc82661904c (patch)
treea3a47353c4cbfbb9df4e3fbec3fbbb54fcdfb447
parent4466a9e8193b8bcf2febf4f7fad18566aec0804e (diff)
downloadorg.eclipse.cdt-73e2035f676900b7bfbbdd8a92144cc82661904c.tar.gz
org.eclipse.cdt-73e2035f676900b7bfbbdd8a92144cc82661904c.tar.xz
org.eclipse.cdt-73e2035f676900b7bfbbdd8a92144cc82661904c.zip
Performance Test for the preprocessor
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/Scanner2SpeedTest.java9
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/SpeedTest2.java9
2 files changed, 10 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/Scanner2SpeedTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/Scanner2SpeedTest.java
index 349c4275158..9b0fabac317 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/Scanner2SpeedTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/Scanner2SpeedTest.java
@@ -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);
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/SpeedTest2.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/SpeedTest2.java
index 7ca8f33f279..19a458a56c7 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/SpeedTest2.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/SpeedTest2.java
@@ -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 );
}

Back to the top