Skip to content
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

Coverage tests for remaining TerminatorKinds and async, improve Assert #79109

Merged
merged 7 commits into from
Dec 4, 2020

Commits on Dec 3, 2020

  1. Coverage tests for remaining TerminatorKinds and async, improve Assert

    Tested and validate results for panic unwind, panic abort, assert!()
    macro, TerminatorKind::Assert (for example, numeric overflow), and
    async/await.
    
    Implemented a previous documented idea to change Assert handling to be
    the same as FalseUnwind and Goto, so it doesn't get its own
    BasicCoverageBlock anymore. This changed a couple of coverage regions,
    but I validated those changes are not any worse than the prior results,
    and probably help assure some consistency (even if some people might
    disagree with how the code region is consistently computed).
    
    Fixed issue with async/await. AggregateKind::Generator needs to be
    handled like AggregateKind::Closure; coverage span for the outer async
    function should not "cover" the async body, which is actually executed
    in a separate "closure" MIR.
    richkadel committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    c45ee4b View commit details
    Browse the repository at this point in the history
  2. Removed -base from run-make-fulldeps/coverage-*-base

    In preparation for removing the -deadcode variants
    richkadel committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    f6c9c1a View commit details
    Browse the repository at this point in the history
  3. Combination of commits

    Fixes multiple issue with counters, with simplification
    
      Includes a change to the implicit else span in ast_lowering, so coverage
      of the implicit else no longer spans the `then` block.
    
      Adds coverage for unused closures and async function bodies.
    
      Fixes: rust-lang#78542
    
    Adding unreachable regions for known MIR missing from coverage map
    
    Cleaned up PR commits, and removed link-dead-code requirement and tests
    
      Coverage no longer depends on Issue rust-lang#76038 (`-C link-dead-code` is
      no longer needed or enforced, so MSVC can use the same tests as
      Linux and MacOS now)
    
    Restrict adding unreachable regions to covered files
    
      Improved the code that adds coverage for uncalled functions (with MIR
      but not-codegenned) to avoid generating coverage in files not already
      included in the files with covered functions.
    
    Resolved last known issue requiring --emit llvm-ir workaround
    
      Fixed bugs in how unreachable code spans were added.
    richkadel committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    def932c View commit details
    Browse the repository at this point in the history
  4. Addressed feedback from 2020-12-01

    Added one more test (two files) showing coverage of generics and unused
    functions across crates.
    
    Created and referenced new Issues, as requested.
    
    Added comments.
    
    Added a note about the possible effects of compiler options on LLVM
    coverage maps.
    richkadel committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    d96f351 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b0c140a View commit details
    Browse the repository at this point in the history
  6. Fixed cross-crate generic call test to compile lib and bin separately

    The original test produced a single crate with two mods, which was not
    the goal of the test.
    richkadel committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    f101fd8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    dc4bd90 View commit details
    Browse the repository at this point in the history