diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-03-25 14:08:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-25 14:08:21 -0400 |
| commit | 28a0ca96a1ad2a3f0e09cc97b866f3b6338a09fa (patch) | |
| tree | 271232cf6aa1917c23298d3dc1dc995ef65832f9 /tools/slang-test | |
| parent | 889132e7e3c79ae364fa3882646861e5b14df503 (diff) | |
Better diagnostics on failure on CUDA. (#1288)
* Better diagnostics on failure on CUDA.
* Catch exceptions in render-test
* * Added ability to disable reporting on CUDA failures
* Stopped using exception for reporting (just write to StdWriter::out()
* Removed CUDAResult type
* Don't set arch type on nvrtc to see if fixes CI issues.
* Try compute_30 on CUDA.
* Added ability to IGNORE_ a test
DIsabled rw-texture-simple and texture-get-dimensions
* Disable tests that require CUDA SM7.0
Use DISABLE_ prefix to disable tests.
* Disable signalUnexpectedError doing printf.
Diffstat (limited to 'tools/slang-test')
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index a85516941..a2e3296c9 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -54,6 +54,7 @@ struct TestOptions // The categories that this test was assigned to List<TestCategory*> categories; + bool isEnabled = true; bool isSynthesized = false; }; @@ -303,6 +304,8 @@ static TestResult _gatherTestOptions( { case 0: case '\r': case '\n': skipToEndOfLine(&cursor); + + *ioCursor = cursor; return TestResult::Pass; default: @@ -348,7 +351,6 @@ TestResult gatherTestsForFile( return TestResult::Fail; } - // Walk through the lines of the file, looking for test commands char const* cursor = fileContents.begin(); @@ -358,24 +360,33 @@ TestResult gatherTestsForFile( skipHorizontalSpace(&cursor); + if(!match(&cursor, "//")) + { + skipToEndOfLine(&cursor); + continue; + } + // Look for a pattern that matches what we want - if(match(&cursor, "//TEST_IGNORE_FILE")) + if (match(&cursor, "TEST_IGNORE_FILE")) { return TestResult::Ignored; } - else if(match(&cursor, "//TEST")) + + TestDetails testDetails; + if (match(&cursor, "DISABLE_")) { - TestDetails testDetails; + testDetails.options.isEnabled = false; + } + if(match(&cursor, "TEST")) + { if(_gatherTestOptions(categorySet, &cursor, testDetails.options) != TestResult::Pass) return TestResult::Fail; testList->tests.add(testDetails); } - else if (match(&cursor, "//DIAGNOSTIC_TEST")) + else if (match(&cursor, "DIAGNOSTIC_TEST")) { - TestDetails testDetails; - if (_gatherTestOptions(categorySet, &cursor, testDetails.options) != TestResult::Pass) return TestResult::Fail; @@ -2779,9 +2790,15 @@ static void _calcSynthesizedTests(TestContext* context, RenderApiType synthRende } } -static bool _canIgnore(TestContext* context, - const TestRequirements& requirements) +static bool _canIgnore(TestContext* context, const TestDetails& details) { + if (details.options.isEnabled == false) + { + return true; + } + + const auto& requirements = details.requirements; + // Work out what render api flags are available const RenderApiFlags availableRenderApiFlags = requirements.usedRenderApiFlags ? _getAvailableRenderApiFlags(context) : 0; @@ -2933,7 +2950,7 @@ void runTestsOnFile( TestResult testResult = TestResult::Fail; // If this test can be ignored - if (_canIgnore(context, testDetails.requirements)) + if (_canIgnore(context, testDetails)) { testResult = TestResult::Ignored; } |
