105
105
if (file_exists ('UUID.php ' ) && PHP_VERSION >= '5.0.0 ' ) {
106
106
@include_once ("php-uuid.inc " );
107
107
}
108
- if (file_exists ('kvstorage-mem.inc ' ) && PHP_VERSION >= '5.0.0 ' ) {
108
+ if ( PHP_VERSION >= '5.0.0 ' ) {
109
+
110
+ if (file_exists ('kvstorage-mem.inc ' )) {
109
111
@include_once ("kv-memory.inc " );
110
112
}
113
+ if (file_exists ('kvstorage-xcache.inc ' ) && extension_loaded ('xCache ' )) {
114
+ @include_once ("kv-xcache.inc " );
115
+ }
116
+ }// php>=5.0
117
+
111
118
if (extension_loaded ('uuid ' )) {
112
119
@include_once ("mod-uuid.inc " );
113
120
}
@@ -778,6 +785,7 @@ function gethostname() {
778
785
'38_01_php_uuid ' => 1000000 ,
779
786
'38_02_mod_uuid ' => 1000000 ,
780
787
'39_01_kvstorage_memory ' => 1000000 ,
788
+ '39_02_kvstorage_xcache ' => 1000000 ,
781
789
);
782
790
// Should not be more than X Mb
783
791
// Different PHP could use different amount of memory
@@ -837,6 +845,7 @@ function gethostname() {
837
845
'38_01_php_uuid ' => 4 ,
838
846
'38_02_mod_uuid ' => 4 ,
839
847
'39_01_kvstorage_memory ' => 4 ,
848
+ '39_02_kvstorage_xcache ' => 4 ,
840
849
);
841
850
842
851
/** ---------------------------------- Common functions -------------------------------------------- */
@@ -1522,18 +1531,18 @@ function format_result_test($diffSeconds, $opCount, $memory = 0)
1522
1531
// fiter in tests
1523
1532
function filter_in_name_by_pattern ($ key )
1524
1533
{
1525
- global $ runTests , $ debugMode , $ availableFunctions ;
1534
+ global $ selectedTests , $ debugMode , $ availableFunctions ;
1526
1535
$ var = $ availableFunctions [$ key ];
1527
1536
$ ret = 0 ;
1528
- foreach ($ runTests as $ pattern ){
1537
+ foreach ($ selectedTests as $ pattern ){
1529
1538
// simple test - str in name
1530
1539
$ c =strpos ($ var ,$ pattern );
1531
1540
if ($ debugMode ) {
1532
1541
$ d =var_export ($ c ,true );
1533
1542
print ("Search ' $ pattern' inside ' $ var': $ d \n" );
1534
1543
}
1535
1544
if ($ c !==false ) {
1536
- $ ret = 0 ;
1545
+ $ ret = 1 ;
1537
1546
break ;
1538
1547
};
1539
1548
}
@@ -1565,7 +1574,7 @@ function filter_out_name_by_pattern($key)
1565
1574
if (!$ ret ) unset($ availableFunctions [$ key ]);
1566
1575
return $ ret ;
1567
1576
}
1568
- if ($ runTests ) array_filter ($ availableFunctions , "filter_in_name_by_pattern " ,ARRAY_FILTER_USE_KEY );
1577
+ if ($ selectedTests ) array_filter ($ availableFunctions , "filter_in_name_by_pattern " ,ARRAY_FILTER_USE_KEY );
1569
1578
if ($ skipTests ) array_filter ($ availableFunctions , "filter_out_name_by_pattern " ,ARRAY_FILTER_USE_KEY );
1570
1579
/** ------------------------------- Early checks ------------------------------- */
1571
1580
@@ -1617,7 +1626,7 @@ function filter_out_name_by_pattern($key)
1617
1626
$ has_json = "{$ colorRed }no {$ colorReset }" ;
1618
1627
if ($ printJson ) {
1619
1628
print_pre ("{$ colorRed }<<< ERROR >>> {$ colorReset } Extension 'json' is mandatory for JSON output! " );
1620
- print ("\"messages_count \": {$ messagesCnt }, \n" );
1629
+ print ("\"messag0es_count \": {$ messagesCnt }, \n" );
1621
1630
print ("\"end \":true \n} " . PHP_EOL );
1622
1631
exit (-1 );
1623
1632
}
@@ -1631,7 +1640,7 @@ function filter_out_name_by_pattern($key)
1631
1640
if (extension_loaded ('Zend OPcache ' )) {
1632
1641
$ has_opcache = "{$ colorYellow }yes {$ colorReset }" ;
1633
1642
}
1634
- $ has_xcache = "{$ colorGreen }no {$ colorReset }" ;
1643
+ $ has_xcache = "{$ colorYellow }no {$ colorReset }" ;
1635
1644
if (extension_loaded ('XCache ' )) {
1636
1645
$ has_xcache = "{$ colorYellow }yes {$ colorReset }" ;
1637
1646
}
@@ -1814,11 +1823,11 @@ function print_results_common()
1814
1823
foreach ($ availableFunctions as $ user ) {
1815
1824
if (strpos ($ user , 'test_ ' ) === 0 ) {
1816
1825
$ testName = str_replace ('test_ ' , '' , $ user );
1817
- if ($ runOnlySelectedTests ) {
1826
+ /* if ($runOnlySelectedTests) {
1818
1827
if (!in_array($testName, $selectedTests)) {
1819
1828
continue;
1820
1829
}
1821
- }
1830
+ }*/
1822
1831
echo str_pad ($ testName , $ padLabel ) . " : " ;
1823
1832
list ($ resultSec , $ resultSecFmt , $ resultOps , $ resultOpMhz , $ memory ) = $ user ();
1824
1833
$ total += $ resultSec ;
0 commit comments