p

scala.tools

partest

package partest

Source
package.scala
Linear Supertypes
AnyRef, Any
Content Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. partest
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait AsmNode[+T] extends AnyRef
  2. 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.

  3. 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.

  4. implicit final class Copier extends AnyVal
  5. abstract class DirectTest extends App

    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.

  6. type Directory = reflect.io.Directory
  7. implicit class ExecutorOps extends AnyRef
  8. type File = java.io.File
  9. implicit class FileOps extends AnyRef
  10. 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

  11. 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.

  12. abstract class JavapTest extends ReplTest

    A trait for testing repl's javap command or possibly examining its output.

  13. implicit final class LoaderOps extends AnyVal
  14. abstract class MemoryTest extends AnyRef
  15. 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.

  16. type Path = reflect.io.Path
  17. implicit class PathOps extends FileOps
  18. type PathResolver = util.PathResolver
  19. 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.

  20. type SFile = reflect.io.File
  21. abstract class ScaladocJavaModelTest extends ScaladocModelTest

    A class for testing scaladoc model generation on java sources.

  22. 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 = ".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")
      }
    }
  23. abstract class ScriptTest extends DirectTest

    A ScriptTest is a DirectTest for which the code is the contents of a script file.

  24. abstract class SecurityTest extends App
  25. 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.

  26. trait SigTest extends AnyRef

    Support code for testing signatures.

  27. trait StoreReporterDirectTest extends DirectTest
  28. type StringWriter = java.io.StringWriter
  29. trait StubErrorMessageTest extends DirectTest with StoreReporterDirectTest
  30. sealed abstract class TestState extends AnyRef
  31. trait TestUtil extends AnyRef
  32. implicit final class special string ops extends AnyVal

Value Members

  1. val ClassPath: nsc.util.ClassPath.type
  2. val Directory: reflect.io.Directory.type
  3. val EOL: String
  4. val Path: reflect.io.Path.type
  5. val PathResolver: util.PathResolver.type
  6. val SFile: File.type
  7. def allPropertiesString: String
  8. def basename(name: String): String
  9. def callable[T](body: ⇒ T): Callable[T]
  10. def canonicalizeSlashes(line: String): String
  11. implicit val codec: Codec
  12. def elapsedString(millis: Long): String
  13. def file2String(f: File): String
  14. def fileSeparator: String
  15. def findProgram(name: String): Option[File]
  16. implicit lazy val implicitConversions: implicitConversions
  17. def nljoin(xs: String*): String
  18. def now: String
  19. def oempty(xs: String*): collection.immutable.Seq[String]
  20. def ojoin(xs: String*): String
  21. def onull(s: String): String
  22. def pathSeparator: String
  23. def pathToTestIdent(path: Path): String
  24. implicit lazy val postfixOps: postfixOps
  25. 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.

  26. def setUncaughtHandler(): Unit
  27. val space: String
  28. implicit def stringPathToJavaFile(path: String): File
  29. implicit def temporaryPath2File(x: Path): File
  30. def timed[T](body: ⇒ T): (T, Long)
  31. def vmArgString: String
  32. def words(s: String): List[String]
  33. object ASMConverters

    Makes using ASM from ByteCodeTests more convenient.

    Makes using ASM from ByteCodeTests more convenient.

    Wraps ASM instructions in case classes so that equals and toString work for the purpose of bytecode diffing and pretty printing.

  34. object AsmNode
  35. object BytecodeTest
  36. object PartestDefaults
  37. object SessionTest
  38. object TestKinds
  39. object TestState
  40. object TestUtil extends TestUtil
  41. object Util

Inherited from AnyRef

Inherited from Any

Ungrouped