I have a Windows-only module on CPAN (exact opposite of your case) but I do the "same", test if it's Windows and then the version of Windows. I do it in the Makefile.PL since the module is completely useless on *nix:
# Only supported on Win32 unless ($^O eq "MSWin32" || $^O eq "cygwin") { die "OS unsupported\n" } # Must be Win32 version greater than 5 # _WIN32_WINNT must be defined as greater than 5 for # LockWorkStation prototype to be defined in winuser.h. my $ver = `ver`; $ver =~ / ([\d\.]+)/; $ver = $1; if ($ver < 5) { die "OS unsupported\n Windows version must be greater than 5.\n +Found '$ver' with the 'ver' command." } WriteMakefile( [...]
If you don't want to preemptive test in the Makefile.PL, you can use SKIP in the tests after determining OS is Windows to skip over tests that won't make sense / fail.
In reply to Re: Tests on Windows for Unix-only module
by VinsWorldcom
in thread Tests on Windows for Unix-only module
by mikosullivan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |