<div dir="ltr">Hey Paul, if a test is unsupported on my environment, `make check-clang` will skip it, not reporting an failure, right?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 9, 2020 at 10:56 PM Robinson, Paul <<a href="mailto:paul.robinson@sony.com">paul.robinson@sony.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_-9190363883339996392WordSection1">
<p class="MsoNormal">There are several different kinds of tests within the project. You might want to read through
<a href="https://llvm.org/docs/TestingGuide.html" target="_blank">https://llvm.org/docs/TestingGuide.html</a> to get an overview.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Lit tests (at least for Clang) are generally C/C++ sources intended to be inputs to clang; various compiler outputs are verified, usually with the FileCheck tool. These test files are not built into a bin with all the other tests. You
should be able to use llvm-lit.py to run either a single test file, or one subdirectory (e.g., `llvm-lit clang/test/Sema` will run all the tests in Sema).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Individual lit tests can express requirements on the environment, and if these are not satisfied, llvm-lit will report UNSUPPORTED. clang/test/Frontend/plugin-attribute.cpp is probably UNSUPPORTED because the test file contains the line
`REQUIRES: plugins, examples` and those dependencies are not satisfied on your system.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Unit tests are cpp sources that directly call Clang or LLVM APIs in some way, e.g., using libTooling. If that’s what you wrote, then you don’t want a lit test, you want to add your file to a unittest (or add a new unittest). I think you
can build the unittest programs with `make clang-test-depends` (that’s the correct target name for ninja, not sure about make).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hope this helps,<u></u><u></u></p>
<p class="MsoNormal">--paulr<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0in 0in 0in 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> cfe-dev <<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">cfe-dev-bounces@lists.llvm.org</a>> <b>On Behalf Of
</b>Yafei Liu via cfe-dev<br>
<b>Sent:</b> Sunday, November 8, 2020 10:19 PM<br>
<b>To:</b> Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><br>
<b>Subject:</b> Re: [cfe-dev] [check-clang][lit] can I just run my own test case in when using `make check-clang`?<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Weird thing is that if I run ./bin/llvm-lit -v ./tools/clang/test/Sema/asm.c, it works<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">But if I run ./bin/llvm-lit -v ./tools/clang/test/Frontend/plugin-attribute.cpp it says <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">UNSUPPORTED: Clang :: Frontend/plugin-attribute.cpp (1 of 1)<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Mon, Nov 9, 2020 at 11:05 AM Yafei Liu <<a href="mailto:yfliu@mobvoi.com" target="_blank">yfliu@mobvoi.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal">I worte a reguation test and want to check if my code works, but it seems that I have to run `make check-clang`, and it will run all the tests belongs to check-clang, which takes a lot of times.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Since the test case is a cpp file and build into a bin with other tests (correct if I'm wrong), I can't use things like llvm-lit llvm-project/clang/test/Frontend/mytest.cpp<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">So anyway I can run "mytest" singlely?<u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote></div>