[Perl/perl5] 2451b7: sv.h - add SvREFCNT_dec_set_NULL()

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/require_hook_rebased
  Home:   https://github.com/Perl/perl5
  Commit: 2451b72bdfa2605d035cb6794838b137f31b9a19
  
https://github.com/Perl/perl5/commit/2451b72bdfa2605d035cb6794838b137f31b9a19
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M embed.fnc
M embed.h
M proto.h
M sv.h
M sv_inline.h

  Log Message:
  ---
  sv.h - add SvREFCNT_dec_set_NULL()

and also SvREFCNT_dec_ret_NULL() which is used to implement
SvREFCNT_dec_set_NULL(). The set_NULL() macro is intended to
be used to replace code like this:

if (sv) {
SvREFCNT_dec_NN(sv);
sv = NULL;
}

The function form just facilitates it, and can be used in situations
where returning NULL after decrementing a refcount would be reduce
code complexity.


  Commit: cf40e62f6d4f4aed2153737e808539a59c4bd423
  
https://github.com/Perl/perl5/commit/cf40e62f6d4f4aed2153737e808539a59c4bd423
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M embed.fnc
M embed.h
M mg_names.inc
M mg_raw.h
M mg_vtable.h
M pod/perlguts.pod
M proto.h
M regen/mg_vtable.pl
M scope.c

  Log Message:
  ---
  scope.c - create_sv_destruct/magic_freedestruct (XXX update commit message)

[ More/Better commit message to come ]

This is *heavily* cribberd from Leon's Variable-OnDestruct. See:

https://metacpan.org/dist/Variable-OnDestruct/source/lib/Variable/OnDestruct.xs#L6-17

I am very grateful to him for his help on this.


  Commit: 77e19265561083b711c36082e3440f637ba291e0
  
https://github.com/Perl/perl5/commit/77e19265561083b711c36082e3440f637ba291e0
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M MANIFEST
M embed.fnc
M embed.h
M embedvar.h
M gv.c
M intrpvar.h
M mg.c
M mg_names.inc
M mg_raw.h
M mg_vtable.h
M perl.c
M pod/perldiag.pod
M pod/perlfunc.pod
M pod/perlguts.pod
M pod/perlvar.pod
M pp_ctl.c
M proto.h
M regen/mg_vtable.pl
M sv.c
M t/harness
A t/lib/caller/Bicycle.pm
A t/lib/caller/Cycle.pm
A t/lib/caller/Tricycle.pm
M t/op/glob.t
A t/op/hook/require.t

  Log Message:
  ---
  pp_ctl.c - add support for hooking require.

This defines a new magic hash C<%{^HOOK}> which is intended to be used for
hooking keywords. It is similar to %SIG in that the values it contains
are validated on set, and it is not allowed to store something in
C<%{^HOOK}> that isn't supposed to be there. Hooks are expected to be
coderefs (people can use currying if they really want to put an object
in there, the API is deliberately simple.)

The C<%{^HOOK}> hash is documented to have keys of the form
"${keyword}__${phase}" where $phase is either "before" or "after"
and in this initial release two hooks are supported,
"require__before" and "require__after":

The C hook is called before require is executed,
including any @INC hooks that might be fired. It is called with the path
of the file being required, just as would be stored in %INC. The hook
may alter the filename by writing to $_[0] and it may return a coderef
to be executed *after* the require has completed, otherwise the return
is ignored.  This coderef is also called with the path of the file which
was required, and it will be called regardless as to whether the require
(or its dependencies) die during execution.  This mechanism makes it
trivial and safe to share state between the initial hook and the coderef
it returns.

The C hook is similar to the C hook
however except that it is called after the require completes
(successfully or not), and its return is ignored always.


Compare: https://github.com/Perl/perl5/compare/3dcd4b2a9869...77e192655610


[Perl/perl5] a80345: Mark vtbl argument in sv_unmagicext const in PPPor...

