Skip to content

Commit

Permalink
deqp: Make it possible to pass down --deqp-X arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Wallbraker committed Sep 5, 2019
1 parent d8a99a9 commit 5205a4f
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 27 deletions.
42 changes: 40 additions & 2 deletions src/deqp/config/args.volt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import watt = [
watt.text.getopt,
];

import watt.text.string : startsWith;

import deqp.io;
import deqp.driver;
import deqp.config.info;
Expand Down Expand Up @@ -134,9 +136,45 @@ fn parseArgs(settings: Settings, args: string[])
settings.printOpts.groups = false;
}

if (args.length > 1) {
info("Unknown argument '%s'", args[1]);
setIfFound(ref args, "deqp-surface-type", ref settings.deqpSurfaceType);
setIfFound(ref args, "deqp-log-images", ref settings.deqpLogImages);
setIfFound(ref args, "deqp-watchdog", ref settings.deqpWatchdog);
setIfFound(ref args, "deqp-visibility", ref settings.deqpVisibility);
setIfFound(ref args, "deqp-gl-config-name", ref settings.deqpConfig);
setIfFound(ref args, "deqp-surface-width", ref settings.deqpSurfaceWidth);
setIfFound(ref args, "deqp-surface-height", ref settings.deqpSurfaceHeight);

bad := false;
foreach (arg; args[1 .. $]) {
if (arg.startsWith("--deqp")) {
settings.deqpExtraArgs ~= arg;
} else {
info("Unknown argument '%s'", arg);
bad = true;
}
}

if (bad) {
printAllArgsAndConfig();
abort(" :: Exiting!");
}
}


private:

fn setIfFound(ref args: string[], arg: string, ref val: string)
{
string tmp;
if (watt.getopt(ref args, arg, ref tmp)) {
val = tmp;
}
}

fn setIfFound(ref args: string[], arg: string, ref val: bool)
{
tmp: bool;
if (watt.getopt(ref args, arg, ref tmp)) {
val = tmp;
}
}
36 changes: 22 additions & 14 deletions src/deqp/config/info.volt
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,33 @@ import deqp.config.parser;
fn printConfig(s: Settings)
{
info(" :: Config");
info("\tcolourTerm = %s", s.printOpts.colour);
info("\tprintFail = %s", s.printOpts.fail);
info("\tprintQuality = %s", s.printOpts.quality);
info("\tprintRegression = %s", s.printOpts.regression);
info("\tcolourTerm = %s", s.printOpts.colour);
info("\tprintFail = %s", s.printOpts.fail);
info("\tprintQuality = %s", s.printOpts.quality);
info("\tprintRegression = %s", s.printOpts.regression);

foreach (testNamesFile; s.testNamesFiles) {
info("\ttestNamesFile = %s", testNamesFile);
info("\ttestNamesFile = %s", testNamesFile);
}
foreach (regressionFile; s.regressionFiles) {
info("\tregressionFile = %s", regressionFile);
info("\tregressionFile = %s", regressionFile);
}
info("\tctsBuildDir = '%s'", s.ctsBuildDir);
info("\tbatchSize = %s%s", s.batchSize, s.batchSize == 0 ? " (smart mode)" : "");
info("\trandomize = %s", s.randomize);
info("\tthreads = %s", s.threads);
info("\tresultsFile = '%s'", s.resultsFile);
info("\ttempDir = '%s'", s.tempDir);
info("\tnoRerunTests = %s", s.noRerunTests);
info("\tnoPassedResults = %s", s.noPassedResults);
info("\tctsBuildDir = '%s'", s.ctsBuildDir);
info("\tbatchSize = %s%s", s.batchSize, s.batchSize == 0 ? " (smart mode)" : "");
info("\trandomize = %s", s.randomize);
info("\tthreads = %s", s.threads);
info("\tresultsFile = '%s'", s.resultsFile);
info("\ttempDir = '%s'", s.tempDir);
info("\tnoRerunTests = %s", s.noRerunTests);
info("\tnoPassedResults = %s", s.noPassedResults);
info("\tdeqpSurfaceType = %s", s.deqpSurfaceType);
info("\tdeqpLogImages = %s", s.deqpLogImages);
info("\tdeqpWatchdog = %s", s.deqpWatchdog);
info("\tdeqpVisibility = %s", s.deqpVisibility);
info("\tdeqpConfig = %s", s.deqpConfig);
info("\tdeqpSurfaceWidth = %s", s.deqpSurfaceWidth);
info("\tdeqpSurfaceHeight = %s", s.deqpSurfaceHeight);
info("\tdeqpExtraArgs = %s", s.deqpExtraArgs);
}

