This is an archive of the discontinued LLVM Phabricator instance.

Fix test expectation for aarch64 in several test case
ClosedPublic

Authored by tberghammer on Mar 30 2015, 7:15 AM.

Details

Summary

Fix test expectation for aarch64 in several test case

These test cases check if they are able to read registers after the
inferior is crashed. Previously they did it with reading the eax
register what is only available on i386 and x86_64. This CL add code to
do the check based on the target architecture (currently i386, x86_64
and aarch64 is supported)

Diff Detail

Event Timeline

tberghammer retitled this revision from to Fix test expectation for aarch64 in several test case.
tberghammer updated this object.
tberghammer edited the test plan for this revision. (Show Details)
tberghammer added reviewers: omjavaid, ovyalov.
tberghammer added a subscriber: Unknown Object (MLST).
emaste added a subscriber: emaste.Mar 30 2015, 8:31 AM

Looks reasonable. I wonder if we should have a machine-dependent test library though to host these sorts of things. We'll probably have several more when the test suite fully runs on !x86 architectures, no?

Looks reasonable. I wonder if we should have a machine-dependent test library though to host these sorts of things. We'll probably have several more when the test suite fully runs on !x86 architectures, no?

We already have some basic things in lldbtest.py but it is very far from being enough. I absolutely support creating something what can be used with all target and all host so we don't have to handle it in each test case but I think we should have a longer discussion about it (on lldb-dev) to come up with a good design what we can easily use in all case.

omjavaid edited edge metadata.Mar 30 2015, 3:57 PM

Hi Tamas,

Some inline comments about these tests.

test/functionalities/inferior-assert/TestInferiorAssert.py
98

Hi Tamas,

Can we put this function in one place and use it from there instead on duplicating it in every other file?

In my opinion we should consider separating such tests by architecture and put them in a library or file that can imported otherwise these will be very hard to maintain as our test set grows large.

ovyalov edited edge metadata.Mar 30 2015, 6:07 PM

Please see my comments.

test/functionalities/inferior-assert/TestInferiorAssert.py
98

+1

105

Could you print here self.getArchitecture()?

tberghammer edited edge metadata.

Move duplicated code the utility file

Please see my comments.

test/lldbplatformutil.py
1

s/modul/module

4

self argument looks a little awkward here since there is no class around - maybe use test_case instead of self?

4

Since this function depends on methods and data from lldbtest what do you think about moving it into lldbtest.py?

tberghammer added inline comments.Apr 1 2015, 9:31 AM
test/lldbplatformutil.py
4

I think lldbtest.py already have too much different responsibility so I prefer to keep this platform dependent code separately for readability reasons. Currently it looks a bit strange with just 1 small function in it but I guess there is a lot of duplicated logic in the test cases what should be moved out to a utility class like this.

If you read the comment at the top of lldbtest.py you will see that it already do much more then it was originally designed for (and currently documented). I would prefer to split that class up in the future instead of adding more thing into it.

tberghammer updated this revision to Diff 23068.EditedApr 1 2015, 9:43 AM

Fix typo and rename argument to test_case

ovyalov accepted this revision.Apr 1 2015, 10:17 AM
ovyalov edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Apr 1 2015, 10:17 AM
This revision was automatically updated to reflect the committed changes.