[LLVMdev] Need advise on adding tests - Was: Re: ARM MC .s status?

Chris Lattner clattner at apple.com
Thu Sep 16 17:50:17 PDT 2010


On Sep 16, 2010, at 5:30 PM, Jason Kim wrote:

> Is the rationale that llvm has matured/advanced to the point where
> integration tests are the only ones to make sense from a test density
> perspective?

We prefer unit tests based on decomposed command line tools in the llvm/test directory.  These are simple to write, maintain, and understand/debug when something breaks. 

This approach works great for regression and simple feature tests.  More elaborate things get put into other test suites.  Is this what you mean?

-Chris

> 
> On Thu, Sep 16, 2010 at 5:05 PM, Jason Kim <jasonwkim at google.com> wrote:
>> Hi everyone,
>> 
>> I am trying to get up to speed on the MC object file emission for ARM,
>> the first cut being for ELF, and the testing required for that.
>> 
>> Obviously, we want the tests for the .o emission to ultimately test
>> the entire .ll -> many llvm passes -> .bc -> .o, but as a first cut,
>> my instinct tells me that a simple .cpp unit tests that directly
>> invokes the MC code to generate (and self-check) the ARM ELF might be
>> the way to go, but I am wondering where the best place for something
>> like this is? I.e. From what I can tell, in the test-suite, even
>> single file .c files are (according to the readme at least) are run as
>> integration tests that compare llvm .bc / lli output to th eoutput of
>> a native compile ...
>> 
>> The testing document in llvm.org only talk about pretty heavy weight
>> integration tests (Tcl + FileCheck, .cpp -> (many compilers  ...)
>> which is fine, but, but as a sanity check, I can't seem to find an
>> example of a test.cpp file that invokes a certain subset of LLVM API,
>> and self-checks the result - Or is the heavyweight "compile a .cpp
>> file and cross check LLVM-clang's output to gcc" the only way
>> something like this supported?
>> 
>> Thanks,
>> 
>> -Jason.
>> -jason
>> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list