2023-03-16 Thread Leon Timmermans via perl5-changes
  Branch: refs/heads/leont/const_unmagic
  Home:   https://github.com/Perl/perl5
  Commit: a803452961219a3a0f48ad649ee93f2371f9cef7
  
https://github.com/Perl/perl5/commit/a803452961219a3a0f48ad649ee93f2371f9cef7
  Author: Leon Timmermans 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M dist/Devel-PPPort/parts/embed.fnc
M dist/Devel-PPPort/parts/inc/magic

  Log Message:
  ---
  Mark vtbl argument in sv_unmagicext const in PPPort as well




[Perl/perl5] e7f7ae: Mark vtbl argument in sv_unmagicext const

2023-03-16 Thread Leon Timmermans via perl5-changes
  Branch: refs/heads/leont/const_unmagic
  Home:   https://github.com/Perl/perl5
  Commit: e7f7ae6e2d787b619e7b2b6876614e8a4ca0b2ed
  
https://github.com/Perl/perl5/commit/e7f7ae6e2d787b619e7b2b6876614e8a4ca0b2ed
  Author: Leon Timmermans 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M embed.fnc
M proto.h
M sv.c

  Log Message:
  ---
  Mark vtbl argument in sv_unmagicext const




[Perl/perl5] 00852b: sv.h - add SvREFCNT_dec_set_NULL()

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/require_hook_rebased
  Home:   https://github.com/Perl/perl5
  Commit: 00852b4105b731ffbcbf89578d587635bf88d782
  
https://github.com/Perl/perl5/commit/00852b4105b731ffbcbf89578d587635bf88d782
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M embed.fnc
M embed.h
M proto.h
M sv.h
M sv_inline.h

  Log Message:
  ---
  sv.h - add SvREFCNT_dec_set_NULL()

and also SvREFCNT_dec_ret_NULL() which is used to implement
SvREFCNT_dec_set_NULL(). The set_NULL() macro is intended to
be used to replace code like this:

if (sv) {
SvREFCNT_dec_NN(sv);
sv = NULL;
}

The function form just facilitates it, and can be used in situations
where returning NULL after decrementing a refcount would be reduce
code complexity.


  Commit: 3dcd4b2a986921f438f55774bb61329ecfa332b9
  
https://github.com/Perl/perl5/commit/3dcd4b2a986921f438f55774bb61329ecfa332b9
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M MANIFEST
M embed.fnc
M embed.h
M embedvar.h
M gv.c
M intrpvar.h
M mg.c
M mg_names.inc
M mg_raw.h
M mg_vtable.h
M perl.c
M pod/perldiag.pod
M pod/perlfunc.pod
M pod/perlguts.pod
M pod/perlvar.pod
M pp_ctl.c
M proto.h
M regen/mg_vtable.pl
M sv.c
M t/harness
A t/lib/caller/Bicycle.pm
A t/lib/caller/Cycle.pm
A t/lib/caller/Tricycle.pm
M t/op/glob.t
A t/op/hook/require.t

  Log Message:
  ---
  pp_ctl.c - add support for hooking require.

This defines a new magic hash C<%{^HOOK}> which is intended to be used for
hooking keywords. It is similar to %SIG in that the values it contains
are validated on set, and it is not allowed to store something in
C<%{^HOOK}> that isn't supposed to be there. Hooks are expected to be
coderefs (people can use currying if they really want to put an object
in there, the API is deliberately simple.)

The C<%{^HOOK}> hash is documented to have keys of the form
"${keyword}__${phase}" where $phase is either "before" or "after"
and in this initial release two hooks are supported,
"require__before" and "require__after":

The C hook is called before require is executed,
including any @INC hooks that might be fired. It is called with the path
of the file being required, just as would be stored in %INC. The hook
may alter the filename by writing to $_[0] and it may return a coderef
to be executed *after* the require has completed, otherwise the return
is ignored.  This coderef is also called with the path of the file which
was required, and it will be called regardless as to whether the require
(or its dependencies) die during execution.  This mechanism makes it
trivial and safe to share state between the initial hook and the coderef
it returns.

The C hook is similar to the C hook
however except that it is called after the require completes
(successfully or not), and its return is ignored always.


