main

module main;


//! Instantiates a Driver and calls run.
fn main(args: string[]) i32 { }

deqp.tests.runner

//! Contains code and classes for running tests and reading back results.
module deqp.tests.runner;


//! A group of tests to be given to the testsuit.
class Group
{
public:
	drv: Driver;
	opts: PrintOptions;
	suite: Suite;
	start: u32;
	end: u32;
	filePrefix: string;
	fileCtsLog: string;
	fileConsole: string;
	fileTests: string;
	tests: Test[];
	timeStart: i64;
	timeStop: i64;
	//! Return value from runner.
	retval: i32;


public:
	this(drv: Driver, suite: Suite, tests: Test[], offset: u32, filePrefix: string, opts: PrintOptions) { }
	fn run(launcher: Launcher) { }
	fn writeTestsToFile() { }
}

struct GroupSink
{
public:
	enum MinSize;
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

fn dispatch(drv: Driver, suites: Suite[], opts: PrintOptions) { }

deqp.tests.info

//! Contains code to print out info lists.
module deqp.tests.info;


struct PrintOptions
{
public:
	colour: bool;
	groups: bool;
	regression: bool;
	quality: bool;
	fail: bool;
}

fn printResultsToStdout(opts: PrintOptions, suites: Suite[]) { }
fn printResultFromGroup(opts: PrintOptions, suite: Suite, tests: Test[], retval: i32, hasFailedTests: bool, start: u32, end: u32, time: string) { }

deqp.tests

//! Contains code and classes for parsing, managing and storing dEQP
//! tests.
module deqp.tests;

public import deqp.tests.test;
public import deqp.tests.info;
public import deqp.tests.result;
public import deqp.tests.parser;
public import deqp.tests.runner;

deqp.tests.parser

//! Contains code and classes for parsing dEQP tests.
module deqp.tests.parser;


//! Parse the given tests file.
fn parseTestFile(s: Settings) { }
fn parseAndCheckRegressions(suites: Suite[], filenames: string[]) i32 { }
fn parseResultsAndAssign(fileConsole: string, tests: Test[]) { }

deqp.tests.test

//! Contains class for tests organising them into test suits.
module deqp.tests.test;


class Suite
{
public:
	drv: Driver;
	api: string;
	suffix: string;
	command: string;
	runDir: string;
	tempDir: string;
	tests: Test[];


public:
	this(drv: Driver, buildDir: string, tempBaseDir: string, suffix: string, tests: string[]) { }
}

class CtsSuite : Suite
{
public:
	this(drv: Driver, buildDir: string, tempBaseDir: string, suffix: string, tests: string[]) { }
}

class KhrSuite : Suite
{
public:
	this(drv: Driver, buildDir: string, tempBaseDir: string, suffix: string, tests: string[]) { }
}

struct Test
{
public:
	fn name() string { }
	fn result() Result { }
	fn compare() Result { }
	fn started() bool { }
	fn result(r: Result) Result { }
	fn compare(r: Result) Result { }
	fn started(r: bool) bool { }
	fn hasImproved() bool { }
	fn hasRegressed() bool { }
	fn hasQualityChange() bool { }
	fn hasAnyChange() bool { }
	fn hasAnyChangeExceptNotListed() bool { }
	fn hasPassed() bool { }
	fn hasFailed() bool { }
	fn set(name: string) { }
}

deqp.tests.result

//! Contains code and classes for managing tests results.
module deqp.tests.result;


//! Big enum with all of the status that a test can return. Has extra
//! status to account for dEQP crashing.
enum Result
{
	Incomplete,
	Fail,
	NotSupported,
	InternalError,
	BadTerminate,
	BadTerminatePass,
	QualityWarning,
	CompatibilityWarning,
	Pass,
	//! Parser can parse the results.
	MalformedResult,
	//! For compare, the test wasn't in the regression file.
	NotListed,
}

struct Results
{
public:
	numFail: u32;
	numIncomplete: u32;
	numInternalError: u32;
	numNotSupported: u32;
	numBadTerminate: u32;
	numBadTerminatePass: u32;
	numPass: u32;
	numQualityWarning: u32;
	numCompatibilityWarning: u32;
	numMalformedResults: u32;
	suites: Suite[];


public:
	fn getPass() u32 { }
	fn getWarn() u32 { }
	fn getBad() u32 { }
	fn getSkip() u32 { }
	fn getIncomplete() u32 { }
	fn getTotal() u32 { }
	fn count() { }
}

fn isResultPassing(result: Result) bool { }
fn isResultFailing(result: Result) bool { }
fn isResultAndCompareImprovement(result: Result, compare: Result) bool { }
fn isResultAndCompareRegression(result: Result, compare: Result) bool { }
fn isResultAndCompareQualityChange(result: Result, compare: Result) bool { }
fn isResultAndCompareAnyChangeExceptNotListed(result: Result, compare: Result) bool { }
fn isResultAndCompareAnyChange(result: Result, compare: Result) bool { }

deqp.sinks

//! Helper struct to sink things.
module deqp.sinks;


struct StringsSink
{
public:
	enum MinSize;
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

deqp.driver

//! This file the main control logic for the dEQP runnering program.
module deqp.driver;


//! Settings for the dEQP runner program are grouped here.
class Settings
{
public:
	resultsFile: string;
	testNamesFiles: string[];
	ctsBuildDir: string;
	noRerunTests: bool;
	noPassedResults: bool;
	invokeWithGDB: bool;
	gdbCommand: string;
	printOpts: PrintOptions;
	batchSize: u32;
	randomize: u32;
	threads: u32;
	tempDir: string;
	regressionFiles: string[];
	deqpSurfaceType: string;
	deqpLogImages: string;
	deqpWatchdog: string;
	deqpVisibility: string;
	deqpConfig: string;
	deqpSurfaceWidth: string;
	deqpSurfaceHeight: string;
	deqpExtraArgs: string[];
	testsGL3: string[];
	testsGL31: string[];
	testsGL32: string[];
	testsGL33: string[];
	testsGL4: string[];
	testsGL41: string[];
	testsGL42: string[];
	testsGL43: string[];
	testsGL44: string[];
	testsGL45: string[];
	testsGL46: string[];
	testsGLES2: string[];
	testsGLES3: string[];
	testsGLES31: string[];


public:
	this() { }
}

//! This does not represent a graphics driver but code that houses logic
//! for driving the dEQP process from start to finish.
class Driver
{
public:
	enum Version;


public:
	settings: Settings;
	launcher: Launcher;
	results: Results;
	temporaryFiles: bool[string];


public:
	this() { }
	//! Main function, called from main.
	fn run(args: string[]) i32 { }
	//! Run all of the gathered tests.
	fn runTests() { }
	//! Fuzzyish logic for test rerunning.
	fn getRerunMask() u32 { }
	//! Rerun tests that have failed in a batch.
	fn rerunTests() { }
	//! Write out results into a format that is easy to parse.
	fn writeResults() { }
	//! Remove temporary files.
	fn removeTemporaryFiles() { }
	//! Adds the file to the lists of files to be removed after close.
	fn removeOnExit(file: string) string { }
	//! Don't remove the file on exit, this function allows you to regret
	//! adding a file to the remove list with removeOnExit.
	fn preserveOnExit(file: string) string { }
}

deqp.io

//! Houses small io related functions and classes.
module deqp.io;


fn warn(fmt: scope (watt.SinkArg)) { }
fn info(fmt: scope (watt.SinkArg)) { }
fn abort(fmt: scope (watt.SinkArg)) { }

deqp.config.info

//! Contains the code for info printing of the config, config file and for
//! args.
module deqp.config.info;


fn printConfig(s: Settings) { }
fn printAllArgsAndConfig() { }
fn checkArgs(settings: Settings) i32 { }

deqp.config

//! Contains modules for managing the testing configuration.
module deqp.config;

public import deqp.config.args;
public import deqp.config.info;
public import deqp.config.parser;

deqp.config.parser

//! This file holds code for reading the configuration file.
module deqp.config.parser;


enum ConfigFile;

fn parseConfigFile(s: Settings) { }

deqp.config.args

//! Contains the code for parsing args.
module deqp.config.args;


fn parseArgs(settings: Settings, args: string[]) { }

deqp.launcher

//! Launches and manages programs.
module deqp.launcher;

public import deqp.launcher.windows;
public import deqp.launcher.posix;

deqp.launcher.windows

//! Stub code to at least compile on windows.
module deqp.launcher.windows;

deqp.launcher.posix

//! Posix implementation of program launcher.
module deqp.launcher.posix;


//! Used to launch programs and managed launched programs.
class Launcher
{
public:
	this(numThreads: u32) { }
	//! Launch a program cmd with args and pipe input to it's standard input.
	//! Should the maximum number of threads been reached this function will
	//! block until one has completed.
	fn run(cmd: string, args: string[], input: string, console: watt.OutputFileStream, done: void delegate(i32)) { }
	//! Wait for all launched processes to complete.
	fn waitAll() { }
}