Test::Smoke::Util(3)

πŸ“¦
version 1.84 Β· 2 versions
, in fedora 43

✨ 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 β€” set USE_PERLIO = define (default) [should be depricated]
  • -Dusethreads β€” set USE_ITHREADS = define (also sets USE_MULTI and USE_IMP_SYS)
  • -Duseithreads β€” set USE_ITHREADS = define (also sets USE_MULTI and USE_IMP_SYS)
  • -Dusemultiplicity β€” sets USE_MULTI = define (also sets USE_ITHREADS and USE_IMP_SYS)
  • -Duseimpsys β€” sets USE_IMP_SYS = define (also sets USE_ITHREADS and USE_MULTI)
  • -Uusethreads or -Uuseithreads β€” unset USE_MULTI, USE_IMP_SYS and USE_ITHREADS
  • -Dusemymalloc β€” set PERL_MALLOC := define
  • -Duselargefiles β€” set USE_LARGE_FILES := define
  • -Duse64bint β€” set USE_64_BIT_INT := define (always for win64, needed for -UWIN64)
  • -Duselongdouble β€” set USE_LONG_DOUBLE := define (GCC only)
  • -Dusequadmath β€” set both USE_QUADMATH := define and I_QUADMATH := define (GCC only)
  • -Dusesitecustomize β€” set USE_SITECUST := define
  • -Udefault_inc_excludes_dot β€” unsets # DEFAULT_INC_EXCLUDES_DOT := define (comments out the line)
  • -Dbccold β€” set BCCOLD = define (this is for bcc32 <= 5.4)
  • -Dgcc_v3_2 β€” set USE_GCC_V3_2 = define (this is for gcc >= 3.2)
  • -DDEBUGGING β€” sets CFG = Debug
  • -DINST_DRV=... β€” sets INST_DRV to a new value (default is c:)
  • -DINST_TOP=... or -Dprefix=... β€” sets INST_TOp to a new value (default is $(INST_DRV)\perl), this is where perl will be installed when [ng]make install is run.
  • -DINST_VER=... β€” sets INST_VER to a new value (default is forced not set), this is also used as part of the installation path to get a more unixy installation. Without INST_VER and INST_ARCH you get an ActiveState like installation.
  • -DINST_ARCH=... β€” sets INST_ARCH to a new value (default is forced not set), this is also used as part of the installation path to get a more unixy installation. Without INST_VER and INST_ARCH you get an ActiveState like installation.
  • -DCCHOME=... β€” Set the base directory for the C compiler. $(CCHOME)\bin still needs to be in the path!
  • -DIS_WIN95 β€” sets IS_WIN95 to 'define' to indicate this is Win9[58]
  • -DCRYPT_SRC=... β€” The file to use as source for des_fcrypt()
  • -DCRYPT_LIB=... β€” The library to use for des_fcrypt()
  • -Dcf_email=... β€” Set the cf_email option (Config.pm)
  • -Accflags=... β€” Sets BUILDOPTEXTRA
  • -Aldflags=... β€” Adds and sets PRIV_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 $killtime and localtime($from), and get the difference. If $from is 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.


(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