fn printAllArgsAndConfig()
Expand Down
18 changes: 18 additions & 0 deletions src/deqp/config/parser.volt
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,22 @@ fn parseConfigFile(s: Settings)
if (root.hasKey("groupUpdates")) {
s.printOpts.groups = root["groupUpdates"].boolean();
}

setIfFound(root, "deqpSurfaceType", ref s.deqpSurfaceType);
setIfFound(root, "deqpLogImages", ref s.deqpLogImages);
setIfFound(root, "deqpWatchdog", ref s.deqpWatchdog);
setIfFound(root, "deqpVisibility", ref s.deqpVisibility);
setIfFound(root, "deqpConfig", ref s.deqpConfig);
setIfFound(root, "deqpSurfaceWidth", ref s.deqpSurfaceWidth);
setIfFound(root, "deqpSurfaceHeight", ref s.deqpSurfaceHeight);
}


private:

fn setIfFound(root: toml.Value, key: string, ref val: string)
{
if (root.hasKey(key)) {
val = root[key].str();
}
}
9 changes: 9 additions & 0 deletions src/deqp/driver.volt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ public:

regressionFiles: string[];

deqpSurfaceType: string = "window";
deqpLogImages: string = "enable";
deqpWatchdog: string = "enable";
deqpVisibility: string = "hidden";
deqpConfig: string = "rgba8888d24s8ms0";
deqpSurfaceWidth: string = "256";
deqpSurfaceHeight: string = "256";
deqpExtraArgs: string[];

testsGL3: string[];
testsGL31: string[];
testsGL32: string[];
Expand Down
18 changes: 10 additions & 8 deletions src/deqp/tests/runner.volt
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,19 @@ public:

fn run(launcher: Launcher)
{
s := drv.settings;

args := [
"--deqp-stdin-caselist",
"--deqp-surface-type=window",
new "--deqp-gl-config-name=${suite.config}",
"--deqp-log-images=enable",
"--deqp-watchdog=enable",
"--deqp-visibility=hidden",
new "--deqp-surface-width=${suite.surfaceWidth}",
new "--deqp-surface-height=${suite.surfaceHeight}",
new "--deqp-surface-type=${s.deqpSurfaceType}",
new "--deqp-log-images=${s.deqpLogImages}",
new "--deqp-watchdog=${s.deqpWatchdog}",
new "--deqp-visibility=${s.deqpVisibility}",
new "--deqp-gl-config-name=${s.deqpConfig}",
new "--deqp-surface-width=${s.deqpSurfaceWidth}",
new "--deqp-surface-height=${s.deqpSurfaceHeight}",
new "--deqp-log-filename=${fileCtsLog}",
];
] ~ s.deqpExtraArgs;

console := new watt.OutputFileStream(fileConsole);

Expand Down
3 changes: 0 additions & 3 deletions src/deqp/tests/test.volt
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ public:
command: string;
runDir: string;
tempDir: string;
config: string = "rgba8888d24s8ms0";
surfaceWidth: u32 = 256;
surfaceHeight: u32 = 256;

tests: Test[];

Expand Down

0 comments on commit 5205a4f

Please sign in to comment.