Compare: https://github.com/Perl/perl5/compare/20423f8df1ec...3dcd4b2a9869


[Perl/perl5] 3163c7: sv.h - add SvREFCNT_dec_set_NULL()

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/require_hook_rebased
  Home:   https://github.com/Perl/perl5
  Commit: 3163c73bebf1c465f72cfc86809822500529c33f
  
https://github.com/Perl/perl5/commit/3163c73bebf1c465f72cfc86809822500529c33f
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M embed.fnc
M embed.h
M proto.h
M sv.h
M sv_inline.h

  Log Message:
  ---
  sv.h - add SvREFCNT_dec_set_NULL()

and also SvREFCNT_dec_ret_NULL() which is used to implement
SvREFCNT_dec_set_NULL(). The set_NULL() macro is intended to
be used to replace code like this:

if (sv) {
SvREFCNT_dec_NN(sv);
sv = NULL;
}

The function form just facilitates it, and can be used in situations
where returning NULL after decrementing a refcount would be reduce
code complexity.


  Commit: 20423f8df1ec1f6ec5835c2b11b23073225e17f8
  
https://github.com/Perl/perl5/commit/20423f8df1ec1f6ec5835c2b11b23073225e17f8
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M MANIFEST
M embed.fnc
M embed.h
M embedvar.h
M gv.c
M intrpvar.h
M mg.c
M mg_names.inc
M mg_raw.h
M mg_vtable.h
M perl.c
M pod/perldiag.pod
M pod/perlfunc.pod
M pod/perlguts.pod
M pod/perlvar.pod
M pp_ctl.c
M proto.h
M regen/mg_vtable.pl
M sv.c
M t/harness
A t/lib/caller/Bicycle.pm
A t/lib/caller/Cycle.pm
A t/lib/caller/Tricycle.pm
M t/op/glob.t
A t/op/hook/require.t

  Log Message:
  ---
  pp_ctl.c - add support for hooking require.

This defines a new magic hash C<%{^HOOK}> which is intended to be used for
hooking keywords. It is similar to %SIG in that the values it contains
are validated on set, and it is not allowed to store something in
C<%{^HOOK}> that isn't supposed to be there. Hooks are expected to be
coderefs (people can use currying if they really want to put an object
in there, the API is deliberately simple.)

The C<%{^HOOK}> hash is documented to have keys of the form
"${keyword}__${phase}" where $phase is either "before" or "after"
and in this initial release two hooks are supported,
"require__before" and "require__after":

The C hook is called before require is executed,
including any @INC hooks that might be fired. It is called with the path
of the file being required, just as would be stored in %INC. The hook
may alter the filename by writing to $_[0] and it may return a coderef
to be executed *after* the require has completed, otherwise the return
is ignored.  This coderef is also called with the path of the file which
was required, and it will be called regardless as to whether the require
(or its dependencies) die during execution.  This mechanism makes it
trivial and safe to share state between the initial hook and the coderef
it returns.

The C hook is similar to the C hook
however except that it is called after the require completes
(successfully or not), and its return is ignored always.


Compare: https://github.com/Perl/perl5/compare/6bc97d9862f5...20423f8df1ec


[Perl/perl5] 6ae820: t/lib/GH_15109 - rename to t/lib/caller

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/require_hook_rebased
  Home:   https://github.com/Perl/perl5
  Commit: 6ae8209f5a0f6661411587562e50ea2bf01abaeb
  
https://github.com/Perl/perl5/commit/6ae8209f5a0f6661411587562e50ea2bf01abaeb
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M MANIFEST
R t/lib/GH_15109/Apack.pm
R t/lib/GH_15109/Bpack.pm
R t/lib/GH_15109/Cpack.pm
R t/lib/GH_15109/Foo.pm
A t/lib/caller/Apack.pm
A t/lib/caller/Bpack.pm
A t/lib/caller/Cpack.pm
A t/lib/caller/Foo.pm
M t/op/caller.t

  Log Message:
  ---
  t/lib/GH_15109 - rename to t/lib/caller

