diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-07-08 11:33:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-08 18:33:50 +0000 |
| commit | a68e2635cbc9a555cfd1dab69a826d9af786aae2 (patch) | |
| tree | 97a83dad77d7cd03c0829260fd5cdd82b416fac2 /tools/slang-test/slang-test-main.cpp | |
| parent | 69947dec841ea46e68ccdccae45a1080fcaea01c (diff) | |
Improve slang-test output verbosity control (#7625)
* Improve slang-test output verbosity control
This commit improves the existing command-line argument for slang-test,
"-v". Previously it printed more information when "-v" was used.
This commit adds a new option to silence the information output so that
LLM processes less tokens when things are working as expected.
* format code (#74)
---------
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Diffstat (limited to 'tools/slang-test/slang-test-main.cpp')
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 14c9b52ef..4eab84340 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -782,7 +782,7 @@ Result spawnAndWaitExe( const auto& options = context->options; - if (options.shouldBeVerbose) + if (options.verbosity == VerbosityLevel::Verbose) { String commandLine = cmdLine.toString(); context->getTestReporter()->messageFormat( @@ -815,7 +815,7 @@ Result spawnAndWaitSharedLibrary( const auto& options = context->options; String exeName = Path::getFileNameWithoutExt(cmdLine.m_executableLocation.m_pathOrName); - if (options.shouldBeVerbose) + if (options.verbosity == VerbosityLevel::Verbose) { CommandLine testCmdLine; @@ -908,7 +908,7 @@ Result spawnAndWaitProxy( cmdLine.setExecutableLocation(ExecutableLocation(context->exeDirectoryPath, "test-proxy")); const auto& options = context->options; - if (options.shouldBeVerbose) + if (options.verbosity == VerbosityLevel::Verbose) { String commandLine = cmdLine.toString(); context->getTestReporter()->messageFormat( @@ -4624,7 +4624,10 @@ void runTestsInDirectory(TestContext* context) { if (shouldRunTest(context, file)) { - printf("found test: '%s'\n", file.getBuffer()); + if (context->options.verbosity >= VerbosityLevel::Info) + { + printf("found test: '%s'\n", file.getBuffer()); + } if (SLANG_FAILED(_runTestsOnFile(context, file))) { { @@ -5071,7 +5074,7 @@ SlangResult innerMain(int argc, char** argv) context.setTestReporter(&reporter); reporter.m_dumpOutputOnFailure = options.dumpOutputOnFailure; - reporter.m_isVerbose = options.shouldBeVerbose; + reporter.m_verbosity = options.verbosity; reporter.m_hideIgnored = options.hideIgnored; { |
