-
Notifications
You must be signed in to change notification settings - Fork 0
Add unit tests from lldb-eval #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Since not all test cases were moved to python tests, I added unit tests from lldb-eval to see better what functionality is missing. Notably, a lot of expressions are not making it past the lexer now, many of which can be fixed by solving issue #4 This pull request is just to show the branch. My question is, should we maintain these unit tests or move them one by one to python suite as we fix them? |
Removed for now: * All tests with context variables evaluation: need to implement an call interface to DIL * All tests with evaluation with scope: need to implement an call interface to DIL * Some tests that crash the test suite completely: some of the tests that involve nullptr
Build by adding '-DLLVM_USE_SANITIZER=Address -DLLVM_USE_SANITIZE_COVERAGE=On' to the CMake configuration.
|
@cmtice
Haven't figured out yet how to build the test binary from source and pass it to the unit tests, so for now it's still a pre-built binary. Please try launching the tests and tell me how it goes :) |
|
@cmtice |
| get_target_property(EXE_PATH LLDBDILTests RUNTIME_OUTPUT_DIRECTORY) | ||
| add_custom_command( | ||
| OUTPUT test_binary.bin | ||
| COMMAND $<TARGET_FILE:clang> test_binary.cc -std=c++17 -fuse-ld=lld -B$<TARGET_FILE:lld> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| COMMAND $<TARGET_FILE:clang> test_binary.cc -std=c++17 -fuse-ld=lld -B$<TARGET_FILE:lld> | |
| COMMAND $<TARGET_FILE:clang> ${CMAKE_CURRENT_SOURCE_DIR}/test_binary.cc -std=c++17 -fuse-ld=lld -B$<TARGET_FILE:lld> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that I needed to tell clang what directory to look in, for building test_binary.cc
|
I found that with the small change I've shown above, the unittest builds & runs for me. I get 2 failures: |
|
Hmm, these are the tests that fail when I link against libstdc++. |
|
@cmtice |
|
@cmtice Could you please check if the tests work after the last changes? |
The tests build just fine. When I run them I get the following results: 1 FAILED TEST |
|
Okay, disabled and skipped tests are supposed to be there, but nothing should fail. What are the errors? |
[ RUN ] EvalTest.TestCxxReinterpretCast /usr/local/google3/cmtice/access-softek-dil/lldb/unittests/DIL/DILTests.cpp:1783: Failure /usr/local/google3/cmtice/access-softek-dil/lldb/unittests/DIL/DILTests.cpp:1787: Failure |
|
I skipped these tests for now, it's just the error message not matching exactly, will figure it out later why do they match on my build, but not on yours. |
SGTM! |
|
I misunderstood how |
Add unit tests ported from lldb-eval.
TODO: