ERT is an Emacs Lisp library for regression/unit testing. It is now included in Emacs, but can still be retrieved from its old repository.
If you want to run a single ERT test programmatically, here is the syntax. See the full thread at StackOverFlow.
(ert-test-passed-p (ert-run-test (ert-get-test 'my-deftest-name))) nil ;; test my-deftest-name failed t ;; test my-deftest-name passed
See also UnitTesting