diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2012-02-03 11:02:40 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-03 09:05:51 +0100 |
commit | 3cb0ae295fddb133d8c6ca09013116f099915a85 (patch) | |
tree | 377fcbf3828a79adea97d4348da74ca8f8efae83 /scripts/t | |
parent | 5a947503e70295d9ac1276c5877f275afe0a66bf (diff) |
Fixed all test failures on Windows.
testcocoon-related tests were updated for \ vs /
directory separators. testcocoon scripts were also updated
to use canonpath() where appropriate, so that the directory
separators are canonicalized.
License checker test was updated to avoid usage of symlink(),
which is not available on Windows.
The license checker itself was updated to avoid opening
directories. On Linux, opening directories for read via open()
is fine; on Windows, it results in "permission denied".
Change-Id: I0bd2dd9c8d1c07fbed0222ca223953dd378fd502
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Diffstat (limited to 'scripts/t')
-rw-r--r-- | scripts/t/90-licenses.t | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/scripts/t/90-licenses.t b/scripts/t/90-licenses.t index b939c247..ff490837 100644 --- a/scripts/t/90-licenses.t +++ b/scripts/t/90-licenses.t @@ -22,6 +22,7 @@ use Cwd qw(abs_path); use English qw(-no_match_vars); use File::Basename; use File::Copy; +use File::Copy::Recursive qw(dircopy); use File::Find; use File::Path; use File::Spec::Functions; @@ -44,14 +45,15 @@ Readonly my %RE => ( sub copy_testdata { my (%args) = @_; - my $tempdir = $args{ tempdir }; + my $destdir = $args{ destdir }; my $file = $args{ file }; return unless (-f $file); - my $dest = "$tempdir/$file"; + my $dest = "$destdir/$file"; - my $destdir = dirname( $dest ); + # $file might have had a dir portion too, so recalculate destdir + $destdir = dirname($dest); if (! -d $destdir) { mkpath( $destdir ); } @@ -75,8 +77,11 @@ sub main my $tempdir = File::Temp->newdir( basename($0)."-XXXXXX", TMPDIR => 1 ); diag "testing tst_licenses.pl under $tempdir"; - # link $tempdir/qtbase to the reference header directory (used to find header.*) - symlink( "$testdata/reference", "$tempdir/qtbase" ); + # The module's own directory is underneath $tempdir, and qtbase is a sibling + my $moduledir = catfile( $tempdir, 'module' ); + + # copy $tempdir/qtbase to the reference header directory (used to find header.*) + dircopy( "$testdata/reference", "$tempdir/qtbase" ) || die "copy header.*: $!"; chdir $testdata; @@ -87,14 +92,14 @@ sub main find({ no_chdir => 1, wanted => sub { - copy_testdata( tempdir => $tempdir, file => $File::Find::name ) + copy_testdata( destdir => $moduledir, file => $File::Find::name ) }, }, @test_dirs ); # Now run the test my $actual_output = capture_merged { - local $ENV{ QT_MODULE_TO_TEST } = $tempdir; + local $ENV{ QT_MODULE_TO_TEST } = $moduledir; system( $EXECUTABLE_NAME, $tst_licenses ); }; # Remove all comments and test numbers before diff |