test_run_rustdoc_against_real_crate

Tests › tests/test_rustdoc.py

passed Passed in the packaged run.

What this test is for

Why it exists

The end-to-end contract: a real `cargo +nightly rustdoc` run against a real crate lands a doxygen-shaped database with the right path/memberdef rows — the same shape `tests/richdb.py` hand-makes for the C fixture.

Given

  1. db_path = tmp_path / "rustdoc.db"
→

When

  1. result = run_rustdoc(RUSTSAMPLE, db_path)
  2. conn = sqlite3.connect(str(db_path))
  3. try: names = {row[0] for row in conn.execute("SELECT name FROM memberdef")} assert {"add", "helper", "MAX_RETRIES"} <= names brief = conn.execute( "SELECT briefdescription FROM memberdef WHERE name = 'add'" ).fetchone()[0] assert brief == "Adds two numbers together." add_static, helper_static = ( conn.execute("SELECT static FROM memberdef WHERE name = ?", (name,)).fetchone()[0] for name in ("add", "helper") ) assert add_static == 0 # pub fn assert helper_static == 1 # private fn path_row = conn.execute( "SELECT p.name FROM memberdef m JOIN path p ON p.rowid = m.file_id WHERE m.name = 'add'" ).fetchone() assert path_row[0] == "src/main.rs" # Every downstream stage that guards with _table_exists (dispatch_edges.py) # still gets a real, empty compounddef table rather than a missing one. assert conn.execute("SELECT COUNT(*) FROM compounddef").fetchone()[0] == 0 finally: conn.close()
→

Then

  1. ✓ result equals db_path

tests/test_rustdoc.py:233 · its file's page

What it checks (7)

  1. assert result == db_path observes run_rustdoc via result
  2. assert {"add", "helper", "MAX_RETRIES"} <= names not attributed
  3. assert brief == "Adds two numbers together." not attributed
  4. assert add_static == 0 not attributed
  5. assert helper_static == 1 not attributed
  6. assert path_row[0] == "src/main.rs" not attributed
  7. assert conn.execute("SELECT COUNT(*) FROM compounddef").fetchone()[0] == 0 not attributed

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_run_rustdoc_against_real_crate→run_rustdoc

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

test_run_rustdoc_against_real_crate · 7 checksrun_rustdoc_require_nightly_rustdocclean_subprocess_envREQ-DDB-PIPE-006 · measured
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.