From 3cbc500118d27f82c89f401ffb34826264e9cb60 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Wed, 18 Jun 2025 16:38:39 -0700 Subject: Fix retry logic for unit test (#7471) * Fix the ignored unit-tests on retry * Retrigger CI * Add more error messages * Don't use test-server for retry of unit-test to see error messages * Clean up cl.yml Remove 'has-gpu' because it is unused after debug became full-gpu-test. Renamed files to make the meaning more clear: - Renamed expected-failure.txt to expected-failure-via-glsl.txt - Renamed expected-failure-github-runner.txt to expected-failure-no-gpu.txt * Rename cpu-hello-world.slang to avoid name conflict to example We have an example whose executable name is cpu-hello-world.exe. It gets built when you run `cmake --build`, but it gets overwritten by slang-test when it tests `tests/cpu-program/cpu-hello-world.slang`. This PR renames to avoid the name conflict. * Remove debug code --------- Co-authored-by: Yong He --- tools/slang-unit-test/unit-test-record-replay.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/slang-unit-test/unit-test-record-replay.cpp') diff --git a/tools/slang-unit-test/unit-test-record-replay.cpp b/tools/slang-unit-test/unit-test-record-replay.cpp index 1dc1a36d2..bc5baeafd 100644 --- a/tools/slang-unit-test/unit-test-record-replay.cpp +++ b/tools/slang-unit-test/unit-test-record-replay.cpp @@ -256,6 +256,16 @@ static SlangResult runExample( hashLines.add(line); } + if (hashLines.getCount() == 0) + { + msgBuilder << "Hash value is not found for '" << exampleName << "'\n"; + msgBuilder << "Process ret code: " << exeRes.resultCode << "\n"; + msgBuilder << "Standard output:\n" << exeRes.standardOutput << "\n"; + msgBuilder << "Standard error:\n" << exeRes.standardError << "\n"; + getTestReporter()->message(TestMessageType::TestFailure, msgBuilder.toString().getBuffer()); + return SLANG_FAIL; + } + res = parseHashes(hashLines, outHashes); if (SLANG_FAILED(res)) { -- cgit v1.2.3