I want to use these modules in other tests, so changing the name
makes sense.


  Commit: 567a3658ec596789cbd7878ec1508a862a1df8c8
  
https://github.com/Perl/perl5/commit/567a3658ec596789cbd7878ec1508a862a1df8c8
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M regen/mg_vtable.pl

  Log Message:
  ---
  regen/mg_vtable.pl - rename confusing var %sig to %vtable_conf


  Commit: 5546ec4bb6ac6e3938f34bd4dd97940851c97aab
  
https://github.com/Perl/perl5/commit/5546ec4bb6ac6e3938f34bd4dd97940851c97aab
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M embed.fnc
M embed.h
M proto.h
M sv.h
M sv_inline.h

  Log Message:
  ---
  sv.h - add SvREFCNT_dec_set_NULL()

and also SvREFCNT_dec_ret_NULL() which is used to implement
SvREFCNT_dec_set_NULL(). The set_NULL() macro is intended to
be used to replace code like this:

if (sv) {
SvREFCNT_dec_NN(sv);
sv = NULL;
}

The function form just facilitates it, and can be used in situations
where returning NULL after decrementing a refcount would be reduce
code complexity.


  Commit: 6bc97d9862f5923b3f63b6f001e0560e51e16ce8
  
https://github.com/Perl/perl5/commit/6bc97d9862f5923b3f63b6f001e0560e51e16ce8
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M MANIFEST
M embed.fnc
M embed.h
M embedvar.h
M gv.c
M intrpvar.h
M mg.c
M mg_names.inc
M mg_raw.h
M mg_vtable.h
M perl.c
M pod/perldiag.pod
M pod/perlfunc.pod
M pod/perlguts.pod
M pod/perlvar.pod
M pp_ctl.c
M proto.h
M regen/mg_vtable.pl
M sv.c
M t/harness
A t/lib/caller/Bicycle.pm
A t/lib/caller/Cycle.pm
A t/lib/caller/Tricycle.pm
M t/op/glob.t
A t/op/hook/require.t

  Log Message:
  ---
  pp_ctl.c - add support for hooking require.

This defines a new magic hash C<%{^HOOK}> which is intended to be used for
hooking keywords. It is similar to %SIG in that the values it contains
are validated on set, and it is not allowed to store something in
C<%{^HOOK}> that isn't supposed to be there. Hooks are expected to be
coderefs (people can use currying if they really want to put an object
in there, the API is deliberately simple.)

The C<%{^HOOK}> hash is documented to have keys of the form
"${keyword}__${phase}" where $phase is either "before" or "after"
and in this initial release two hooks are supported,
"require__before" and "require__after":

The C hook is called before require is executed,
including any @INC hooks that might be fired. It is called with the path
of the file being required, just as would be stored in %INC. The hook
may alter the filename by writing to $_[0] and it may return a coderef
to be executed *after* the require has completed, otherwise the return
is ignored.  This coderef is also called with the path of the file which
was required, and it will be called regardless as to whether the require
(or its dependencies) die during execution.  This mechanism makes it
trivial and safe to share state between the initial hook and the coderef
it returns.

The C hook is similar to the C hook
however except that it is called after the require completes
(successfully or not), and its return is ignored always.


Compare: https://github.com/Perl/perl5/compare/50cbd72cf96b...6bc97d9862f5


[Perl/perl5] 50cbd7: pp_ctl.c - add support for hooking require.

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/require_hook_rebased
  Home:   https://github.com/Perl/perl5
  Commit: 50cbd72cf96b36976581dae2c1bbe8e40e41e36e
  
