Skip to content

Commit

Permalink
Add automated tests via TravisCI and AppVeyor.
Browse files Browse the repository at this point in the history
Prep for a trial release by setting the version accordingly.
  • Loading branch information
genio committed Sep 28, 2018
1 parent 33b69d3 commit 9c171a4
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 4 deletions.
67 changes: 67 additions & 0 deletions .appveyor.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
@echo off
call :%*
goto :eof

:perl_setup
if not defined perl_type set perl_type=system
if "%perl_type%" == "cygwin" (
start /wait c:\cygwin\setup-x86.exe -q -g -P perl -P binutils -P make -P gcc -P gcc-core -P gcc-g++ -P make -P pkg-config -P libcrypt-devel -P openssl-devel -P autoconf -P automake -P m4 -P libtool -P curl
set "PATH=C:\cygwin\usr\local\bin;C:\cygwin\bin;%PATH%"
) else if "%perl_type%" == "strawberry" (
if not defined perl_version (
cinst -y StrawberryPerl
) else (
cinst -y StrawberryPerl --version %perl_version%
)
if errorlevel 1 (
type C:\ProgramData\chocolatey\logs\chocolatey.log
exit /b 1
)
set "PATH=C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;%PATH%"
) else if "%perl_type%" == "activestate" (
start /wait ppm install dmake MinGW
) else (
echo.Unknown perl type "%perl_type%"! 1>&2
exit /b 1
)
for /f "usebackq delims=" %%d in (`perl -MConfig -e"print $Config{make}"`) do set "make=%%d"
set "perl=perl"
set "cpanm=call .appveyor.cmd cpanm"
set "cpan=%perl% -S cpan"
set TAR_OPTIONS=--warning=no-unknown-keyword
goto :eof

:cpanm
%perl% -S cpanm >NUL 2>&1
if ERRORLEVEL 1 (
curl -V >NUL 2>&1
if ERRORLEVEL 1 cinst -y curl
curl -k -L https://cpanmin.us/ -o "%TEMP%\cpanm"
%perl% "%TEMP%\cpanm" -n App::cpanminus
)
set "cpanm=%perl% -S cpanm"
%cpanm% %*
goto :eof

:local_lib
if "%perl_type%" == "cygwin" goto :local_lib_cygwin
%perl% -Ilib -Mlocal::lib=--shelltype=cmd %* > %TEMP%\local-lib.bat
call %TEMP%\local-lib.bat
del %TEMP%\local-lib.bat
goto :eof

:local_lib_cygwin
for /f "usebackq delims=" %%d in (`sh -c "cygpath -w $HOME/perl5"`) do (
c:\perl\bin\perl.exe -Ilib -Mlocal::lib - %%d --shelltype=cmd > "%TEMP%\local-lib.bat"
)
setlocal
call "%TEMP%\local-lib.bat"
endlocal & set "PATH=%PATH%"
set "PATH_BACK=%PATH%"
%perl% -Ilib -Mlocal::lib - --shelltype=cmd > "%TEMP%\local-lib.bat"
call "%TEMP%\local-lib.bat"
set "PATH=%PATH_BACK%"
del "%TEMP%\local-lib.bat"
goto :eof

:eof
37 changes: 37 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---

version: '{build}'
shallow_clone: true

matrix:
fast_finish: true

environment:
matrix:
- perl_type: strawberry
perl_version: 5.28.0.1
- perl_type: strawberry
perl_version: 5.26.1.1
- perl_type: strawberry
perl_version: 5.24.3.1
- perl_type: strawberry
perl_version: 5.22.3.1
- perl_type: strawberry
perl_version: 5.20.3.3
- perl_type: strawberry
perl_version: 5.18.4.1
- perl_type: strawberry
perl_version: 5.16.3.20170202
- perl_type: strawberry
perl_version: 5.14.4.1

install:
- 'call .appveyor.cmd perl_setup'
- '%perl% -V'
- '%cpanm% -n IO::Socket::SSL LWP::Protocol::https HTTP::Tiny'
- '%cpanm% --installdeps -n .'

build: off

test_script:
- '%cpanm% --test-only -v .'
48 changes: 48 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
addons:
apt:
packages:
- aspell
- aspell-en
language: perl
perl:
- "blead"
- "blead-thr"
- "5.28"
- "5.28-thr"
- "5.26"
- "5.26-thr"
- "5.24"
- "5.24-thr"
- "5.22"
- "5.22-thr"
- "5.20"
- "5.20-thr"
- "5.18"
- "5.18-thr"
- "5.16"
- "5.16-thr"
- "5.14"
- "5.14-thr"
- "5.12"
- "5.12-thr"
- "5.10"
- "5.10-thr"
- "5.8"
- "5.8-thr"
env:
- "HARNESS_OPTIONS=j9"
before_install:
- git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
- source ~/travis-perl-helpers/init --always-upgrade-modules
- build-perl
- perl -V
- build-dist
- cd $BUILD_DIR
install:
- cpan-install --deps
script:
- perl Makefile.PL
- prove -lrb t/ xt/
sudo: false
notifications:
email: false
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Revision history File::Slurp

9999.20_01 2018-09-27 (TRIAL)
- Fixed spelling mistakes in POD (RT #85251)
- Fixed a typo in an example (RTs #72116, #80279)
- Remove doc mentions of Perl < 5.006 as that's required.
Expand All @@ -18,6 +19,7 @@ Revision history File::Slurp
- Added more xt/author tests
- Fix all trailing whitespace in accordance with xt/author/eol.t
- Updated the Makefile.PL to get all of the prereqs in there.
- Add CI testing via TravisCI and AppVeyor

9999.19 Tue Jun 7 04:06:06 EDT 2011
- Fixed use line in t/edit_file.t to import :edit first
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.appveyor.cmd
.appveyor.yml
.mailmap
.travis.yml
Changes
lib/File/Slurp.pm
Makefile.PL
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ TODO
Makefile$
\.bak$
^extras/
pm_to_blib
19 changes: 18 additions & 1 deletion META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,21 @@ abstract: 'Simple and Efficient Reading/Writing/Modifying of Complete Files'
author:
- 'Uri Guttman <[email protected]>'
build_requires:
B: '0'
Carp: '0'
Exporter: '0'
ExtUtils::MakeMaker: '0'
File::Spec: '0'
File::Temp: '0'
IO::Handle: '0'
POSIX: '0'
Scalar::Util: '0'
Socket: '0'
Symbol: '0'
Test::More: '0'
overload: '0'
strict: '0'
warnings: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 1
Expand All @@ -18,10 +32,13 @@ no_index:
- t
- inc
requires:
B: '0'
Carp: '0'
Errno: '0'
Exporter: '0'
Fcntl: '0'
POSIX: '0'
perl: '5.004'
strict: '0'
warnings: '0'
version: '9999.20'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
7 changes: 4 additions & 3 deletions lib/File/Slurp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ package File::Slurp;
use strict;
use warnings ;

our $VERSION = '9999.20_01';
$VERSION = eval $VERSION;

use Carp ;
use Exporter ;
use Fcntl qw( :DEFAULT ) ;
use POSIX qw( :fcntl_h ) ;
use Errno ;
#use Symbol ;

use vars qw( @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION ) ;
use vars qw( @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS ) ;
@ISA = qw( Exporter ) ;

$VERSION = '9999.20';

my @std_export = qw(
read_file
write_file
Expand Down

0 comments on commit 9c171a4

Please sign in to comment.