schwalbenmann
02-08-2009, 07:06 AM
Hi.
I have some problem with PTS.
$ phoronix-test-suite list-suites
====================================
Phoronix Test Suite - Suites
====================================
Warning: array_merge(): Argument #2 is not an array in /usr/share/phoronix-test-suite/pts-core/functions/pts-functions_tests.php on line 660
Warning: array_unique(): The argument should be an array in /usr/share/phoronix-test-suite/pts-core/functions/pts-functions_tests.php on line 660
Warning: asort() expects parameter 1 to be array, boolean given in /usr/share/phoronix-test-suite/pts-core/functions/pts-functions_tests.php on line 661
The error is because the glob() funtion return FALSE if no files were found. This FALSE is handled like an normal array with array_merge. But FALSE can not be merged with an other array. This issue exists at some positions. Here an example:
656 function pts_available_suites_array()
657 {
658 $suites = glob(XML_SUITE_DIR . "*.xml");
659 $local_suites = glob(XML_SUITE_LOCAL_DIR . "*.xml");
660 $suites = array_unique(array_merge($suites, $local_suites));
661 asort($suites);
662
663 for($i = 0; $i < count($suites); $i++)
664 {
665 $suites[$i] = basename($suites[$i], ".xml");
666 }
667
668 return $suites;
669 }
Thanks, Andreas
I have some problem with PTS.
$ phoronix-test-suite list-suites
====================================
Phoronix Test Suite - Suites
====================================
Warning: array_merge(): Argument #2 is not an array in /usr/share/phoronix-test-suite/pts-core/functions/pts-functions_tests.php on line 660
Warning: array_unique(): The argument should be an array in /usr/share/phoronix-test-suite/pts-core/functions/pts-functions_tests.php on line 660
Warning: asort() expects parameter 1 to be array, boolean given in /usr/share/phoronix-test-suite/pts-core/functions/pts-functions_tests.php on line 661
The error is because the glob() funtion return FALSE if no files were found. This FALSE is handled like an normal array with array_merge. But FALSE can not be merged with an other array. This issue exists at some positions. Here an example:
656 function pts_available_suites_array()
657 {
658 $suites = glob(XML_SUITE_DIR . "*.xml");
659 $local_suites = glob(XML_SUITE_LOCAL_DIR . "*.xml");
660 $suites = array_unique(array_merge($suites, $local_suites));
661 asort($suites);
662
663 for($i = 0; $i < count($suites); $i++)
664 {
665 $suites[$i] = basename($suites[$i], ".xml");
666 }
667
668 return $suites;
669 }
Thanks, Andreas