https://github.com/Perl/perl5/commit/50cbd72cf96b36976581dae2c1bbe8e40e41e36e
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M MANIFEST
M embed.fnc
M embed.h
M embedvar.h
M gv.c
M intrpvar.h
M mg.c
M mg_names.inc
M mg_raw.h
M mg_vtable.h
M perl.c
M pod/perldiag.pod
M pod/perlfunc.pod
M pod/perlguts.pod
M pod/perlvar.pod
M pp_ctl.c
M proto.h
M regen/mg_vtable.pl
M sv.c
M t/harness
A t/lib/caller/Bicycle.pm
A t/lib/caller/Cycle.pm
A t/lib/caller/Tricycle.pm
M t/op/glob.t
A t/op/hook/require.t

  Log Message:
  ---
  pp_ctl.c - add support for hooking require.

This defines a new magic hash C<%{^HOOK}> which is intended to be used for
hooking keywords. It is similar to %SIG in that the values it contains
are validated on set, and it is not allowed to store something in
C<%{^HOOK}> that isn't supposed to be there. Hooks are expected to be
coderefs (people can use currying if they really want to put an object
in there, the API is deliberately simple.)

The C<%{^HOOK}> hash is documented to have keys of the form
"${keyword}__${phase}" where $phase is either "before" or "after"
and in this initial release two hooks are supported,
"require__before" and "require__after":

The C hook is called before require is executed,
including any @INC hooks that might be fired. It is called with the path
of the file being required, just as would be stored in %INC. The hook
may alter the filename by writing to $_[0] and it may return a coderef
to be executed *after* the require has completed, otherwise the return
is ignored.  This coderef is also called with the path of the file which
was required, and it will be called regardless as to whether the require
(or its dependencies) die during execution.  This mechanism makes it
trivial and safe to share state between the initial hook and the coderef
it returns.

The C hook is similar to the C hook
however except that it is called after the require completes
(successfully or not), and its return is ignored always.




[Perl/perl5] b4a34f: sv.h - add SvREFCNT_dec_set_NULL()

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/require_hook_rebased
  Home:   https://github.com/Perl/perl5
  Commit: b4a34f15777564b6800d696203cad20f32bb9e05
  
https://github.com/Perl/perl5/commit/b4a34f15777564b6800d696203cad20f32bb9e05
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M embed.fnc
M embed.h
M proto.h
M sv.h
M sv_inline.h

  Log Message:
  ---
  sv.h - add SvREFCNT_dec_set_NULL()

and also SvREFCNT_dec_ret_NULL() which is used to implement
SvREFCNT_dec_set_NULL(). The set_NULL() macro is intended to
be used to replace code like this:

if (sv) {
SvREFCNT_dec_NN(sv);
sv = NULL;
}

The function form just facilitates it, and can be used in situations
where returning NULL after decrementing a refcount would be reduce
code complexity.


  Commit: 58319e080b19c236c64374bb0a382ef6a0790da1
  
https://github.com/Perl/perl5/commit/58319e080b19c236c64374bb0a382ef6a0790da1
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M MANIFEST
M embed.fnc
M embed.h
M embedvar.h
M gv.c
M intrpvar.h
M mg.c
M mg_names.inc
M mg_raw.h
M mg_vtable.h
M perl.c
M pod/perldiag.pod
M pod/perlfunc.pod
M pod/perlguts.pod
M pod/perlvar.pod
M pp_ctl.c
M proto.h
M regen/mg_vtable.pl
M sv.c
M t/harness
A t/lib/caller/Bicycle.pm
A t/lib/caller/Cycle.pm
A t/lib/caller/Tricycle.pm
M t/op/glob.t
A t/op/hook/require.t

  Log Message:
  ---
  pp_ctl.c - add support for hooking require.

This defines a new magic hash C<%{^HOOK}> which is intended to be used for
hooking keywords. It is similar to %SIG in that the values it contains
are validated on set, and it is not allowed to store something in
C<%{^HOOK}> that isn't supposed to be there. Hooks are expected to be
coderefs (people can use currying if they really want to put an object
in there, the API is deliberately simple.)

The C<%{^HOOK}> hash is documented to have keys of the form
"${keyword}__${phase}" where $phase is either "before" or "after"
and in this initial release two hooks are supported,
"require__before" and "require__after":

