diff --git a/CHANGELOG.md b/CHANGELOG.md index ce88a0a..6141bc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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`. diff --git a/bydi-report.el b/bydi-report.el index 42a8dc6..da8292f 100644 --- a/bydi-report.el +++ b/bydi-report.el @@ -13,6 +13,7 @@ ;;; Code: (require 'bydi) +(require 'cl-macs) (defvar bydi-report--temp-files nil) @@ -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 diff --git a/test/bydi-report-test.el b/test/bydi-report-test.el index ef45e92..dc3b030 100644 --- a/test/bydi-report-test.el +++ b/test/bydi-report-test.el @@ -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: diff --git a/test/test-helper.el b/test/test-helper.el index f399ce5..2b2de0d 100644 --- a/test/test-helper.el +++ b/test/test-helper.el @@ -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: