From 2ae253bea6401f26dddf0c3b78b4e40aefbd0b18 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Mon, 16 Jul 2012 11:22:40 +0200 Subject: Partest: add `instrumented` test category. --- (taken from README) Tests in `instrumented/` directory are executed the same way as in `run/` but they have additional byte-code instrumentation performed for profiling. You should put your tests in `instrumented/` directory if you are interested in method call counts. Examples include tests for specialization (you want to count boxing and unboxing method calls) or high-level tests for optimizer where you are interested if methods are successfuly inlined (so they should not be called at runtime) or closures are eliminated (so no constructors of closures are called). Check `scala.tools.partest.instrumented.Instrumentation` to learn how to use the instrumentation infrastructure. The instrumentation itself is achieved by attaching a Java agent to the forked VM process that injects calls to profiler. Check `scala.tools.partest.javaagent.ProfilingAgent` for details. --- A few notes on low-level details of this change: * Partest now depends on asm library for byte-code instrumentation (`build.xml`) * Build additional jar called `scala-partest-javaagent.jar` that is used with `-javaagent:` option. (`build.xml`) * Set `-javaagent:` option for all tests in `instrumented/` directory. (`RunnerManger.scala`) * Introduce a new category of tests called `instrumented`. * Add one instrumented test to demonstrate usage and test new infrastructure itself. (`InstrumentationTest.scala`) Review by @phaller. --- build.xml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'build.xml') diff --git a/build.xml b/build.xml index 0e0bda934a..8fa1b9cd76 100644 --- a/build.xml +++ b/build.xml @@ -1337,7 +1337,7 @@ QUICK BUILD (QUICK) - + @@ -1356,6 +1356,7 @@ QUICK BUILD (QUICK) + @@ -1575,7 +1576,14 @@ PACKED QUICK BUILD (PACK) - + + + + + + + + @@ -1974,7 +1982,7 @@ BOOTSTRAPPING BUILD (STRAP) - + @@ -1993,6 +2001,7 @@ BOOTSTRAPPING BUILD (STRAP) + @@ -2012,6 +2021,7 @@ BOOTSTRAPPING BUILD (STRAP) + @@ -2393,6 +2403,9 @@ BOOTRAPING TEST AND TEST SUITE + + + -- cgit v1.2.3