Repository navigation
Add vec_visualizer lldb test - #164457
Add vec_visualizer lldb test#164457
vec_visualizer lldb test#164457Conversation
|
|
There was a problem hiding this comment.
Thank you! So if I understand it correctly, this test would be focused on Vecs, which makes sense, and Vec-related tests would be mostly removed from other tests. It still leaves the question of what to do about all the types, IIRC we were discussing that we would be printing those only in some tests, on an opt-in basis?
| let ptr_mut_vec = ref_mut_vec as *mut _; | ||
| let some_vec = Some(vec_primitive.clone()); | ||
| let some_empty_vec: Option<Vec<i32>> = Some(vec![]); | ||
| // FIXME: re-enable once CI is updated to LLDB 23 |
There was a problem hiding this comment.
We should figure out some magic comment syntax, like // cfg(bootstrap), to make it easier to grep for things that are waiting for a LLDB update. Maybe something like // fixme(min-lldb)?
| } | ||
| } | ||
| ], | ||
| "types": { |
There was a problem hiding this comment.
I kinda forgot where we ended in our discussion about printing those types in all tests. Many of the types below here seem quite.. not useful, especially the nested options and such.
|
Atm types are only included if the type in question has a visualizer (or if it's a generic or field of a type with a visualizer). There's maybe more heuristic optimizations that can be made there, but it's tricky to figure out what exactly each visualizer "needs" to know. In this case, a lot of the type data comes from We could maybe condense generic instantiations into a single FWIW, there shouldn't be more than 1 test in this format per type we have a provider for (right now it'd be ~14 tests total i think?). I don't think this level of specificity is necessary for the majority of the tests in |
|
Hmm, i've had another thought. I mentioned a while ago that we could amortize the type storage by storing them top-level for all tests in a single file. Not only would this share types between multiple tests, but we could also share types between targets (e.g. most The difficulty with that is knowing when types in that file should be deleted. Since they're only "observed" on a test-by-test basis, we wouldnt be able to tell whether types are unused because it's no longer needed vs when it's unused because it's only used in a different test. That can be solved by tagging the types with the tests they're used in. We can check against that to ensure that we've used every type a given test expects, and when blessing, we can remove the given tests listing from all types, and then re-add it to each type used in the test. The other issue is conflicting types with the same name. For user defined types in each test, we csn ensure they're namespaced uniquely by adding a compiler option to match the object name to the test name. The tricky part is handling That's only really a problem if we use a direct That would also neatly solve the first issue, since we can just check that every index in |
|
oh wait, i suppose the issue with that would be race conditions during If we still want a central |
|
I think that having a shared state in between all tests is too complicated (nevertheless thanks for exploring that option :) ). I think that a simpler solution could be to simply have an opt-in flag for each test, which would enable/disable the gathering and rendering of all the types (depending on what we decide to be the "right" default). Maybe there are tests for which all the recursive types are not super interesting, or could be displayed only for debugging the test itself. But I feel like this gets back into a territory that we discussed a couple of times, so I don't want to get into a circle :) I'm fine with the test as-is, the large test data in the JSON file is an orthogonal issue to this PR. You can r=me after changing the LLVM comment (#164457 (comment)). |
d6ca3e3 to
bd31a67
Compare
Add `vec_visualizer` lldb test Adds a comprehensive LLDB test using the new test format. This should cover pretty much all the edge case issues I've encountered before. In a followup, I'll add the GDB commands and test data (and remove redundant `Vec` testing from other tests). r? @Kobzol, @jieyouxu
…uwer Rollup of 13 pull requests Successful merges: - #162460 (Feat - `#[inline(always)] + #[target_feature(enable = "....")]` #2) - #163485 (`rustc_builtin_macros` cleanup, part 8) - #164457 (Add `vec_visualizer` lldb test) - #161253 (Implement `AsMut<T>` and `AsRef<T>` for `!`.) - #162369 (Document the `recursion_limit` built-in attribute) - #162840 (tier 3 target policy: target CPU and features must be supported by upstream backend) - #164329 (use default_field_values in declare_lint) - #164330 (Skip redundant monomorphization checks) - #164527 (doc: added addtional docs for Write) - #164656 (stabilize ExitCodeExt for Windows) - #164660 (Touch up attribute docs) - #164681 (tidy: use repository-relative path for style checks) - #164688 (re-enable test_dir_remove_dir test on QNX)
Rollup merge of #164457 - Walnut356:new_vec_test, r=Kobzol Add `vec_visualizer` lldb test Adds a comprehensive LLDB test using the new test format. This should cover pretty much all the edge case issues I've encountered before. In a followup, I'll add the GDB commands and test data (and remove redundant `Vec` testing from other tests). r? @Kobzol, @jieyouxu
Adds a comprehensive LLDB test using the new test format. This should cover pretty much all the edge case issues I've encountered before. In a followup, I'll add the GDB commands and test data (and remove redundant
Vectesting from other tests).r? @Kobzol, @jieyouxu