Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@

import os
import shutil
from itertools import chain
from pathlib import Path

from docutils import nodes
from docutils.parsers.rst import Directive

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

Expand Down Expand Up @@ -73,45 +69,7 @@
numfig = True


class DisplayTestLogs(Directive):
"""Find and display the raw content of all test.log files."""

def run(self):
env = self.state.document.settings.env
ws_root = Path(env.app.srcdir)

result_nodes = []
for log_file in chain(
(ws_root / "bazel-testlogs").rglob("test.log"),
(ws_root / "tests-report").rglob("test.log"),
):
rel_path = log_file.relative_to(ws_root)

title = nodes.rubric(text=str(rel_path))
result_nodes.append(title)

try:
content = log_file.read_text(encoding="utf-8")
except Exception as e:
content = f"Error reading file: {e}"

code = nodes.literal_block(content, content)
code["language"] = "text"
code["source"] = str(rel_path)
result_nodes.append(code)

if not result_nodes:
para = nodes.paragraph(
text="No test.log files found in bazel-testlogs or tests-report."
)
result_nodes.append(para)

return result_nodes


def setup(app):
app.add_directive("display-test-logs", DisplayTestLogs)

# When Sphinx runs inside a Bazel action (bazel build //:needs_json), the
# CWD is the execroot / sandbox root and the JSON schema files are linked
# there at their workspace-relative paths (src/...) because they are
Expand Down
6 changes: 0 additions & 6 deletions docs/verification_report/statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,3 @@ Details About Testcases
type == 'testcase' and derivation_technique == 'fuzz-testing'
type == 'testcase' and derivation_technique == 'error-guessing'
type == 'testcase' and derivation_technique == 'explorative-testing'


Test Log Files
--------------

.. display-test-logs::
Loading