diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-03-16 09:04:18 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-03-16 09:04:18 +0100 |
commit | 992f17cb8eb3ac3d7448212ee83db1a03dd51bed (patch) | |
tree | 3e7dc4b73fe309b51df0a588ad69adaf12ee5351 /php/test | |
parent | ICE-7014 - Python docstring fixes (diff) | |
download | ice-992f17cb8eb3ac3d7448212ee83db1a03dd51bed.tar.bz2 ice-992f17cb8eb3ac3d7448212ee83db1a03dd51bed.tar.xz ice-992f17cb8eb3ac3d7448212ee83db1a03dd51bed.zip |
Fix for ICE-7020 - php tests will now exit with exit status = 1 if there's a test failure
Diffstat (limited to 'php/test')
-rw-r--r-- | php/test/Ice/acm/Client.php | 3 | ||||
-rw-r--r-- | php/test/Ice/binding/Client.php | 9 | ||||
-rw-r--r-- | php/test/Ice/checksum/Client.php | 3 | ||||
-rw-r--r-- | php/test/Ice/defaultValue/Client.php | 3 | ||||
-rw-r--r-- | php/test/Ice/enums/Client.php | 3 | ||||
-rw-r--r-- | php/test/Ice/exceptions/Client.php | 3 | ||||
-rw-r--r-- | php/test/Ice/facets/Client.php | 3 | ||||
-rw-r--r-- | php/test/Ice/info/Client.php | 3 | ||||
-rw-r--r-- | php/test/Ice/inheritance/Client.php | 3 | ||||
-rw-r--r-- | php/test/Ice/ini/Client.php | 3 | ||||
-rw-r--r-- | php/test/Ice/ini/ClientWithProfile.php | 3 | ||||
-rw-r--r-- | php/test/Ice/objects/Client.php | 7 | ||||
-rw-r--r-- | php/test/Ice/operations/Client.php | 33 | ||||
-rw-r--r-- | php/test/Ice/optional/Client.php | 9 | ||||
-rw-r--r-- | php/test/Ice/proxy/Client.php | 9 | ||||
-rw-r--r-- | php/test/Ice/slicing/exceptions/Client.php | 3 | ||||
-rw-r--r-- | php/test/Ice/slicing/objects/Client.php | 3 | ||||
-rw-r--r-- | php/test/Slice/keyword/Client.php | 3 | ||||
-rw-r--r-- | php/test/Slice/macros/Client.php | 3 | ||||
-rw-r--r-- | php/test/Slice/structure/Client.php | 3 |
20 files changed, 66 insertions, 46 deletions
diff --git a/php/test/Ice/acm/Client.php b/php/test/Ice/acm/Client.php index b559a9d7d1d..6a0a63dfa52 100644 --- a/php/test/Ice/acm/Client.php +++ b/php/test/Ice/acm/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/binding/Client.php b/php/test/Ice/binding/Client.php index 13bd6cc6677..3b3c376f033 100644 --- a/php/test/Ice/binding/Client.php +++ b/php/test/Ice/binding/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } @@ -187,7 +188,7 @@ function allTests($communicator) // $com->deactivateObjectAdapter($adapters[2]); $test = createTestIntfPrx($adapters); - test($test->getAdapterName() == "Adapter12"); + test($test->getAdapterName() == "Adapter12"); deactivate($com, $adapters); } @@ -280,7 +281,7 @@ function allTests($communicator) // // Now, re-activate the adapters with the same endpoints in the opposite // order. - // + // $adapters[] = $com->createObjectAdapter("Adapter36", $endpoints[2]->toString()); for($i = 0; $i < $nRetry && $test->getAdapterName() == "Adapter36"; $i++); test($i == $nRetry); @@ -419,7 +420,7 @@ function allTests($communicator) // // Now, re-activate the adapters with the same endpoints in the opposite // order. - // + // $adapters[] = $com->createObjectAdapter("Adapter66", $endpoints[2]->toString()); for($i = 0; $i < $nRetry && $test->getAdapterName() == "Adapter66"; $i++); test($i == $nRetry); diff --git a/php/test/Ice/checksum/Client.php b/php/test/Ice/checksum/Client.php index a84685f44ca..a14cbe4da01 100644 --- a/php/test/Ice/checksum/Client.php +++ b/php/test/Ice/checksum/Client.php @@ -26,7 +26,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/defaultValue/Client.php b/php/test/Ice/defaultValue/Client.php index caf06d93d70..29fa33a2c6c 100644 --- a/php/test/Ice/defaultValue/Client.php +++ b/php/test/Ice/defaultValue/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/enums/Client.php b/php/test/Ice/enums/Client.php index c61c9c04c48..4ce07324735 100644 --- a/php/test/Ice/enums/Client.php +++ b/php/test/Ice/enums/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/exceptions/Client.php b/php/test/Ice/exceptions/Client.php index 0d9feaf9da9..cfc27d988ad 100644 --- a/php/test/Ice/exceptions/Client.php +++ b/php/test/Ice/exceptions/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/facets/Client.php b/php/test/Ice/facets/Client.php index 32dc94e573e..d4a8d306ee5 100644 --- a/php/test/Ice/facets/Client.php +++ b/php/test/Ice/facets/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/info/Client.php b/php/test/Ice/info/Client.php index 3378395ee9d..64632cbd616 100644 --- a/php/test/Ice/info/Client.php +++ b/php/test/Ice/info/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/inheritance/Client.php b/php/test/Ice/inheritance/Client.php index 33c82f8bb6b..50a544c2752 100644 --- a/php/test/Ice/inheritance/Client.php +++ b/php/test/Ice/inheritance/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/ini/Client.php b/php/test/Ice/ini/Client.php index 47eade542b2..1594ae0a188 100644 --- a/php/test/Ice/ini/Client.php +++ b/php/test/Ice/ini/Client.php @@ -21,7 +21,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/ini/ClientWithProfile.php b/php/test/Ice/ini/ClientWithProfile.php index f7f3a4f21ee..ba4909e639e 100644 --- a/php/test/Ice/ini/ClientWithProfile.php +++ b/php/test/Ice/ini/ClientWithProfile.php @@ -21,7 +21,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/objects/Client.php b/php/test/Ice/objects/Client.php index 1201d0650d1..d6e33ee42f7 100644 --- a/php/test/Ice/objects/Client.php +++ b/php/test/Ice/objects/Client.php @@ -171,7 +171,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } @@ -346,7 +347,7 @@ function allTests($communicator) $h = $initial->getH(); test($h != null and $h instanceof Test_H); echo "ok\n"; - + echo "getting D1... "; flush(); $d1 = $initial->getD1(new Test_D1(new Test_A1("a1"), new Test_A1("a2"), new Test_A1("a3"), new Test_A1("a4"))); @@ -355,7 +356,7 @@ function allTests($communicator) test($d1->a3->name == "a3"); test($d1->a4->name == "a4"); echo "ok\n"; - + echo "throw EDerived... "; flush(); try diff --git a/php/test/Ice/operations/Client.php b/php/test/Ice/operations/Client.php index da449507589..b5426df1ef8 100644 --- a/php/test/Ice/operations/Client.php +++ b/php/test/Ice/operations/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } @@ -41,8 +42,8 @@ function twoways($communicator, $p) $myDerivedClass = $NS ? "Test\\MyDerivedClass" : "Test_MyDerivedClass"; $myClass = $NS ? "Test\\MyClass" : "Test_MyClass"; $objectPrxHelper = $NS ? "Ice\\ObjectPrxHelper" : "Ice_ObjectPrxHelper"; - - + + $s0 = $NS ? constant("Test\\s0") : constant("Test_s0"); $s1 = $NS ? constant("Test\\s1") : constant("Test_s1"); $s2 = $NS ? constant("Test\\s2") : constant("Test_s2"); @@ -54,7 +55,7 @@ function twoways($communicator, $p) $s8 = $NS ? constant("Test\\s8") : constant("Test_s8"); $s9 = $NS ? constant("Test\\s9") : constant("Test_s9"); $s10 = $NS ? constant("Test\\s10") : constant("Test_s10"); - + $sw0 = $NS ? constant("Test\\sw0") : constant("Test_sw0"); $sw1 = $NS ? constant("Test\\sw1") : constant("Test_sw1"); $sw2 = $NS ? constant("Test\\sw2") : constant("Test_sw2"); @@ -81,7 +82,7 @@ function twoways($communicator, $p) { $literals = $p->opStringLiterals(); - test($s0 == "\\" && + test($s0 == "\\" && $s0 == $sw0 && $s0 == $literals[0] && $s0 == $literals[11]); @@ -95,8 +96,8 @@ function twoways($communicator, $p) $s2 == $sw2 && $s2 == $literals[2] && $s2 == $literals[13]); - - test($s3 == "A21" && + + test($s3 == "A21" && $s3 == $sw3 && $s3 == $literals[3] && $s3 == $literals[14]); @@ -110,22 +111,22 @@ function twoways($communicator, $p) $s5 == $sw5 && $s5 == $literals[5] && $s5 == $literals[16]); - + test($s6 == "\xcf\xbf" && $s6 == $sw6 && $s6 == $literals[6] && $s6 == $literals[17]); - + test($s7 == "\xd7\xb0" && $s7 == $sw7 && $s7 == $literals[7] && $s7 == $literals[18]); - + test($s8 == "\xf0\x90\x80\x80" && $s8 == $sw8 && $s8 == $literals[8] && $s8 == $literals[19]); - + test($s9 == "\xf0\x9f\x8d\x8c" && $s9 == $sw9 && $s9 == $literals[9] && @@ -135,23 +136,23 @@ function twoways($communicator, $p) $s10 == $sw10 && $s10 == $literals[10] && $s10 == $literals[21]); - + test($ss0 == "'\"?\\\007\010\f\n\r\t\v" && $ss0 == $ss1 && $ss1 == $ss2 && $ss0 == $literals[22] && $ss0 == $literals[23] && $ss0 == $literals[24]); - + test($ss3 == "\\\\U\\u\\" && $ss3 == $literals[25]); - + test($ss4 == "\\A\\" && $ss4 == $literals[26]); - + test($ss5 == "\\u0041\\" && $ss5 == $literals[27]); - + test($su0 == $su1 && $su0 == $su2 && $su0 == $literals[28] && diff --git a/php/test/Ice/optional/Client.php b/php/test/Ice/optional/Client.php index 636e25c6240..85afef6f086 100644 --- a/php/test/Ice/optional/Client.php +++ b/php/test/Ice/optional/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } @@ -337,12 +338,12 @@ function allTests($communicator) test($oo != Ice_Unset); $initial->ice_encodingVersion($Ice_Encoding_1_0)->returnOptionalClass(true, $oo); test($oo == Ice_Unset); - - + + $gcls = $NS ? "Test\\G" : "Test_G"; $g1cls = $NS ? "Test\\G1" : "Test_G1"; $g2cls = $NS ? "Test\\G2" : "Test_G2"; - + $g = new $gcls; $g->gg1Opt = new $g1cls("gg1Opt"); $g->gg2 = new $g2cls(10); diff --git a/php/test/Ice/proxy/Client.php b/php/test/Ice/proxy/Client.php index 441078b1127..a80838fb44f 100644 --- a/php/test/Ice/proxy/Client.php +++ b/php/test/Ice/proxy/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } @@ -38,7 +39,7 @@ function allTests($communicator) $random = $NS ? constant("Ice\\EndpointSelectionType::Random") : constant("Ice_EndpointSelectionType::Random"); $ordered = $NS ? constant("Ice\\EndpointSelectionType::Ordered") : constant("Ice_EndpointSelectionType::Ordered"); $encodingVersion = $NS ? "Ice\\EncodingVersion" : "Ice_EncodingVersion"; - + $identityToString = $NS ? "Ice\\identityToString" : "Ice_identityToString"; $stringToIdentity = $NS ? "Ice\\stringToIdentity" : "Ice_stringToIdentity"; @@ -490,7 +491,7 @@ function allTests($communicator) { $cl20->ice_ping(); test(false); - } + } catch(Exception $ex) { // Server 2.0 endpoint doesn't support 1.1 version. @@ -685,7 +686,7 @@ function allTests($communicator) $p1 = $communicator->stringToProxy("test -e 1.1:opaque -t 1 -e 1.0 -v CTEyNy4wLjAuMeouAAAQJwAAAA=="); $pstr = $communicator->proxyToString($p1); test($pstr == "test -t -e 1.1:tcp -h 127.0.0.1 -p 12010 -t 10000"); - + // Opaque endpoint encoded with 1.1 encoding. $p2 = $communicator->stringToProxy("test -e 1.1:opaque -e 1.1 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAA=="); test($communicator->proxyToString($p2) == "test -t -e 1.1:tcp -h 127.0.0.1 -p 12010 -t 10000"); diff --git a/php/test/Ice/slicing/exceptions/Client.php b/php/test/Ice/slicing/exceptions/Client.php index fc818c09d99..db410f4366a 100644 --- a/php/test/Ice/slicing/exceptions/Client.php +++ b/php/test/Ice/slicing/exceptions/Client.php @@ -16,7 +16,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Ice/slicing/objects/Client.php b/php/test/Ice/slicing/objects/Client.php index 1e2a8913e79..13f7ea4bbd1 100644 --- a/php/test/Ice/slicing/objects/Client.php +++ b/php/test/Ice/slicing/objects/Client.php @@ -17,7 +17,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Slice/keyword/Client.php b/php/test/Slice/keyword/Client.php index 54075d97017..84da5378948 100644 --- a/php/test/Slice/keyword/Client.php +++ b/php/test/Slice/keyword/Client.php @@ -34,7 +34,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Slice/macros/Client.php b/php/test/Slice/macros/Client.php index b38126cb198..a8e16923446 100644 --- a/php/test/Slice/macros/Client.php +++ b/php/test/Slice/macros/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } diff --git a/php/test/Slice/structure/Client.php b/php/test/Slice/structure/Client.php index 1efe1b19817..03cb6476c8b 100644 --- a/php/test/Slice/structure/Client.php +++ b/php/test/Slice/structure/Client.php @@ -25,7 +25,8 @@ function test($b) if(!$b) { $bt = debug_backtrace(); - die("\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"); + echo "\ntest failed in ".$bt[0]["file"]." line ".$bt[0]["line"]."\n"; + exit(1); } } |