Also attaching the patches here, which includes several improvements besides the fix.
-- Regards, Xiyue Deng
>From 2d126c1fda633b3c87bcc2278b452785e48dba0a Mon Sep 17 00:00:00 2001 From: Xiyue Deng <manp...@gmail.com> Date: Fri, 22 Nov 2024 14:56:16 -0800 Subject: [PATCH 1/3] Correctly construct ERT selectors S-exp (Closes: #1088086) - Was under the wrong impression that ERT selectors can be specified as the rest of the command line parameters. + which turns out to be the extension supported by `flycheck-run-tests-main'. - Now properly make it part of the `ert-run-tests-batch-and-exit' s-exp. --- dh_elpa_test | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dh_elpa_test b/dh_elpa_test index 82d0f77..6e0444b 100755 --- a/dh_elpa_test +++ b/dh_elpa_test @@ -406,14 +406,13 @@ if (@ert_files) { } if (defined $options->{_}->{'ert_helper'}) { push @args, ("-l", $options->{_}->{'ert_helper'}); + } elsif (defined $options->{_}->{'ert_selectors'}) { + my $ert_selectors = $options->{_}->{'ert_selectors'}; + push @args, ("--eval", "(ert-run-tests-batch-and-exit ${ert_selectors})"); } else { push @args, ("--eval", "(ert-run-tests-batch-and-exit)"); } - if (defined $options->{_}->{'ert_selectors'}) { - push @args, $options->{_}->{'ert_selectors'}; - } - print_and_doit(@args); } -- 2.45.2
>From c6523f80ace5c86f2c533cc620816828cc1416cb Mon Sep 17 00:00:00 2001 From: Xiyue Deng <manp...@gmail.com> Date: Fri, 22 Nov 2024 15:06:53 -0800 Subject: [PATCH 2/3] Prefer "-f" over "--eval" when running `ert-run-tests-batch-and-exit' --- dh_elpa_test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dh_elpa_test b/dh_elpa_test index 6e0444b..5091bd7 100755 --- a/dh_elpa_test +++ b/dh_elpa_test @@ -410,7 +410,7 @@ if (@ert_files) { my $ert_selectors = $options->{_}->{'ert_selectors'}; push @args, ("--eval", "(ert-run-tests-batch-and-exit ${ert_selectors})"); } else { - push @args, ("--eval", "(ert-run-tests-batch-and-exit)"); + push @args, ("-f", "ert-run-tests-batch-and-exit"); } print_and_doit(@args); -- 2.45.2
>From 7d122a30c3e0e62fb6d163c345f720c588340a86 Mon Sep 17 00:00:00 2001 From: Xiyue Deng <manp...@gmail.com> Date: Fri, 22 Nov 2024 15:10:21 -0800 Subject: [PATCH 3/3] Update documentation accordingly. --- dh_elpa_test | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dh_elpa_test b/dh_elpa_test index 5091bd7..2552054 100755 --- a/dh_elpa_test +++ b/dh_elpa_test @@ -125,8 +125,9 @@ B<dh_elpa_test> invokes Emacs to run ERT tests. =item B<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, which will also work -with custom test tools built upon ERT. +selectors and will be passed to ERT through command line. Note that this is +disabled when B<ert_eval> is specified, and you'll have to manually specify the +selectors int he helper script. =item B<autopkgtest_keep> -- 2.45.2