Following command line options MUST be used when running CTS:
- --deqp-caselist-file=<vulkancts>/external/vulkancts/mustpass/master/vk-default.txt
+ --deqp-caselist-file=<vulkancts>/external/vulkancts/mustpass/master/vk-default.txt (or vksc-default.txt for Vulkan SC implementations)
--deqp-log-images=disable
--deqp-log-shader-sources=disable
--deqp-subprocess-test-count=<value>
+Above mentioned parameter works as default value for all tests.
+You may also define how many tests are performed on a separate process
+for specific test tree branch using parameter:
+
+ --deqp-subprocess-cfg-file=<path>
+
+File should contain test pattern followed by numeric value, for example:
+dEQP-VKSC.api.copy_and_blit.core.image_to_image.dimensions.src32768x4_dst32768x4.*, 5
+dEQP-VKSC.texture.explicit_lod.2d.sizes.*, 20
+dEQP-VKSC.texture.explicit_lod.2d.sizes.128x128_*, 4
+
There is also one option used by CTS internally and should not be used manually.
It informs deqp-vksc application that it works as subprocess:
### Win32
- Vulkan:
+ Vulkan:
cd <builddir>/external/vulkancts/modules/vulkan
Debug\deqp-vk.exe --deqp-caselist-file=...
### Linux
- Vulkan:
+ Vulkan:
cd <builddir>/external/vulkancts/modules/vulkan
./deqp-vk --deqp-caselist-file=...
default: 'disable'
--deqp-subprocess-test-count=<value>
- Define number of tests performed in subprocess (Vulkan SC only)
- default: '64'
+ Define default number of tests performed in subprocess (Vulkan SC only)
+ default: '65536'
+
+ --deqp-subprocess-cfg-file=<path>
+ Config file defining number of tests performed in subprocess for specific test branches (Vulkan SC only)
+ default: ''
--deqp-server-address=<value>
Server address (host:port) responsible for shader compilation (Vulkan SC only)
// TestCaseExecutor
+#ifdef CTS_USES_VULKANSC
+struct DetailedSubprocessTestCount
+{
+ std::string testPattern;
+ int testCount;
+};
+#endif // CTS_USES_VULKANSC
+
class TestCaseExecutor : public tcu::TestCaseExecutor
{
public:
- TestCaseExecutor (tcu::TestContext& testCtx);
- ~TestCaseExecutor (void);
+ TestCaseExecutor (tcu::TestContext& testCtx);
+ ~TestCaseExecutor (void);
- void init (tcu::TestCase* testCase, const std::string& path) override;
- void deinit (tcu::TestCase* testCase) override;
+ void init (tcu::TestCase* testCase, const std::string& path) override;
+ void deinit (tcu::TestCase* testCase) override;
- tcu::TestNode::IterateResult iterate (tcu::TestCase* testCase) override;
+ tcu::TestNode::IterateResult iterate (tcu::TestCase* testCase) override;
- void deinitTestPackage (tcu::TestContext& testCtx) override;
- bool usesLocalStatus () override;
- void updateGlobalStatus (tcu::TestRunStatus& status) override;
- void reportDurations (tcu::TestContext& testCtx, const std::string& packageName, const deInt64& duration, const std::map<std::string, deUint64>& groupsDurationTime) override;
+ void deinitTestPackage (tcu::TestContext& testCtx) override;
+ bool usesLocalStatus () override;
+ void updateGlobalStatus (tcu::TestRunStatus& status) override;
+ void reportDurations (tcu::TestContext& testCtx, const std::string& packageName, const deInt64& duration, const std::map<std::string, deUint64>& groupsDurationTime) override;
+ int getCurrentSubprocessCount (const std::string& casePath, int defaultSubprocessCount);
private:
- void logUnusedShaders (tcu::TestCase* testCase);
+ void logUnusedShaders (tcu::TestCase* testCase);
- void runTestsInSubprocess(tcu::TestContext& testCtx);
+ void runTestsInSubprocess (tcu::TestContext& testCtx);
- bool spirvVersionSupported(vk::SpirvVersion);
+ bool spirvVersionSupported (vk::SpirvVersion);
vk::BinaryCollection m_progCollection;
vk::BinaryRegistryReader m_prebuiltBinRegistry;
#ifdef CTS_USES_VULKANSC
std::unique_ptr<vksc_server::ipc::Parent> m_parentIPC;
-#endif
+ std::vector<DetailedSubprocessTestCount> m_detailedSubprocessTestCount;
+#endif // CTS_USES_VULKANSC
};
#ifdef CTS_USES_VULKANSC
static deBool openWriteFtm (int type, const char* format, va_list args) { DE_UNREF(type); DE_UNREF(format); DE_UNREF(args); return true; }
static void suppressStandardOutput () { qpRedirectOut(supressedWrite, supressedWriteFtm); }
static void restoreStandardOutput () { qpRedirectOut(openWrite, openWriteFtm); }
-#endif
+#endif // CTS_USES_VULKANSC
static MovePtr<vk::Library> createLibrary (tcu::TestContext& testCtx)
{
return properties;
}
+std::string trim (const std::string& original)
+{
+ static const std::string whiteSigns = " \t";
+ const auto beg = original.find_first_not_of(whiteSigns);
+ if (beg == std::string::npos)
+ return std::string();
+ const auto end = original.find_last_not_of(whiteSigns);
+ return original.substr(beg, end - beg + 1);
+}
+
TestCaseExecutor::TestCaseExecutor (tcu::TestContext& testCtx)
: m_prebuiltBinRegistry (testCtx.getArchive(), "vulkan/prebuilt")
, m_library (createLibrary(testCtx))
m_parentIPC.reset( new vksc_server::ipc::Parent{portOffset} );
}
+ // Load information about test tree branches that use subprocess test count other than default
+ // Expected file format:
+ if (!testCtx.getCommandLine().isSubProcess() && !std::string(testCtx.getCommandLine().getSubprocessConfigFile()).empty())
+ {
+ std::ifstream iFile(testCtx.getCommandLine().getSubprocessConfigFile(), std::ios::in);
+ if (!iFile)
+ TCU_THROW(InternalError, (std::string("Missing config file defining number of tests: ") + testCtx.getCommandLine().getSubprocessConfigFile()).c_str());
+ std::string line;
+ while (std::getline(iFile, line))
+ {
+ if (line.empty())
+ continue;
+ std::size_t pos = line.find_first_of(',');
+ if (pos == std::string::npos)
+ continue;
+ std::string testPattern, testNumber;
+ std::copy(line.begin(), line.begin() + pos, std::back_inserter(testPattern));
+ testPattern = trim(testPattern);
+ std::copy(line.begin() + pos + 1, line.end(), std::back_inserter(testNumber));
+ testNumber = trim(testNumber);
+ if (testPattern.empty() || testNumber.empty())
+ continue;
+ std::istringstream is(testNumber);
+ int testCount;
+ if ((is >> testCount).fail())
+ continue;
+ m_detailedSubprocessTestCount.push_back(DetailedSubprocessTestCount{ testPattern, testCount });
+ }
+ // sort test patterns
+ std::sort(m_detailedSubprocessTestCount.begin(), m_detailedSubprocessTestCount.end(), [](const DetailedSubprocessTestCount& lhs, const DetailedSubprocessTestCount& rhs)
+ {
+ return lhs.testCount < rhs.testCount;
+ } );
+ }
+
// If we are provided with remote location
if (!std::string(testCtx.getCommandLine().getServerAddress()).empty())
{
#ifdef CTS_USES_VULKANSC
if (!m_context->getTestContext().getCommandLine().isSubProcess())
{
- if (m_testsForSubprocess.size() >= std::size_t(m_context->getTestContext().getCommandLine().getSubprocessTestCount()) )
+ int currentSubprocessCount = getCurrentSubprocessCount(m_context->getResourceInterface()->getCasePath(), m_context->getTestContext().getCommandLine().getSubprocessTestCount());
+ if (m_testsForSubprocess.size() >= std::size_t(currentSubprocessCount) )
{
runTestsInSubprocess(m_context->getTestContext());
}
+int TestCaseExecutor::getCurrentSubprocessCount(const std::string& casePath, int defaultSubprocessCount)
+{
+#ifdef CTS_USES_VULKANSC
+ for (const auto& detailed : m_detailedSubprocessTestCount)
+ if (tcu::matchWildcards(detailed.testPattern.begin(), detailed.testPattern.end(), casePath.begin(), casePath.end(), false))
+ return detailed.testCount;
+#else
+ DE_UNREF(casePath);
+#endif // CTS_USES_VULKANSC
+ return defaultSubprocessCount;
+}
+
void TestCaseExecutor::runTestsInSubprocess (tcu::TestContext& testCtx)
{
#ifdef CTS_USES_VULKANSC
DE_DECLARE_COMMAND_LINE_OPT(TerminateOnFail, bool);
DE_DECLARE_COMMAND_LINE_OPT(SubProcess, bool);
DE_DECLARE_COMMAND_LINE_OPT(SubprocessTestCount, int);
+DE_DECLARE_COMMAND_LINE_OPT(SubprocessConfigFile, std::string);
DE_DECLARE_COMMAND_LINE_OPT(ServerAddress, std::string);
DE_DECLARE_COMMAND_LINE_OPT(CommandPoolMinSize, int);
DE_DECLARE_COMMAND_LINE_OPT(CommandDefaultSize, int);
<< Option<RunnerType> (DE_NULL, "deqp-runner-type", "Filter test cases based on runner", s_runnerTypes, "any")
<< Option<TerminateOnFail> (DE_NULL, "deqp-terminate-on-fail", "Terminate the run on first failure", s_enableNames, "disable")
<< Option<SubProcess> (DE_NULL, "deqp-subprocess", "Inform app that it works as subprocess (Vulkan SC only, do not use manually)", s_enableNames, "disable")
- << Option<SubprocessTestCount> (DE_NULL, "deqp-subprocess-test-count", "Define number of tests performed in subprocess (Vulkan SC only)", "64")
+ << Option<SubprocessTestCount> (DE_NULL, "deqp-subprocess-test-count", "Define default number of tests performed in subprocess for specific test cases(Vulkan SC only)", "65536")
+ << Option<SubprocessConfigFile> (DE_NULL, "deqp-subprocess-cfg-file", "Config file defining number of tests performed in subprocess for specific test branches (Vulkan SC only)", "")
<< Option<ServerAddress> (DE_NULL, "deqp-server-address", "Server address (host:port) responsible for shader compilation (Vulkan SC only)", "")
<< Option<CommandPoolMinSize> (DE_NULL, "deqp-command-pool-min-size", "Define minimum size of the command pool (in bytes) to use (Vulkan SC only)","0")
<< Option<CommandDefaultSize> (DE_NULL, "deqp-command-default-size", "Define default single command size (in bytes) to use (Vulkan SC only)", "256")
return DE_NULL;
}
+const char* CommandLine::getSubprocessConfigFile (void) const
+{
+ if (m_cmdLine.hasOption<opt::SubprocessConfigFile>())
+ return m_cmdLine.getOption<opt::SubprocessConfigFile>().c_str();
+ else
+ return DE_NULL;
+}
+
+
const char* CommandLine::getServerAddress (void) const
{
if (m_cmdLine.hasOption<opt::ServerAddress>())