compileandrun

package
v0.0.0-...-b09b15f Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package compileandrun : package for testing the compiled programming languages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Init

type Init struct {
	Solution     int         // -- number of tested solution
	Format       string      // -- solution file format (with a dot)
	Path         string      // -- path to the solution file
	Compiler     string      // -- chosen compiler
	CompilerArgs []string    // -- compiler command line arguments
	CompilerAttr os.ProcAttr // -- compiler attributes
	TestsPath    string      // -- path to tests data files
	TestsNumber  int         // -- number of tests
	RunArgs      []string    // -- run command line arguments
	RunAttr      os.ProcAttr // -- run attributes
	RequiredRet  int         // -- required return value
	RunLimits    Limits      // -- run program limits
}

Init : Initializing structure

func (*Init) Compile

func (c *Init) Compile() (p *os.Process, err error)

Compile : Method that compiles source code into the binary file in ".elf" format. The source must be named like "sol_<solution_number><format>", where <format> matches the chosen programming language. The resuling binary file will be named like "res_<solution_number>.elf"

func (*Init) Run

func (c *Init) Run() (err error)

Run runs the binary file like "res_<solution_number>.elf". It uses tests from Init.TestsPath like input if RunAttr.Files == <nil>. Running for different tests is doing in different goroutines

type Limits

type Limits struct {
	TL  time.Duration // -- time limit
	RTL time.Duration // -- real time limit
	ML  int64         // -- memory limit
}

Limits : Structure with limits of a run

type Result

type Result struct {
	TestNumber    int     // -- number of used test
	ReturnedValue int     // -- value returned from the process
	Time          float64 // -- used time
	Memory        int64   // -- used memory
	Verdict       string  // -- result of limits and returned value checking
	Checker       string  // -- result of answer checking
}

Result : Reporting structure

Jump to

Keyboard shortcuts

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