test-webkitperl outputs errors about unused $platform variable
Created attachment 458340 [details] Patch
Comment on attachment 458340 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458340&action=review > Tools/ChangeLog:9 > + Extract the tested code to a module to be able to imported in well-defined > + manner. Do we have to do all of this to silence one warning? Splitting simple Perl scripts into multiple files creates significant barriers to development. Folks have had a lot of trouble refactoring Perl code because of webkitdirs.pm already. Factoring out well isolated and abstracted pieces of functionality is one thing, but pulling a function that's intrinsically inseparable from the main script seems wrong to me.
This already got r+ from the bug linked to in see also. The other option is to make the perl script a module too, but I don't know perl enough to understand how to import such a module. eg. how to do the logical equivalent of pseudo-code: use filter-build-webkit qw(shouldIgnoreLine $platform); It's not so much a warning as quite bogus way of running the script via eval and not having half the variables defined.
https://www.perlmonks.org/?node_id=621378 addreresses some part of "executable as a module"
In essence I agree, but also running code in a bogus way is not very good too. Investigate how to export stuff from perl script as a module? Move all code to the module? Write all code in python and be done with it?
https://stackoverflow.com/questions/468675/how-can-i-test-a-standalone-perl-script
Created attachment 458428 [details] Patch
Created attachment 458432 [details] Patch
Comment on attachment 458432 [details] Patch I'm not enough of a Perl expert to understand every technical detail here. But this is structured elegantly, and clearly is a good improvement.
Committed r293568 (250082@main): <https://commits.webkit.org/250082@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458432 [details].
<rdar://problem/92445079>