Ask the presentation compiler for completion at all locations
(in all sources) where the defined marker
is found.
Ask the presentation compiler for completion at all locations
(in all sources) where the defined marker
is found.
Ask the presentation compiler for hyperlink at all locations
(in all sources) where the defined marker
is found.
Ask the presentation compiler for hyperlink at all locations
(in all sources) where the defined marker
is found.
Ask the presentation compiler for type info at all locations
(in all sources) where the defined marker
is found.
Ask the presentation compiler for type info at all locations
(in all sources) where the defined marker
is found.
Add new presentation compiler actions to test.
Add new presentation compiler actions to test. Presentation compiler's test
need to extends trait PresentationCompilerTestDef
.
If there's a file ending in .
If there's a file ending in .opts, read it and parse it for cmd line arguments.
Presentation compiler's askXXX
actions work by doing side-effects
on a Response
instance passed as an argument during the askXXX
call.
Presentation compiler's askXXX
actions work by doing side-effects
on a Response
instance passed as an argument during the askXXX
call.
The defined method ask
is meant to encapsulate this behavior.
sources
need to be entirely parsed before running the test
(else commands such as AskCompletionAt
may fail simply because
the source's AST is not yet loaded).
sources
need to be entirely parsed before running the test
(else commands such as AskCompletionAt
may fail simply because
the source's AST is not yet loaded).
Reload the given source files and wait for them to be reloaded.
Reload the given source files and wait for them to be reloaded.
The base directory for this test, usually a subdirectory of "test/files/presentation/"
The base directory for this test, usually a subdirectory of "test/files/presentation/"
Load all sources before executing the test.
Load all sources before executing the test.
Test's entry point
The root directory for this test suite, usually the test kind ("test/files/presentation").
The root directory for this test suite, usually the test kind ("test/files/presentation").
Prepare the settings object.
Prepare the settings object. Load the .opts file and adjust all paths from the Unix-like syntax to the platform specific syntax. This is necessary so that a single .opts file can be used on all platforms.
Bootclasspath is treated specially. If there is a -bootclasspath option in the file, the 'usejavacp' setting is set to false. This ensures that the bootclasspath takes precedence over the scala-library used to run the current test.
Run all defined PresentationCompilerTestDef
Run all defined PresentationCompilerTestDef
shutdown the presentation compiler.
shutdown the presentation compiler.
Where source files are placed.
Where source files are placed.
collected source files that are to be used by the test runner
collected source files that are to be used by the test runner
Should askAllSources wait for each ask to finish before issuing the next?
Should askAllSources wait for each ask to finish before issuing the next?
The core set of test actions that are executed during each test run are
CompletionAction
, TypeAction
and HyperlinkAction
.
The core set of test actions that are executed during each test run are
CompletionAction
, TypeAction
and HyperlinkAction
.
Override this member if you need to change the default set of executed test actions.
(interactiveTest: StringAdd).self
(interactiveTest: StringFormat).self
(interactiveTest: ArrowAssoc[InteractiveTest]).x
(Since version 2.10.0) Use leftOfArrow
instead
(interactiveTest: Ensuring[InteractiveTest]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
A base class for writing interactive compiler tests.
This class tries to cover common functionality needed when testing the presentation compiler: instantiation source files, reloading, creating positions, instantiating the presentation compiler, random stress testing.
By default, this class loads all scala and java classes found under
src/
, going recursively into subfolders. Loaded classes are found insourceFiles
. traitTestResources
The presentation compiler is available throughcompiler
.It is easy to test member completion, type and hyperlinking at a given position. Source files are searched for
TextMarkers
. By default, the completion marker is/*!*/, the typedAt marker is
/*?*/ and the hyperlinking marker is/*#*/. Place these markers in your source files, and the test framework will automatically pick them up and test the corresponding actions. Sources are reloaded by
askReload(sourceFiles)(blocking call). All ask operations are placed on the work queue without waiting for each one to complete before asking the next. After all asks, it waits for each response in turn and prints the result. The default timeout is 1 second per operation.
To define a custom operation you have to:
(1) Define a new marker by extending
TestMarker
(2) Provide an implementation for the operation you want to check by extendingPresentationCompilerTestDef
(3) Add the class defined in (1) to the set of executed test actions by calling++
onInteractiveTest
.Then you can simply use the new defined
marker
in your test sources and the testing framework will automatically pick it up.Check existing tests under test/files/presentation