From b1e0a71997111fc296001bc94e0da8342cf0ac97 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Wed, 18 Apr 2018 16:24:48 +0200 Subject: Add option to override comparison fuzziness level to lancelot tests Sometimes useful to force e.g. an exact match. Change-Id: Ic417a518d91b579c23dea925f747955f11d4143b Reviewed-by: Andy Nichols Reviewed-by: Allan Sandfeld Jensen --- tests/baselineserver/shared/qbaselinetest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/baselineserver') diff --git a/tests/baselineserver/shared/qbaselinetest.cpp b/tests/baselineserver/shared/qbaselinetest.cpp index 58c4cae176..11fb208f20 100644 --- a/tests/baselineserver/shared/qbaselinetest.cpp +++ b/tests/baselineserver/shared/qbaselinetest.cpp @@ -72,6 +72,16 @@ void handleCmdLineArgs(int *argcp, char ***argvp) if (arg == "-simfail") { simfail = true; + } else if (arg == "-fuzzlevel") { + i++; + bool ok = false; + (void)nextArg.toInt(&ok); + if (!ok) { + qWarning() << "-fuzzlevel requires integer parameter"; + showHelp = true; + break; + } + customInfo.insert("FuzzLevel", QString::fromLatin1(nextArg)); } else if (arg == "-auto") { customAutoModeSet = true; customInfo.setAdHocRun(false); @@ -111,6 +121,7 @@ void handleCmdLineArgs(int *argcp, char ***argvp) QTextStream out(stdout); out << "\n Baseline testing (lancelot) options:\n"; out << " -simfail : Force an image comparison mismatch. For testing purposes.\n"; + out << " -fuzzlevel : Specify the percentage of fuzziness in comparison. Overrides server default. 0 means exact match.\n"; out << " -auto : Inform server that this run is done by a daemon, CI system or similar.\n"; out << " -adhoc (default) : The inverse of -auto; this run is done by human, e.g. for testing.\n"; out << " -setbaselines : Store ALL rendered images as new baselines. Forces replacement of previous baselines.\n"; -- cgit v1.2.3