Filter out is_python_* in PHP tests

These functions are added in a number of testcases but for all
languages not just Python.  It's tedious having to update the
PHP expected function lists for them, so let's just filter them
out.
This commit is contained in:
Olly Betts 2022-03-01 11:48:05 +13:00
commit 735fe4b60a
6 changed files with 9 additions and 8 deletions

View file

@ -2,8 +2,8 @@
require "tests.php";
// New functions
check::functions(array('is_python_builtin'));
// No new functions
check::functions(array());
// New classes
check::classes(array('StaticMemberTest','StaticFunctionTest','cpp_static','StaticBase','StaticDerived'));
// No new vars

View file

@ -3,7 +3,7 @@
require "tests.php";
// New functions
check::functions(array('launder','is_python_builtin'));
check::functions(array('launder'));
// New classes
check::classes(array('director_exception','Foo','Exception1','Exception2','Base','Bar','ReturnAllTypes'));
// No new vars

View file

@ -1,7 +1,7 @@
<?php
require "tests.php";
check::functions(array('is_python_builtin'));
check::functions(array());
check::classes(array('A','E1','E2','E3','exception_order','ET_i','ET_d'));
check::globals(array('efoovar','foovar','cfoovar'));

View file

@ -2,7 +2,8 @@
require "tests.php";
check::functions(array('is_python_builtin'));
// No new functions
check::functions(array());
check::classes(array('import_nomodule'));
// No new globals
check::globals(array());

View file

@ -109,7 +109,7 @@ class check {
else unset($extra[$func]);
}
$extra = array_filter(array_keys($extra),
function ($e) { return !preg_match('/_[gs]et$/', $e); });
function ($e) { return !preg_match('/_[gs]et$|^is_python_/', $e); });
if ($missing) $message[]=sprintf("Functions missing: %s",join(",",$missing));
if ($message) return check::fail(join("\n ",$message));
if ($extra) $message[]=sprintf("These extra functions are defined: %s",join(",",$extra));

View file

@ -2,8 +2,8 @@
require "tests.php";
// Check functions
check::functions(array('is_python_builtin'));
// No new functions
check::functions(array());
// Check classes.
check::classes(array('Exc','Test','threads_exception'));
// No new vars