The C hook is called before require is executed,
including any @INC hooks that might be fired. It is called with the path
of the file being required, just as would be stored in %INC. The hook
may alter the filename by writing to $_[0] and it may return a coderef
to be executed *after* the require has completed, otherwise the return
is ignored.  This coderef is also called with the path of the file which
was required, and it will be called regardless as to whether the require
(or its dependencies) die during execution.  This mechanism makes it
trivial and safe to share state between the initial hook and the coderef
it returns.

The C hook is similar to the C hook
however except that it is called after the require completes
(successfully or not), and its return is ignored always.


Compare: https://github.com/Perl/perl5/compare/8a581ae6afaf...58319e080b19


[Perl/perl5]

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/fix_harness_missing_test_files_in_manifest
  Home:   https://github.com/Perl/perl5


[Perl/perl5] 938df7: test_pl tests - we have not been testing test.pl f...

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 938df7bd54133016aa8627c69d8380a1742b25da
  
https://github.com/Perl/perl5/commit/938df7bd54133016aa8627c69d8380a1742b25da
  Author: Yves Orton 
  Date:   2023-03-17 (Fri, 17 Mar 2023)

  Changed paths:
M t/test.pl
M t/test_pl/can_isa_ok.t
M t/test_pl/plan_skip_all.t
M t/test_pl/tempfile.t

  Log Message:
  ---
  test_pl tests - we have not been testing test.pl for some time, fix tests

Somewhere along the way we stopped testing test.pl itself. This fixes
that oversight, and repairs the tests to accomodate some of the changes
that should have been noticed.

This includes hardening the tests for Win32, which does not allow unlinking
a file that is open.


  Commit: 508a94b63cac0897fed26cb5972a13b2e974ee8c
  
https://github.com/Perl/perl5/commit/508a94b63cac0897fed26cb5972a13b2e974ee8c
  Author: Yves Orton 
  Date:   2023-03-17 (Fri, 17 Mar 2023)

  Changed paths:
M t/TEST
M t/harness

  Log Message:
  ---
  t/harness - die if t/harness wont run a test listed in MANIFEST

Historically we used to parse out the tests that we ran in t/harness
from the MANIFEST file.  At some point this changed and we started
consulting the disk using globs.  However because we do not use a
recursive search over the t/ directory it is quite possible that a new
directory of tests is added which actually never runs.

In https://github.com/Perl/perl5/pull/20637#discussion_r1137878155 Tony
C noticed that I had added a new test file t/op/hook/require.t which is
in a new subdirectory t/op/hook/ which was unknown to t/harness and thus
not actually being run by make test_harness.  (This patch does NOT add
t/op/hoop to the list of directories to scan, I will do that in the PR.)

I then took the time to add code to detect if any other test files are
not being run, and it turns out that it is also the case for the new
t/class/ directory of tests and it is also the case for the tests for
test.pl itself, found in the t/test_pl directory.

This patch adds logic to detect if this happens and make t/harness die
if it finds a test file in the manifest which will not be detected by
the custom rules for finding test files that is used in t/harness.  It
does not die if t/harness finds tests that are not in MANIFEST, that
should be detected by a different test.

The level of complexity in finding and deciding the tests files that we
should run, and the differences between t/TEST and t/harness is fairly
high.  In the past Nicholas put some effort into unifying the logic, but
it seems since then we have drifted apart.  Even though t/harness uses
t/TEST and the _tests_from_manifest() function, for some time now it
has only used it to find which extensions to test, not which test
files to run.  I have *NOT* dug into whether t/TEST is also missing
test files that are in manifest.  That can happen in a follow up patch.

