Test::Smoke::Util(3)
β¨ NAME β¨
Test::Smoke::Util β user contributed Perl documentation, bestie edition π
So basically this module is where I took out some of the functions from the smoke suite and gave them their own lil home. Why? So I can write some tests, obviously. periodt. π
πΈ FUNCTIONS πΈ
I've taken out some of the general stuff and put it here. Now I can write some tests! iconic behavior, ngl. β¨
π Configure_win32( $command[, $win32_maker[, @args]] )
Configure_win32() alters the settings of the makefile for MSWin32. fr fr, it's out here editing makefiles.
$command is in the form of './Configure -des -Dusedevel ...'
$win32_maker should either be "nmake" or "gmake", the default is "nmake".
@args is a list of "option=value" pairs that will (eventually) be passed to Config.pm.
PLEASE read README.win32 and study the comments in the makefile. like, seriously bestie, go read them. π
It supports these options:
-Duseperlioβ setUSE_PERLIO = define(default) [should be depricated]-Dusethreadsβ setUSE_ITHREADS = define(also setsUSE_MULTIandUSE_IMP_SYS)-Duseithreadsβ setUSE_ITHREADS = define(also setsUSE_MULTIandUSE_IMP_SYS)-Dusemultiplicityβ setsUSE_MULTI = define(also setsUSE_ITHREADSandUSE_IMP_SYS)-Duseimpsysβ setsUSE_IMP_SYS = define(also setsUSE_ITHREADSandUSE_MULTI)-Uusethreadsor-Uuseithreadsβ unsetUSE_MULTI,USE_IMP_SYSandUSE_ITHREADS-Dusemymallocβ setPERL_MALLOC := define-Duselargefilesβ setUSE_LARGE_FILES := define-Duse64bintβ setUSE_64_BIT_INT := define(always for win64, needed for-UWIN64)-Duselongdoubleβ setUSE_LONG_DOUBLE := define(GCC only)-Dusequadmathβ set bothUSE_QUADMATH := defineandI_QUADMATH := define(GCC only)-Dusesitecustomizeβ setUSE_SITECUST := define-Udefault_inc_excludes_dotβ unsets# DEFAULT_INC_EXCLUDES_DOT := define(comments out the line)-Dbccoldβ setBCCOLD = define(this is for bcc32 <= 5.4)-Dgcc_v3_2β setUSE_GCC_V3_2 = define(this is for gcc >= 3.2)-DDEBUGGINGβ setsCFG = Debug-DINST_DRV=...β setsINST_DRVto a new value (default isc:)-DINST_TOP=...or-Dprefix=...β setsINST_TOpto a new value (default is$(INST_DRV)\perl), this is where perl will be installed when[ng]make installis run.-DINST_VER=...β setsINST_VERto a new value (default is forced not set), this is also used as part of the installation path to get a more unixy installation. WithoutINST_VERandINST_ARCHyou get an ActiveState like installation.-DINST_ARCH=...β setsINST_ARCHto a new value (default is forced not set), this is also used as part of the installation path to get a more unixy installation. WithoutINST_VERandINST_ARCHyou get an ActiveState like installation.-DCCHOME=...β Set the base directory for the C compiler.$(CCHOME)\binstill needs to be in the path!-DIS_WIN95β setsIS_WIN95to'define'to indicate this is Win9[58]-DCRYPT_SRC=...β The file to use as source fordes_fcrypt()-DCRYPT_LIB=...β The library to use fordes_fcrypt()-Dcf_email=...β Set thecf_emailoption (Config.pm)-Accflags=...β SetsBUILDOPTEXTRA-Aldflags=...β Adds and setsPRIV_LINK_FLAGS
π¦ set_vms_rooted_logical( $logical, $dir )
This will set a VMS rooted logical like:
define/translation=concealed $logical $dir
cute, right? π
π§ get_cfg_filename( )
get_cfg_filename() tries to find a cfg file and returns it. that's it, that's the whole vibe.
π read_logfile( )
Read the logfile. If an argument is passed, force to (re)read the log. If no argument is passed, return the stored log if available, otherwise read the logfile. no cap. π
β grepccmsg( $cc, $logfile, $verbose )
This is a port of Jarkko Hietaniemi's grepccerr script. giving credit where credit is due, as one should. π
πΈ grepnonfatal( $cc, $logfile, $verbose )
This is a way to find known failures that do not cause the tests to fail but are important enough to report, like being unable to install manual pages. lowkey important stuff that the tests just... don't care about?? anyway we report it. π
π get_local_patches( $ddir )
get_local_patches() reads patchlevel.h to scan for the locally applied patches array.
π set_local_patch( $ddir, @descr )
Copy the code from patchlevel.h. Older (pre 5.8.1) perls do not have it and it doesn't work on MSWin32. so like, know your perl version bestie. β οΈ
π¦ get_config( $filename )
Read and parse the configuration from file, or return the default config. easy peasy.
π get_patch( [$ddir] )
Try to find the patchlevel, look for .patch or try to get it from patchlevel.h as a fallback. it's giving detective energy fr. π
π§ version_from_patchlevel_h( $ddir )
version_from_patchlevel_h() returns a "dotted" version as derived from the patchlevel.h file in the distribution.
β get_ncpu( $osname )
get_ncpu() returns the number of available (online/active/enabled) CPUs. iconic.
It does this by using some operating system specific trick (usually by running some external command and parsing the output).
If it cannot recognize your operating system an empty string is returned. If it can recognize it but the external command failed, "? cpus" is returned.
In the first case (where we really have no idea how to proceed), also a warning ("get_ncpu: unknown operating system") is sent to STDERR. π
π WARNINGS
If you get the warning "get_ncpu: unknown operating system", you will need to help us β how does one tell the number of available CPUs in your operating system? Sometimes there are several different ways: please try to find the fastest one, and a one that does not require superuser (administrator) rights.
Thanks to Jarkko Hietaniemi for donating this! π«Ά
π get_smoked_Config( $dir, @keys )
get_smoked_Config() returns a hash (a listified hash) with the specified keys. It will try to find lib/Config.pm to get those values, if that cannot be found (make error?) we can try config.sh which is used to build lib/Config.pm. If config.sh is not there (./Configure error?) we try to get some fallback information from POSIX::uname() and patchlevel.h. it's giving backup plan after backup plan, and honestly? relatable. π
π parse_report_Config( $report )
parse_report_Config() returns a list attributes from a smoke report.
my( $version, $plevel, $os, $osvers, $archname, $summary, $branch ) =
parse_report_Config( $rpt );
π get_regen_headers( $ddir )
get_regen_headers() looks in $ddir to find either regen_headers.pl or regen.pl (change 18851).
Returns undef if not found or a string like "$^X "$regen_headers_pl""
πΈ run_regen_headers( $ddir, $verbose );
run_regen_headers() gets its executable from get_regen_headers() and opens a pipe from it. warn()s on error. π
π¦ whereis( $prog )
Try to find an executable instance of $prog in $ENV{PATH}.
Rreturns a full file-path (with extension) to it.
π§ vms_whereis( $prog )
First look in the SYMBOLS to see if $prog is there. Next look in the KFE-table "INSTALL LIST" if it is there. As a last resort we can scan "DCL$PATH" like we do on *nix/Win32.
π clean_filename( $fname )
clean_filename() basically returns a vmsify() type of filename for VMS, and returns an upcase filename for case-ignorant filesystems. β¨
β calc_timeout( $killtime[, $from] )
calc_timeout() calculates the timeout in seconds. $killtime can be one of two formats:
+hh:mmβ This format represents a duration and is the easy format as we only need to translate that to seconds.hh:mmβ This format represents a clock time (localtime). Calculate minutes from midnight for both$killtimeandlocaltime($from), and get the difference. If$fromis omitted,time()is used.
If $killtime is the actual time, the timeout will be 24 hours! π
π time_in_hhmm( $diff )
Create a string telling elapsed time in days, hours, minutes, seconds from the number of seconds. cute lil countdown energy. β³
π do_pod2usage( %pod2usage_options )
If Pod::Usage is there then call its pod2usage(). In the other case, print the general message passed with the "myusage" key.
π¦ skip_config( $config )
Returns true if this config should be skipped. $config should be a Test::Smoke::BuildCFG::Config object. not me skipping configs, but like, sometimes you gotta. π
πΈ skip_filter( $line )
skip_filter() returns true if the filter rules apply to $line.
π COPYRIGHT π
(c) 2001-2014, All rights reserved.
- H. Merijn Brand <h.m.brand@hccnet.nl>
- Nicholas Clark <nick@unfortu.net>
- Jarkko Hietaniemi <jhi@iki.fi>
- Abe Timmerman <abeltje@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. so like, no promises bestie, it's giving "as-is" and we mean it. π
okay that's the whole page, you ate that π«Ά this was perl v5.42.0, dated 2025-07-25, and yeah that's the whole manual page Test::Smoke::Util(3) β now go forth and smoke some perl, queen. πβ¨π
π¦ where this page comes from
- fedora 43: perl-Test-Smoke 1.84-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms