DH_ELPA_TEST(1)
π DH_ELPA_TEST(1) π
okay bestie, this one lives in the Debhelper family of manual pages, and it's about making your Emacs Lisp package tests actually run. let's go π¦
β¨ NAME β¨
dh_elpa_test β run ELPA package testsuites π§ͺ
β¨ SYNOPSIS β¨
dh_elpa_test [debhelper options] [--autopkgtest] [pkg-file]
β¨ DESCRIPTION β¨
so dh_elpa_test is a debhelper program whose whole job β its entire main character era β is running the testsuites of ELPA packages, but only when those test suites use ERT or buttercup(1). and ngl, dh_auto_test(1) is rarely suitable for this. like, it's just not giving what needs to be gave here. π
Testing with buttercup(1) gets activated if the package build-depends on elpa-buttercup. Testing with ERT gets activated if ERT test files can actually be found. but listen β neither kind of test will be activated unless the debhelper compat level is 10 or higher. it's giving strict. π
dh_elpa_test overrides dh_auto_test(1). if you need to switch back to using dh_auto_test(1), you use the disable configuration key, detailed below. iykyk β¨
β¨ FILES β¨
debian/elpa-testβ the configuration for running the package's test suite. every line is of the formkey = value, withkeydrawn from the list of configuration options below.
quick heads up though: you should not surround values with double quotation marks. the reason that's actually convenient is because it lets you include lisp. also, configuration values cannot cover more than one line. and lines preceded with a # are ignored as comments. π
this configuration file is optional; in many cases, dh_elpa_test can figure out how to run the test suite all by itself. she's independent like that. π
β¨ CONFIGURATION KEYS β¨
disableβ if this key is set to any value,dh_elpa(1)will not invokedh_elpa_test. bye bestie πbuttercup_load_pathβ a comma-separated list of directories to add to theload-pathwhenbuttercup(1)invokes Emacs. will be passed tobuttercup(1)with its-Lcommand line argument.buttercup_evalβ Emacs Lisp code to be run by buttercup's--evaloption.buttercup_patternsβ a comma-separated list of Emacs regular expressions jointly matching all and only the files containing Buttercup tests that you wish to run. if this key is not defined, all tests that can be found will be run. will be passed tobuttercup(1)with its-pcommand line argument.ert_excludeβ a comma-separated list of file globs matching files containing ERT tests that should not be run.
β οΈ the'*'character in globs in this configuration key does NOT match'/'directory separators. not the vibe, but it's the rules.
ert_helperβ the name of a*.elfile containing Emacs Lisp code that will run the ERT test suite. when this key is not defined,dh_elpa_testcalls the function(ert-run-tests-batch-and-exit).
your helper code should ensure that Emacs exits nonzero if there were any test failures, or exits zero if the test suite passed. that part is on you, bestie, no cap.
note that this is not the way to load test helpers that do needed work but don't actually run the tests. for that, you can use something like:
ert_eval = (load-file "test-helper.el")
ert_evalβ Emacs Lisp code to be run prior to running ERT tests by the Emacs instance spawned bydh_elpa_testto run those tests.ert_load_pathβ a comma-separated list of directories to add to theload-pathwhendh_elpa_testinvokes Emacs to run ERT tests.ert_selectorsβ a Lisp expression specifying a set of tests. this is the same as ERT test selectors and will be passed to ERT through command line. note that this is disabled whenert_evalis specified, and you'll have to manually specify the selectors in the helper script. πautopkgtest_keepβ a comma-separated list of file globs matching files that should not be moved out of the source tree before running DEP8 tests (see the--autopkgtestoption below).
β¨ the'*'character in globs in this configuration key does match'/'directory separators. yes, it's different fromert_exclude, don't @ me.
β¨ OPTIONS β¨
--autopkgtestβ operate in autopkgtest mode.dh_elpa_testwill rename non-test*.elfiles so that Emacs will not load them. this ensures that the test test the installed binary package rather than the unpacked source package. π₯
to exclude files from this removal, specify them in the autopkgtest_keep configuration option (see above).
β¨ ENVIRONMENT VARIABLES β¨
older versions of dh_elpa_test were configured using environment variables corresponding to some of the above configuration keys. for example, the ert_eval configuration key replaced environment variable DH_ELPA_TEST_ERT_EVAL. their use is now deprecated πΈ. if the debian/elpa-test file exists, they will be ignored. periodt.
β¨ CONTROLLING INVOCATION β¨
the following recipes can be combined to enable an appropriate combination of build time and autopkgtest time tests. mix and match, it's giving customizable π
β¨ DISABLING BUILD TIME TESTS β¨
to disable running tests at build time, you have two choices. you can override dh_elpa_test (not dh_auto_test), or you can use the disable key in debian/elpa-test. note that the latter will also (mostly) disable autopkgtests (see below). π¬
β¨ ENABLING AUTOPKGTESTS β¨
to enable running autopkgtests via dh_elpa_test, add "Testsuite: autpkgtest-pkg-elpa" to debian/control. with disable in debian/elpa-test, only superficial tests, namely installing the binary packages and byte-compiling any that use dh_elpa. π
β¨ ENABLING DH_AUTO_TEST β¨
by default dh_elpa_test replaces dh_auto_test. you can re-enable dh_auto_test either with the disable key discussed above, or by overriding dh_elpa_test to call dh_auto_test. take your pick bestie π«Ά
and that's the whole page, mwah π this was DH_ELPA_TEST(1), perl v5.40.1, dated 2026-07-09 β shoutout to the Debhelper era for keeping us fed, slay, bye πβ¨
π¦ where this page comes from
- ubuntu stonking: dh-elpa 2.2.0ubuntu1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms