package partest
- Alphabetic
- By Inheritance
- partest
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed trait AsmNode[+T] extends AnyRef
- abstract class BytecodeTest extends AnyRef
Provides utilities for inspecting bytecode using ASM library.
Provides utilities for inspecting bytecode using ASM library.
HOW TO USE 1. Create subdirectory in test/files/jvm for your test. Let's name it $TESTDIR. 2. Create $TESTDIR/BytecodeSrc_1.scala that contains Scala source file that you want to inspect the bytecode for. The '_1' suffix signals to partest that it should compile this file first. 3. Create $TESTDIR/Test.scala: import scala.tools.partest.BytecodeTest object Test extends BytecodeTest { def show { // your code that inspect ASM trees and prints values } } 4. Create corresponding check file.
EXAMPLE See test/files/jvm/bytecode-test-example for an example of bytecode test.
- abstract class CompilerTest extends DirectTest
For testing compiler internals directly.
For testing compiler internals directly. Each source code string in "sources" will be compiled, and the check function will be called with the source code and the resulting CompilationUnit. The check implementation should test for what it wants to test and fail (via assert or other exception) if it is not happy.
- class ConsoleLog extends AnyRef
- implicit final class Copier extends AnyVal
- abstract class DirectTest extends AnyRef
A class for testing code which is embedded as a string.
A class for testing code which is embedded as a string. It allows for more complete control over settings, compiler configuration, sequence of events, etc. than does partest.
- type Directory = reflect.io.Directory
- implicit class ExecutorOps extends AnyRef
- type File = java.io.File
- implicit class FileOps extends AnyRef
- abstract class IcodeComparison extends DirectTest
A class for testing icode.
A class for testing icode. All you need is this in a partest source file --
object Test extends IcodeComparison
-- and the generated output will be the icode for everything in that file. See scaladoc for possible customizations. TODO promote me to partest
- abstract class IcodeTest extends DirectTest
A trait for testing icode.
A trait for testing icode. All you need is this in a partest source file:
object Test extends IcodeTest
And then the generated output will be the icode for everything in that file. See source for possible customizations.
- abstract class JavapTest extends ReplTest
A trait for testing repl's javap command or possibly examining its output.
- implicit final class LoaderOps extends AnyVal
- abstract class MemoryTest extends AnyRef
- abstract class ParserTest extends DirectTest
A class for testing parser output.
A class for testing parser output. Just supply the
code
and update the check file. - type Path = reflect.io.Path
- implicit class PathOps extends FileOps
- type PathResolver = util.PathResolver
- abstract class ReplTest extends DirectTest
A class for testing repl code.
A class for testing repl code. It filters the line of output that mentions a version number.
- type SFile = reflect.io.File
- abstract class ScaladocJavaModelTest extends ScaladocModelTest
A class for testing scaladoc model generation on java sources.
- abstract class ScaladocModelTest extends DirectTest
A class for testing scaladoc model generation
A class for testing scaladoc model generation
- you need to specify the code in the
code
method - you need to override the testModel method to test the model
- you may specify extra parameters to send to scaladoc in
scaladocSettings
import scala.tools.nsc.doc.model._ import scala.tools.partest.ScaladocModelTest object Test extends ScaladocModelTest { override def code = """ ... """ // or override def resourceFile = "<file>.scala" (from test/scaladoc/resources) def scaladocSettings = " ... " def testModel(rootPackage: Package) = { // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s)) import access._ // just need to check the member exists, access methods will throw an error if there's a problem rootPackage._package("scala")._package("test")._class("C")._method("foo") } }
- you need to specify the code in the
- abstract class ScriptTest extends DirectTest
A
ScriptTest
is aDirectTest
for which the code is the contents of a script file. - abstract class SecurityTest extends App
- abstract class SessionTest extends ReplTest
Run a REPL test from a session transcript.
Run a REPL test from a session transcript. The
session
is read from the.check
file. - trait SigTest extends AnyRef
Support code for testing signatures.
- trait StoreReporterDirectTest extends DirectTest
- type StringWriter = java.io.StringWriter
- trait StubErrorMessageTest extends DirectTest with StoreReporterDirectTest
- class TestKinds extends AnyRef
- sealed abstract class TestState extends AnyRef
- class TestUnderJavaAtLeast[A] extends AnyRef
- trait TestUtil extends AnyRef
- implicit final class special string ops extends AnyVal
Value Members
- val ClassPath: nsc.util.ClassPath.type
- val Directory: reflect.io.Directory.type
- val EOL: String
- val Path: reflect.io.Path.type
- val PathResolver: util.PathResolver.type
- val SFile: File.type
- def allPropertiesString: String
- def basename(name: String): String
- def callable[T](body: => T): Callable[T]
- implicit val codec: Codec
- def debugSettings: String
- def elapsedString(millis: Long): String
- def file2String(f: File): String
- def fileSeparator: String
- def findProgram(name: String): Option[File]
- def ifJavaAtLeast[A](version: String)(yesRun: => A): TestUnderJavaAtLeast[A]
- implicit lazy val implicitConversions: implicitConversions
- def isDebug: Boolean
Debugger interest only below this line *
- def log(msg: => Any): Unit
- def nljoin(xs: String*): String
- def now: String
- def oempty(xs: String*): collection.immutable.Seq[String]
- def ojoin(xs: String*): String
- def onull(s: String): String
- def pathSeparator: String
- def readOptionsFile(file: File): List[String]
In order to allow for spaces in flags/options, this parses .flags, .javaopts, javacopts etc files as follows: If it is exactly one line, it is split (naively) on spaces.
In order to allow for spaces in flags/options, this parses .flags, .javaopts, javacopts etc files as follows: If it is exactly one line, it is split (naively) on spaces. If it contains more than one line, each line is its own token, spaces and all.
- def setUncaughtHandler(): Unit
- val space: String
- implicit def stringPathToJavaFile(path: String): File
- implicit def temporaryPath2File(x: Path): File
- def timed[T](body: => T): (T, Long)
- def vmArgString: String
- def words(s: String): List[String]
- object AsmNode
- object BytecodeTest
- object PartestDefaults
- object SessionTest
- object TestState
- object TestUtil extends TestUtil
- object Util