On Fri, Nov 9, 2012 at 11:13 AM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Fri, Nov 09, 2012 at 11:05:37AM -0800, Wei Mi wrote:
>> gtest integrate multiple tests into the same file with each test being
>> a single line check.  I cannot think out a method to migrate it to
>> dejagnu without using gtest, except splitting a single gtest file to
>> multiple files with each file per test. asan has about 130 tests so
>> have to write 130 files which will be a doable but painful task.
>
> See the glibc _FORTIFY_SOURCE check I've referenced, there it is 3 lines
> per test expected to crash, but could be done in a single macro too.
> If the failure can be intercepted, it can be done in a single process (e.g.
> SIGABRT can, _exit can't that easily), otherwise perhaps say way to skip
> previous tests and communicate with dejagnu how many times it should run the
> executable.
>
>         Jakub

Using setjmp/longjmp to do multiple tests in a single testfile, the
test statements in the front could affect the tests in the back. gtest
will fork a new process for every test statement. The forked process
will do only one test and skip all the other test statements. That is
to say, multiple test statements in the same testfile are guaranteed
to be independent from each other in gtest. If we use setjmp/longjmp
pattern to do the test, existing testsuite may need to be rewritten if
their test statements could affect each other.

Thanks,
Wei.

Reply via email to