FriendsOfPHP / pickle

PHP Extension installer
Other
1.65k stars 89 forks source link

test failing on windows #19

Closed pierrejoye closed 10 years ago

pierrejoye commented 10 years ago
> PHP path: c:\temp\php559tsx86\php.exe
> PHP version:
=> PHP 5.5.9 (cli) (built: Feb  5 2014 13:02:39) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
> Pickle\tests\units\Package...
[....________________________________________________________][0/4]
[S...________________________________________________________][1/4]
[SS..________________________________________________________][2/4]
[SSS.________________________________________________________][3/4]
[SSSS________________________________________________________][4/4]
=> Test duration: 0.02 second.
=> Memory usage: 2.00 Mb.
> Pickle\tests\units\Package\JSON\Parser...
[..__________________________________________________________][0/2]
[S.__________________________________________________________][1/2]
[SF__________________________________________________________][2/2]
=> Test duration: 0.01 second.
=> Memory usage: 0.25 Mb.
> Pickle\tests\units\Package\XML\Converter...
[......______________________________________________________][0/6]
[F.....______________________________________________________][1/6]
[FF....______________________________________________________][2/6]
[FFF...______________________________________________________][3/6]
[FFFF..______________________________________________________][4/6]
[FFFFF.______________________________________________________][5/6]
[FFFFFF______________________________________________________][6/6]
=> Test duration: 0.00 second.
=> Memory usage: 0.00 Mb.
> Pickle\tests\units\Package\XML\Parser...
[..__________________________________________________________][0/2]
[S.__________________________________________________________][1/2]
[SF__________________________________________________________][2/2]
=> Test duration: 0.01 second.
=> Memory usage: 0.50 Mb.
> Total tests duration: 0.04 second.
> Total tests memory usage: 2.75 Mb.
> Running duration: 1.06 seconds.
Failure (4 tests, 14/14 methods, 0 void method, 0 skipped method, 0 uncompleted method, 8 failures, 0 error, 0 exception)!
> There are 8 failures:
=> Pickle\tests\units\Package\JSON\Parser::testJsonDecodeError():
In file C:\php-sdk\repo\pickle\tests\units\Package\JSON\Parser.php on line 45, mageekguy\atoum\asserters\exception() failed: message 'Failed to read C:\php-sdk\repo\pickle\tests\fixtures\package\pickle.json' is not identical to 'Failed to read C:\php-sdk\repo\pickle/tests/fixtures/package/pickle.json'
=> Pickle\tests\units\Package\XML\Converter::testMaintainers():
In file C:\php-sdk\repo\pickle\tests\units\Package\XML\Converter.php on line 41, mageekguy\atoum\asserters\phpFunction() failed: Pickle\Package\XML\file_put_contents(string(53) "C:\php-sdk\repo\pickle/tests/fixtures/package\CREDITS", string(93) "Rasmus Lerdorf (rasmus) (rasmus@php.net) (yes)
Pierre Joye (pierre) (pierre@php.net) (yes)
") is called 0 time instead of 1
[1] Pickle\Package\XML\file_put_contents(string(53) "C:\php-sdk\repo\pickle/tests/fixtures/package/CREDITS", string(91) "Rasmus Lerdorf (rasmus) (rasmus@php.net) (yes)
Pierre Joye (pierre) (pierre@php.net) (yes)
", NULL, NULL)
=> Pickle\tests\units\Package\XML\Converter::testSummary():
In file C:\php-sdk\repo\pickle\tests\units\Package\XML\Converter.php on line 60, mageekguy\atoum\asserters\phpFunction() failed: Pickle\Package\XML\file_put_contents(string(52) "C:\php-sdk\repo\pickle/tests/fixtures/package\README", string(30) "53a46323483d4

53a4632348409") is called 0 time instead of 1
[1] Pickle\Package\XML\file_put_contents(string(52) "C:\php-sdk\repo\pickle/tests/fixtures/package/README", string(28) "53a46323483d4

53a4632348409", NULL, NULL)
=> Pickle\tests\units\Package\XML\Converter::testRelease():
In file C:\php-sdk\repo\pickle\tests\units\Package\XML\Converter.php on line 96, mageekguy\atoum\asserters\phpFunction() failed: Pickle\Package\XML\file_put_contents(string(60) "C:\php-sdk\repo\pickle/tests/fixtures/package\RELEASE-3.1.15", string(159) "Date:             2014-06-14
Package version:  3.1.15
Package state:    beta
API Version:      3.1.0
API state:        stable

Changelog:
This is a note") is called 0 time instead of 1
[1] Pickle\Package\XML\file_put_contents(string(60) "C:\php-sdk\repo\pickle/tests/fixtures/package/RELEASE-3.1.15", string(159) "Date:             2014-06-14
Package version:  3.1.15
Package state:    beta
API Version:      3.1.0
API state:        stable

Changelog:
This is a note", NULL, NULL)
=> Pickle\tests\units\Package\XML\Converter::testChangelog():
In file C:\php-sdk\repo\pickle\tests\units\Package\XML\Converter.php on line 144, mageekguy\atoum\asserters\phpFunction() failed: Pickle\Package\XML\file_put_contents(string(60) "C:\php-sdk\repo\pickle/tests/fixtures/package\RELEASE-3.1.14", string(159) "Date:             2013-01-02
Package version:  3.1.14
Package state:    beta
API Version:      3.1.0
API state:        stable

Changelog:
This is a note") is called 0 time instead of 1
[1] Pickle\Package\XML\file_put_contents(string(60) "C:\php-sdk\repo\pickle/tests/fixtures/package/RELEASE-3.1.14", string(159) "Date:             2013-01-02
Package version:  3.1.14
Package state:    beta
API Version:      3.1.0
API state:        stable

Changelog:
This is a note", NULL, NULL)
[2] Pickle\Package\XML\file_put_contents(string(59) "C:\php-sdk\repo\pickle/tests/fixtures/package/RELEASE-2.0.0", string(165) "Date:             2003-07-01
Package version:  2.0.0
Package state:    stable
API Version:      2.0.0
API state:        stable

Changelog:
This is an old note", NULL, NULL)
=> Pickle\tests\units\Package\XML\Converter::testLicense():
In file C:\php-sdk\repo\pickle\tests\units\Package\XML\Converter.php on line 174, mageekguy\atoum\asserters\phpFunction() failed: Pickle\Package\XML\file_put_contents(string(53) "C:\php-sdk\repo\pickle/tests/fixtures/package\LICENSE", string(60) "This package is under the following license(s):
PHP License") is called 0 time instead of 1
[1] Pickle\Package\XML\file_put_contents(string(53) "C:\php-sdk\repo\pickle/tests/fixtures/package/LICENSE", string(59) "This package is under the following license(s):
PHP License", NULL, NULL)
=> Pickle\tests\units\Package\XML\Converter::testGenerateJson():
In file C:\php-sdk\repo\pickle\tests\units\Package\XML\Converter.php on line 204, mageekguy\atoum\asserters\phpFunction() failed: Pickle\Package\XML\file_put_contents(string(57) "C:\php-sdk\repo\pickle/tests/fixtures/package\pickle.json", string(120) "{
    "name": "53a463239105d",
    "type": "extension",
    "extra": {
        "configure-options": [

        ]
    }
}") is called 0 time instead of 1
[1] Pickle\Package\XML\file_put_contents(string(57) "C:\php-sdk\repo\pickle/tests/fixtures/package/pickle.json", string(120) "{
    "name": "53a463239105d",
    "type": "extension",
    "extra": {
        "configure-options": [

        ]
    }
}", NULL, NULL)
=> Pickle\tests\units\Package\XML\Parser::testParseXmlError():
In file C:\php-sdk\repo\pickle\tests\units\Package\XML\Parser.php on line 65, mageekguy\atoum\asserters\exception() failed: message 'Failed to read C:\php-sdk\repo\pickle\tests\fixtures\package\package.xml' is not identical to 'Failed to read C:\php-sdk\repo\pickle/tests/fixtures/package/package.xml'
jubianchi commented 10 years ago

@pierrejoye I tried to fix tests but I don't know if I missed something...

The problem comes from the value of DIRECTORY_SEPARATOR and the fact that it was used in tests and not in code.

harikt commented 10 years ago

I think it would have been good to edit the src to have the DIRECTORY_SEPARATOR than removing from tests.

pierrejoye commented 10 years ago

Using / or \ just works. I do not think we need to change the source code but adapt the tests accordingly.

In phpt, we simply use %ssomfile.php for example.

jubianchi commented 10 years ago

I wrote the test and the code on different branches and when merging everything, I did not take care of DIRECTORY_SEPARATOR. I also don't think we should edit the source code but rather make the tests handle everything correctly.

Tests should now be OK ;)

pierrejoye commented 10 years ago

Thanks!

C:\php-sdk\repo\pickle>vendor\bin\atoum

PHP path: c:\temp\php559tsx86\php.exe PHP version: => PHP 5.5.9 (cli) (built: Feb 5 2014 13:02:39) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies Pickle\tests\units\Package... [....____][0/4] [S...____][1/4] [SS..____][2/4] [SSS.____][3/4] [SSSS____][4/4] => Test duration: 0.04 second. => Memory usage: 2.00 Mb. Pickle\tests\units\Package\JSON\Parser... [..__][0/2] [S.__][1/2] [SS__][2/2] => Test duration: 0.30 second. => Memory usage: 0.50 Mb. Pickle\tests\units\Package\XML\Converter... [......__][0/6] [S.....__][1/6] [SS....__][2/6] [SSS...__][3/6] [SSSS..__][4/6] [SSSSS.__][5/6] [SSSSSS__][6/6] => Test duration: 0.06 second. => Memory usage: 3.00 Mb. Pickle\tests\units\Package\XML\Parser... [..__][0/2] [S.__][1/2] [SS__][2/2] => Test duration: 0.02 second. => Memory usage: 0.75 Mb. Total tests duration: 0.41 second. Total tests memory usage: 6.25 Mb. Running duration: 1.44 seconds. Success (4 tests, 14/14 methods, 0 void method, 0 skipped method, 58 assertions)!

harikt commented 10 years ago

:+1: good for green.