Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Windows test fixes #45

Closed
wants to merge 3 commits into from

2 participants

@rwstauner

Some fixes for #44

I don't know if you want these, but they did the trick for me
and you'd know much better than I if they are appropriate.

rwstauner added some commits
@rwstauner rwstauner Ignore errors setting locale in datetime tests
Stops the test from bailing out on Strawberry 5.14.2/win-xp (gh-44).
8d655e0
@rwstauner rwstauner Expect '.exe' in configuration test files on windows 17a06ec
@rwstauner rwstauner Don't re-copy file if mtimes are equal
Win32::CopyFile() copies all file attributes (including times)
so they are equal (rather than one being older).
a282090
@theory
Owner

Cherry-picked the second two fixes, but applied 5bab539 to fix the first issue more correctly. Thanks!

@theory theory closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 2, 2012
  1. @rwstauner

    Ignore errors setting locale in datetime tests

    rwstauner authored
    Stops the test from bailing out on Strawberry 5.14.2/win-xp (gh-44).
  2. @rwstauner
  3. @rwstauner

    Don't re-copy file if mtimes are equal

    rwstauner authored
    Win32::CopyFile() copies all file attributes (including times)
    so they are equal (rather than one being older).
This page is out of date. Refresh to see the latest.
View
2  lib/App/Sqitch/Command/bundle.pm
@@ -136,7 +136,7 @@ sub _copy_if_modified {
if (-e $dst) {
# Skip the file if it is up-to-date.
- return $self if -M $dst < -M $src;
+ return $self if -M $dst <= -M $src;
} else {
# Create the directory.
$self->_mkpath( $dst->dir );
View
5 t/bundle.t
@@ -165,8 +165,9 @@ is_deeply +MockOutput->get_debug, [
], 'The mkdir and copy info should have been output';
# Copy it again.
-diag "Src: ", -M $file;
-diag "Dst: ", -M $dest;
+diag "Src: ", -M $file, ' ' . (stat($file))[9];
+diag "Dst: ", -M $dest, ' ' . (stat($dest))[9];
+diag "Src == Dst: ", (-M $file) == (-M $dest);
ok $bundle->_copy_if_modified($file, $dest), "Copy $file to $dest again";
file_exists_ok $dest, "File $dest should still exist";
file_contents_identical $dest, $file;
View
3  t/datetime.t
@@ -43,7 +43,10 @@ my $iso = do {
my $ldt = do {
my $clone = $dt->clone;
$clone->set_time_zone('local');
+ # sometimes Windows returns things DateTime doesn't like ("English_United States.1252")
+ eval {
$clone->set(locale => POSIX::setlocale(POSIX::LC_TIME()) );
+ } or diag $@;
$clone;
};
View
6 t/init.t
@@ -19,6 +19,8 @@ use URI;
use lib 't/lib';
use MockOutput;
+my $exe_ext = $^O eq 'MSWin32' ? '.exe' : '';
+
my $CLASS;
BEGIN {
@@ -309,7 +311,7 @@ is_deeply read_config $conf_file, {
file_contents_like $conf_file, qr{^\Q# [core "sqlite"]
# sqitch_prefix = sqitch
# db_name =
- # client = sqlite3
+ # client = sqlite3$exe_ext
}m, 'Engine section should be present but commented-out';
# Now build it with other config.
@@ -389,7 +391,7 @@ is_deeply read_config $conf_file, {
file_contents_like $conf_file, qr{^\Q# [core "pg"]
# db_name =
- # client = psql
+ # client = psql$exe_ext
# sqitch_schema = sqitch
# password =
# port =
Something went wrong with that request. Please try again.