Skip to content

Makefile.SH: Add 'test_regex_tests' as make target - #24679

Open
jkeenan wants to merge 1 commit into
Perl:bleadfrom
jkeenan:test_regex_tests_20260810
Open

Makefile.SH: Add 'test_regex_tests' as make target#24679
jkeenan wants to merge 1 commit into
Perl:bleadfrom
jkeenan:test_regex_tests_20260810

Conversation

@jkeenan

@jkeenan jkeenan commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

With variant make-regex-tests. This runs make test_prep, then runs the harness over all the re/*.t ../ext/re/t/*.t tests you expect.

Today I was in a situation where I wanted to run all the customary tests exercising regular expressions. I vaguely recalled that we had a make target called make test_reonly and naively called:

$ sh ./Configure -des -Dusedevel && make test_reonly

But that ended with:

...
make[1]: Leaving directory '/home/jkeenan/gitwork/perl2/ext/re'
cd t && (rm -f perl; /usr/bin/ln -s ../perl perl)
TEST_ARGS='re/*.t ../ext/re/t/*.t' PERL_TEST_HARNESS_ASAP=1 TESTFILE=harness  ./runtests choose
Can't locate File/Spec.pm in @INC (you may need to install the File::Spec module) (@INC entries checked: ../lib) at ../lib/TAP/Harness.pm line 7.
BEGIN failed--compilation aborted at ../lib/TAP/Harness.pm line 7.
Compilation failed in require at harness line 60.
BEGIN failed--compilation aborted at harness line 60.
make: *** [makefile:874: test_reonly] Error 2

I spent some time peering into Makefile.SH and noted that test_reonly had a dependency on test_prep_reonly but not on test_prep.

test_reonly test-reonly: test_prep_reonly
    TEST_ARGS='re/*.t ../ext/re/t/*.t' PERL_TEST_HARNESS_ASAP=1 TESTFILE=harness $(RUN_TESTS) choose

To make a long story short, I didn't get a DWIM result until I added this target with a patch:

$ gitshowf |cat
commit 8c4c47cb730dc3cb0a3790e43b997f99278f627d
Author:     James E Keenan <jamesekeenan@yahoo.com>
AuthorDate: Mon Aug 10 14:21:42 2026 -0400
Commit:     James E Keenan <jamesekeenan@yahoo.com>
CommitDate: Mon Aug 10 14:38:16 2026 -0400

    Makefile.SH: Add 'make_regex_tests'
    
    With variant 'make-regex-tests'.  This runs 'make test_prep', then runs
    the harness over all the 're/*.t ../ext/re/t/*.t' tests you expect.

diff --git a/Makefile.SH b/Makefile.SH
index 6351ef6630..d8b5f788ce 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -1697,6 +1697,9 @@ test_reonly test-reonly: test_prep_reonly
 test_porting test-porting: test_prep
 	TEST_ARGS='porting/*.t lib/diagnostics.t' TESTFILE=harness $(RUN_TESTS) choose
 
+test_regex_tests test-regex-tests: test_prep
+	TEST_ARGS='re/*.t ../ext/re/t/*.t' PERL_TEST_HARNESS_ASAP=1 TESTFILE=harness $(RUN_TESTS) choose
+
 !NO!SUBS!
 
 $spitshell>>$Makefile <<!GROK!THIS!

... which ends nicely with this:

re/uniprops10.t ............... ok                                      
re/uniprops06.t ............... ok                                      
re/uniprops07.t ............... ok                                      
re/uniprops08.t ............... ok                                      
re/uniprops09.t ............... ok       
All tests successful.
Files=89, Tests=558456, 25 wallclock secs (21.22 usr  0.66 sys + 81.37 cusr 14.89 csys = 118.14 CPU)
Result: PASS

Let's add this to Makefile.SH.


  • This set of changes requires a perldelta entry, and I will submit in a later commit.

With variant 'make-regex-tests'.  This runs 'make test_prep', then runs
the harness over all the 're/*.t ../ext/re/t/*.t' tests you expect.
@jkeenan
jkeenan requested a review from tonycoz August 10, 2026 18:54
@jkeenan jkeenan changed the title Makefile.SH: Add 'make_regex_tests' Makefile.SH: Add 'test_regex_tests' as make target Aug 10, 2026
@tonycoz

tonycoz commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Wouldn't it be better to just fix test_reonly?

This could be by depending on test_prep as you've done.

Otherwise you could depend on the dynamic lib/auto/Cwd/Cwd.so object in the same way it depends on the dynamic re object.

I suspect that might be pushing your technical knowledge a bit.

(looking at it, I think test_reonly is just plain broken for static builds, or static_ext=re builds, but I don't think it's trying to handle that case.)

@jkeenan

jkeenan commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

One change I'm considering in this pull request ...

The target name test_regex_tests seems verbose, as it repeats test. I think we could get by with just:

make test_regex

Thoughts?

@tonycoz

tonycoz commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

test_reonly works just fine (as a name).

I still don't think we need another name here.

@jkeenan

jkeenan commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

test_reonly works just fine (as a name).

I still don't think we need another name here.

@tonycoz, if you think that the existing test_reonly make target is broken, you should open a separate issue explaining what's wrong with it. That's not an argument I feel a need to take on at present. What I want is a target which you don't have to be a complete expert to understand and whose name is a reasonable description of what it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants