Skip to content

Commit

Permalink
feat(report): add bydi-report-setup-ert
Browse files Browse the repository at this point in the history
  • Loading branch information
Walheimat committed Nov 18, 2023
1 parent 704fb7d commit 8ed0f1c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Function `bydi-report-setup-ert` that accepts key
`:increase-print-depth` to do just that.

### Fixed

- `bydi-ci` now requires `bydi` and `bydi` requires `ert`.
Expand Down
11 changes: 11 additions & 0 deletions bydi-report.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
;;; Code:

(require 'bydi)
(require 'cl-macs)

(defvar bydi-report--temp-files nil)

Expand Down Expand Up @@ -187,6 +188,16 @@ An optional REPORTER function can be passed."

(bydi-report--find-test-helper))

;;;###autoload
(cl-defun bydi-report-setup-ert (&key increase-print-depth)
"Setup `ert'.
If INCREASE-PRINT-DEPTH is t, `ert-batch-print-level' will be
greatly increased. This is especially useful when using
`bydi-match-expansion' if the macro to match is complex."
(when increase-print-depth
(setq ert-batch-print-level 10)))

(provide 'bydi-report)

;;; bydi-report.el ends here
8 changes: 8 additions & 0 deletions test/bydi-report-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@

(bydi-was-called pop-to-buffer)))))

(ert-deftest bydi-report--setup-ert ()
(defvar ert-batch-print-level)
(bydi ((:watch ert-batch-print-level))

(bydi-report-setup-ert :increase-print-depth t)

(bydi-was-set-to ert-batch-print-level 10)))

;;; bydi-report-test.el ends here

;; Local Variables:
Expand Down
2 changes: 2 additions & 0 deletions test/test-helper.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
(list :report-file report-file)
(list :send-report nil)))))

(setq ert-batch-print-level 20)

;;; test-helper.el ends here

;; Local Variables:
Expand Down

0 comments on commit 8ed0f1c

Please sign in to comment.