Hey Sourabh,

You'll want to take a look at the existing tests in `test/Shell`.
These tests run one or more shell commands and uses FileCheck to
verify that the output match what you expect. These tests use lldb's
batch mode, where lldb commands are executed one after another, rather
than interactively.

A good example is test/Shell/Commands/command-backtrace.test

More info about lit and FileCheck:
https://llvm.org/docs/TestingGuide.html
https://llvm.org/docs/CommandGuide/FileCheck.html

Cheers,
Jonas

On Fri, Jan 10, 2020 at 12:24 PM Sourabh Singh Tomar via lldb-dev
<lldb-dev@lists.llvm.org> wrote:
>
> Hello Everyone,
>
> I've wrote a patch for extending support for new forms[DWARFv5] in macro 
> section. Planning to file a review soon.
>
> But I'm stuck with writing test case for this. My feature works well when 
> using LLDB in interactively, but I need to write a test case to accompany my 
> patch.
>
> To put things in perspective:
> here' s how I tested it interactively:
>
> $lldb a.out
> $display MACRO1  -- macro defined in source/a.out
> $ b main
> $ run
> LLDB output
> - Hook 1 (expr -- MACRO1)
> (int) $0 = 4
> Process 18381 stopped
> * thread #1, name = 'a.out', stop reason = breakpoint 1.1
>
> Need to write/add test case for this so that it will be run by "make 
> check-lldb", any ideas/pointers how to proceed forward from here.
>
> Thanks in anticipation!
> Sourabh Singh Tomar
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to