Long term we should unify all of this logic so that t/TEST and t/harness
run the same test files always, and that we will always detect
discrepancies between the MANIFEST and the tests we are running.  We do
not for instance test that they test the same things. :-) :-(


Compare: https://github.com/Perl/perl5/compare/801c406dcd5a...508a94b63cac


[Perl/perl5] ca57be: test_pl tests - we have not been testing test.pl f...

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/fix_harness_missing_test_files_in_manifest
  Home:   https://github.com/Perl/perl5
  Commit: ca57bed5535061d201a2f85a24a72aa9c95c7a62
  
https://github.com/Perl/perl5/commit/ca57bed5535061d201a2f85a24a72aa9c95c7a62
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M t/test.pl
M t/test_pl/can_isa_ok.t
M t/test_pl/plan_skip_all.t
M t/test_pl/tempfile.t

  Log Message:
  ---
  test_pl tests - we have not been testing test.pl for some time, fix tests

Somewhere along the way we stopped testing test.pl itself. This fixes
that oversight, and repairs the tests to accomodate some of the changes
that should have been noticed.

This includes hardening the tests for Win32, which does not allow unlinking
a file that is open.


  Commit: 874a1e6aaa16adc69d28b8182d6cd44d5f871307
  
https://github.com/Perl/perl5/commit/874a1e6aaa16adc69d28b8182d6cd44d5f871307
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M t/TEST
M t/harness

  Log Message:
  ---
  t/harness - die if t/harness wont run a test listed in MANIFEST

Historically we used to parse out the tests that we ran in t/harness
from the MANIFEST file.  At some point this changed and we started
consulting the disk using globs.  However because we do not use a
recursive search over the t/ directory it is quite possible that a new
directory of tests is added which actually never runs.

In https://github.com/Perl/perl5/pull/20637#discussion_r1137878155 Tony
C noticed that I had added a new test file t/op/hook/require.t which is
in a new subdirectory t/op/hook/ which was unknown to t/harness and thus
not actually being run by make test_harness.  (This patch does NOT add
t/op/hoop to the list of directories to scan, I will do that in the PR.)

I then took the time to add code to detect if any other test files are
not being run, and it turns out that it is also the case for the new
t/class/ directory of tests and it is also the case for the tests for
test.pl itself, found in the t/test_pl directory.

This patch adds logic to detect if this happens and make t/harness die
if it finds a test file in the manifest which will not be detected by
the custom rules for finding test files that is used in t/harness.  It
does not die if t/harness finds tests that are not in MANIFEST, that
should be detected by a different test.

The level of complexity in finding and deciding the tests files that we
should run, and the differences between t/TEST and t/harness is fairly
high.  In the past Nicholas put some effort into unifying the logic, but
it seems since then we have drifted apart.  Even though t/harness uses
t/TEST and the _tests_from_manifest() function, for some time now it
has only used it to find which extensions to test, not which test
files to run.  I have *NOT* dug into whether t/TEST is also missing
test files that are in manifest.  That can happen in a follow up patch.

Long term we should unify all of this logic so that t/TEST and t/harness
run the same test files always, and that we will always detect
discrepancies between the MANIFEST and the tests we are running.  We do
not for instance test that they test the same things. :-) :-(


Compare: https://github.com/Perl/perl5/compare/875431fc7d68...874a1e6aaa16


[Perl/perl5] 3cdb7b: test_pl tests - we have not been testing test.pl f...

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/fix_harness_missing_test_files_in_manifest
  Home:   https://github.com/Perl/perl5
  Commit: 3cdb7bc2161ac18be4ccfd971dbfdb4d9c4d2b29
  
https://github.com/Perl/perl5/commit/3cdb7bc2161ac18be4ccfd971dbfdb4d9c4d2b29
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M t/test.pl
M t/test_pl/can_isa_ok.t
M t/test_pl/plan_skip_all.t
M t/test_pl/tempfile.t

  Log Message:
  ---
  test_pl tests - we have not been testing test.pl for some time, fix tests

Somewhere along the way we stopped testing test.pl itself. This fixes
that oversight, and repairs the tests to accomodate some of the changes
that should have been noticed.


  Commit: 875431fc7d68506011a28dbfcdd054574ea8baee
  
https://github.com/Perl/perl5/commit/875431fc7d68506011a28dbfcdd054574ea8baee
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M t/TEST
M t/harness

  Log Message:
  ---
  t/harness - die if t/harness wont run a test listed in MANIFEST

Historically we used to parse out the tests that we ran in t/harness
from the MANIFEST file.  At some point this changed and we started
consulting the disk using globs.  However because we do not use a
recursive search over the t/ directory it is quite possible that a new
directory of tests is added which actually never runs.

In https://github.com/Perl/perl5/pull/20637#discussion_r1137878155 Tony
C noticed that I had added a new test file t/op/hook/require.t which is
in a new subdirectory t/op/hook/ which was unknown to t/harness and thus
not actually being run by make test_harness.  (This patch does NOT add
t/op/hoop to the list of directories to scan, I will do that in the PR.)

I then took the time to add code to detect if any other test files are
not being run, and it turns out that it is also the case for the new
t/class/ directory of tests and it is also the case for the tests for
test.pl itself, found in the t/test_pl directory.

This patch adds logic to detect if this happens and make t/harness die
if it finds a test file in the manifest which will not be detected by
the custom rules for finding test files that is used in t/harness.  It
does not die if t/harness finds tests that are not in MANIFEST, that
should be detected by a different test.

The level of complexity in finding and deciding the tests files that we
should run, and the differences between t/TEST and t/harness is fairly
high.  In the past Nicholas put some effort into unifying the logic, but
it seems since then we have drifted apart.  Even though t/harness uses
t/TEST and the _tests_from_manifest() function, for some time now it
has only used it to find which extensions to test, not which test
files to run.  I have *NOT* dug into whether t/TEST is also missing
test files that are in manifest.  That can happen in a follow up patch.

Long term we should unify all of this logic so that t/TEST and t/harness
run the same test files always, and that we will always detect
discrepancies between the MANIFEST and the tests we are running.  We do
not for instance test that they test the same things. :-) :-(


Compare: https://github.com/Perl/perl5/compare/64a8fa3566e2...875431fc7d68


[Perl/perl5] 64a8fa: t/harness - die if t/harness wont run a test liste...

2023-03-16 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/fix_harness_missing_test_files_in_manifest
  Home:   https://github.com/Perl/perl5
  Commit: 64a8fa3566e20bc81beb33861d60c00e97862759
  
https://github.com/Perl/perl5/commit/64a8fa3566e20bc81beb33861d60c00e97862759
  Author: Yves Orton 
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
M t/TEST
M t/harness

  Log Message:
  ---
  t/harness - die if t/harness wont run a test listed in MANIFEST

Historically we used to parse out the tests that we ran in t/harness
from the MANIFEST file.  At some point this changed and we started
consulting the disk using globs.  However because we do not use a
recursive search over the t/ directory it is quite possible that a new
directory of tests is added which actually never runs.

In https://github.com/Perl/perl5/pull/20637#discussion_r1137878155 Tony
C noticed that I had added a new test file t/op/hook/require.t which is
in a new subdirectory t/op/hook/ which was unknown to t/harness and thus
not actually being run by make test_harness.  (This patch does NOT add
t/op/hoop to the list of directories to scan, I will do that in the PR.)

I then took the time to add code to detect if any other test files are
not being run, and it turns out that it is also the case for the new
t/class/ directory of tests and it is also the case for the tests for
test.pl itself, found in the t/test_pl directory.

This patch adds logic to detect if this happens and make t/harness die
if it finds a test file in the manifest which will not be detected by
the custom rules for finding test files that is used in t/harness.  It
does not die if t/harness finds tests that are not in MANIFEST, that
should be detected by a different test.

The level of complexity in finding and deciding the tests files that we
should run, and the differences between t/TEST and t/harness is fairly
high.  In the past Nicholas put some effort into unifying the logic, but
it seems since then we have drifted apart.  Even though t/harness uses
t/TEST and the _tests_from_manifest() function, for some time now it
has only used it to find which extensions to test, not which test
files to run.  I have *NOT* dug into whether t/TEST is also missing
test files that are in manifest.  That can happen in a follow up patch.

Long term we should unify all of this logic so that t/TEST and t/harness
run the same test files always, and that we will always detect
discrepancies between the MANIFEST and the tests we are running.  We do
not for instance test that they test the same things. :-) :-(