llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Henry Kleynhans (hkleynhans) <details> <summary>Changes</summary> The LLVM Integrated Tester now generates an "easy to use" script to run clang tests. It is no longer needed to pass all of the commandline arguments to it. This PR simplifies the documentation a little by removing the unneeded commandline arguments and adding a link to the lit man page. --- Full diff: https://github.com/llvm/llvm-project/pull/178244.diff 1 Files Affected: - (modified) clang/www/hacking.html (+39-41) ``````````diff diff --git a/clang/www/hacking.html b/clang/www/hacking.html index 90dcc3f4fc042..6f6026e9979e6 100755 --- a/clang/www/hacking.html +++ b/clang/www/hacking.html @@ -207,56 +207,54 @@ <h3 id="testingCommands">Testing on the Command Line</h3> <!--=====================================================================--> <p>If you want more control over how the tests are run, it may - be convenient to run the test harness on the command-line directly. Before - running tests from the command line, you will need to ensure that - <tt>lit.site.cfg</tt> files have been created for your build. You can do - this by running the tests as described in the previous sections. Once the - tests have started running, you can stop them with control+C, as the - files are generated before running any tests.</p> - - <p>Once that is done, to run all the tests from the command line, - execute a command like the following:</p> + be convenient to run the test harness on the command-line directly. Running + the tests from Visual Studio by building the <tt>check-clang</tt> target or + using Ninja by executing <tt>ninja check-clang</tt> will result in the + <a href="https://llvm.org/docs/CommandGuide/lit.html">LLVM Integrated + Tester</a> (<tt>lit</tt>) generating a startup script to run tests + for your current configuration. Once the tests have started running, you + can stop them with <tt>control+C</tt>, as the files are generated before + running any tests.</p> + + <p>Once that is done, all the tests can be executed from the command line + by running the generated <tt>llvm-lit.cmd</tt> script as follows:</p> <pre> - python (path to llvm)\llvm\utils\lit\lit.py -sv - --param=build_mode=Win32 --param=build_config=Debug - --param=clang_site_config=(build dir)\tools\clang\test\lit.site.cfg - (path to llvm)\llvm\tools\clang\test -</pre> - - <p>For CMake builds e.g. on Windows with Visual Studio, you will need - to specify your build configuration (Debug, Release, etc.) via - <tt>--param=build_config=(build config)</tt>. You may also need to specify - the build mode (Win32, etc) via <tt>--param=build_mode=(build mode)</tt>.</p> - - <p>Additionally, you will need to specify the lit site configuration which - lives in (build dir)\tools\clang\test, via - <tt>--param=clang_site_config=(build dir)\tools\clang\test\lit.site.cfg</tt>. - </p> - - <p>To run a single test:</p> + (build dir)\bin\llvm-lit.cmd (path to llvm)\clang\test + </pre> + For a Visual Studio Debug build in the <tt>llvm-project\build</tt> directory + lit start command to execute from the <tt>llvm-project</tt> folder would be: <pre> - python (path to llvm)\llvm\utils\lit\lit.py -sv - --param=build_mode=Win32 --param=build_config=Debug - --param=clang_site_config=(build dir)\tools\clang\test\lit.site.cfg - (path to llvm)\llvm\tools\clang\test\(dir)\(test) -</pre> + build\Debug\bin\llvm-lit.cmd clang\test + </pre> - <p>For example:</p> + If you have a Ninja build in the <tt>llvm-project\build_ninja</tt> directory, + the command to execute from the <tt>llvm-project</tt> folder would be: + <pre> + build_ninja\bin\llvm-lit.cmd clang\test + </pre> + The LLVM Integrated Testser also generates a <tt>llvm-lit.py</tt> script + alongside the <tt>llvm-lit.cmd</tt> script so that it can also be started + using python directly in the event that you are not using a CMD prompt: <pre> - python C:\Tools\llvm\utils\lit\lit.py -sv - --param=build_mode=Win32 --param=build_config=Debug - --param=clang_site_config=C:\Tools\build\tools\clang\test\lit.site.cfg - C:\Tools\llvm\tools\clang\test\Sema\wchar.c -</pre> + python.exe (path to build)\bin\llvm-lit.py (path to llvm-project)\clang\test + </pre> - <p>The -sv option above tells the runner to show the test output if - any tests failed, to help you determine the cause of failure.</p> + <p>You can also run a single test or all tests in a specific folder by + providing the target test or folder to your favorite <tt>lit</tt> start + command. For example, we can run the <tt>wchar.c</tt> test:</p> + <pre> + build_ninja\bin\llvm-lit.cmd clang\test\Sema\wchar.c + </pre> + <p>or all tests in the <tt>Sema</tt> folder:</p> + <pre> + build_ninja\bin\llvm-lit.cmd clang\test\Sema + </pre> - <p>You can also pass in the --no-progress-bar option if you wish to disable - progress indications while the tests are running.</p> + <p>Pass in the <tt>--no-progress-bar</tt> option if you wish to disable progress + indications while the tests are running.</p> <p>Your output might look something like this:</p> `````````` </details> https://github.com/llvm/llvm-project/pull/178244 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
