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

Package Members

  1. package instrumented
  2. package nest
  3. package sbt
  4. package utils

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. class ConsoleLog extends AnyRef
  5. implicit final class Copier extends AnyVal
  6. 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.

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

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

  13. abstract class JavapTest extends ReplTest

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

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

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

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

    A class for testing scaladoc model generation on java sources.

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

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

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

  27. trait SigTest extends AnyRef

    Support code for testing signatures.

  28. trait StoreReporterDirectTest extends DirectTest
  29. type StringWriter = java.io.StringWriter
  30. trait StubErrorMessageTest extends DirectTest with StoreReporterDirectTest
  31. class TestKinds extends AnyRef
  32. sealed abstract class TestState extends AnyRef
  33. class TestUnderJavaAtLeast[A] extends AnyRef
  34. trait TestUtil extends AnyRef
  35. 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. implicit val codec: Codec
  11. def debugSettings: String
  12. def elapsedString(millis: Long): String
  13. def file2String(f: File): String
  14. def fileSeparator: String
  15. def findProgram(name: String): Option[File]
  16. def ifJavaAtLeast[A](version: String)(yesRun: => A): TestUnderJavaAtLeast[A]
  17. implicit lazy val implicitConversions: implicitConversions
  18. def isDebug: Boolean

    Debugger interest only below this line *

  19. def log(msg: => Any): Unit
  20. def nljoin(xs: String*): String
  21. def now: String
  22. def oempty(xs: String*): collection.immutable.Seq[String]
  23. def ojoin(xs: String*): String
  24. def onull(s: String): String
  25. def pathSeparator: String
  26. 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.

  27. def setUncaughtHandler(): Unit
  28. val space: String
  29. implicit def stringPathToJavaFile(path: String): File
  30. implicit def temporaryPath2File(x: Path): File
  31. def timed[T](body: => T): (T, Long)
  32. def vmArgString: String
  33. def words(s: String): List[String]
  34. object AsmNode
  35. object BytecodeTest
  36. object PartestDefaults
  37. object SessionTest
  38. object TestState
  39. object TestUtil extends TestUtil
  40. object Util

Inherited from AnyRef

Inherited from Any

Ungrouped