tool

package
v0.0.0-...-d4285bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2014 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package tool provides interfaces which tools must implement in order to be accepted into the Impendulo tool suite. These interfaces specify how a tool is run; what result it returns; and how the result is displayed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessError

func AccessError(e error) bool

AccessError checks whether an error is an access error.

func IsCompileError

func IsCompileError(e error) bool

IsCompileError checks whether an error is a CompileError.

func IsEndError

func IsEndError(e error) bool

IsEndError checks whether an error is an EndError.

func IsTimeout

func IsTimeout(e error) bool

IsTimeout checks whether an error is a timeout error.

func MemoryError

func MemoryError(e error) bool

MemoryError checks whether an error is a memory error.

func Supported

func Supported(l Language) bool

Types

type CompileError

type CompileError struct {
	// contains filtered or unexported fields
}

CompileError is used to indicate that compilation failed.

func NewCompileError

func NewCompileError(name, msg string) *CompileError

NewCompileError

func (*CompileError) Error

func (c *CompileError) Error() string

Error

type Compiler

type Compiler interface {
	//Name retrieves the Tool's name.
	Name() string
	//Lang retrieves the language which the Tool is used for.
	Lang() Language
	//Run runs the tool on a given file.
	Run(fileId bson.ObjectId, target *Target) (result.Tooler, error)
	AddCP(string)
}

type EndError

type EndError struct {
	// contains filtered or unexported fields
}

EndError is an error used to indicate that a command gave an error upon completion.

func (*EndError) Error

func (e *EndError) Error() string

Error

type Language

type Language string
const (
	JAVA Language = "Java"
	C    Language = "C"
	//The maximum size in bytes that a ToolResult is allowed to have.
	MAX_SIZE = 16000000
)

func Langs

func Langs() []Language

Langs returns the languages supported by Impendulo

type Result

type Result struct {
	StdOut, StdErr []byte
}

Result is the result of RunCommand.

func RunCommand

func RunCommand(args []string, stdin io.Reader, max time.Duration) (*Result, error)

RunCommand executes a given command given by args and stdin. It terminates when the command finishes execution or times out. A Result containing the command's output is returned.

func (*Result) HasStdErr

func (e *Result) HasStdErr() bool

HasStdErr checks whether the ExecResult has standard error output.

func (*Result) HasStdOut

func (e *Result) HasStdOut() bool

HasStdOut checks whether the ExecResult has standard output.

type StartError

type StartError struct {
	// contains filtered or unexported fields
}

StartError is an error used to indicate that a command failed to start.

func (*StartError) Error

func (s *StartError) Error() string

Error

type T

type T interface {
	//Name retrieves the Tool's name.
	Name() string
	//Lang retrieves the language which the Tool is used for.
	Lang() Language
	//Run runs the tool on a given file.
	Run(fileId bson.ObjectId, target *Target) (result.Tooler, error)
}

T is an interface which represents various analysis tools used in Impendulo.

type Target

type Target struct {
	Name    string
	Package string
	Ext     string
	Dir     string
	Lang    Language
}

Target stores information about the target file.

func NewTarget

func NewTarget(name, pkg, dir string, lang Language) *Target

NewTarget

func (*Target) Executable

func (t *Target) Executable() string

Executable retrieves the path to the compiled executable with its package.

func (*Target) FilePath

func (t *Target) FilePath() string

FilePath

func (*Target) FullName

func (t *Target) FullName() string

FullName

func (*Target) PackagePath

func (t *Target) PackagePath() string

PackagePath

func (*Target) String

func (t *Target) String() string

type TimeoutError

type TimeoutError struct {
	// contains filtered or unexported fields
}

TimeoutError is an error used to indicate that a command timed out.

func (*TimeoutError) Error

func (t *TimeoutError) Error() string

Error

type XMLError

type XMLError struct {
	// contains filtered or unexported fields
}

XMLError represents an error which occurred when attempting to unmarshall XML into a struct.

func NewXMLError

func NewXMLError(e error, origin string) *XMLError

NewXMLError

func (*XMLError) Error

func (x *XMLError) Error() string

Error

Directories

Path Synopsis
Package checkstyle is the Checkstyle static analysis tool's implementation of an Impendulo tool.
Package checkstyle is the Checkstyle static analysis tool's implementation of an Impendulo tool.
Package diff is used to run diffs on source files and provide the result in HTML.
Package diff is used to run diffs on source files and provide the result in HTML.
Package findbugs is the Findbugs static analysis tool's implementation of an Imendulo tool.
Package findbugs is the Findbugs static analysis tool's implementation of an Imendulo tool.
Package javac is the OpenJDK Java compiler's implementation of an Impendulo tool.
Package javac is the OpenJDK Java compiler's implementation of an Impendulo tool.
Package jpf is the Java Pathfinder verification system's implementation of an Impendulo tool.
Package jpf is the Java Pathfinder verification system's implementation of an Impendulo tool.
Package JUnit is the JUnit Java testing framework's implementation of an Impendulo tool.
Package JUnit is the JUnit Java testing framework's implementation of an Impendulo tool.
Package mongo is used to export/import collections from/to a mongo database.
Package mongo is used to export/import collections from/to a mongo database.
Package pmd is the PMD static analysis tool's implementation of an Impendulo tool.
Package pmd is the PMD static analysis tool's implementation of an Impendulo tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL