Function: bazel-c++-test-at-point
bazel-c++-test-at-point is a natively compiled function defined in
bazel.el.
Signature
(bazel-c++-test-at-point)
Documentation
Return the name of the C++ test at point.
Useful for ‘bazel-test-at-point-functions’. See URL ‘https://google.github.io/googletest/primer.html’.
Source Code
;; Defined in /nix/store/ws8pkszjvcad1rgzqw6wja7qxacylfhn-emacs-packages-deps/share/emacs/site-lisp/elpa/bazel-20261002.1510/bazel.el
(defun bazel-c++-test-at-point ()
"Return the name of the C++ test at point.
Useful for ‘bazel-test-at-point-functions’.
See URL ‘https://google.github.io/googletest/primer.html’."
(declare (ftype (function () (or string null))))
(save-excursion
(let ((case-fold-search nil)
(search-spaces-regexp nil))
(and (beginning-of-defun)
;; Right now we only support Googletest. See
;; https://google.github.io/googletest/primer.html.
(looking-at (rx bol (or "TEST" "TEST_F") (* (syntax whitespace)) ?\(
(* (syntax whitespace))
(group (+ (or (syntax word) (syntax symbol))))
(* (syntax whitespace)) ?, (* (syntax whitespace))
(group (+ (or (syntax word) (syntax symbol))))
(* (syntax whitespace)) ?\)))
;; https://google.github.io/googletest/advanced.html#running-a-subset-of-the-tests.
(concat (match-string-no-properties 1) "."
(match-string-no-properties 2))))))