php-src/tests/run-test
Max Semenik 6c9a05667b run-tests: use the EXTENSIONS section for skipping
Currently, most skip checks are just for making sure an extension is
available. Even with recent addition of skip caching, this makes tests
needlessly slow:
* Checks for the same extension in its tests can have small differences
  impacting cacheability.
* Even identical skip checks in two tests can still be executed twice if
  they're run by different workers.

To remedy this, I'm repurposing the existing --EXTENSIONS-- section of
.phpt files to specify wjich extensions are required for current test to
run. Current behavior:
1) If the extension is already visible to PHP, all is good
2) If it isn't, assume it's present as a shared module and attempt to add
   it via a command line parameter
3) If that works, all is good
4) If it doesn't, PHP fails with a cryptic error message trying to
   execute the test itself

After this commit:
1) and 2) are kept unchanged
3) Check if shared extension file from 2) is actually present
4) Skip the test if it isn't

Other benefits include clear skip reasons (vs. sometimes none in many
current skip checks) and moving test information from code to metadata,
opening more opportunities for search and analysis.

Since --EXTENSIONS-- is barely ever used, this change poses no risk of
hidden failures.

As a demonstration of the new approach, this commit migrates one
extension to it. If merged, I will migrate other extensions in
subsequent PRs.

Closes GH-6787.
2021-03-22 09:53:38 +01:00
..
extensions-shared.phpt run-tests: use the EXTENSIONS section for skipping 2021-03-22 09:53:38 +01:00
extensions-static.phpt run-tests: use the EXTENSIONS section for skipping 2021-03-22 09:53:38 +01:00
test001.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
test002.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
test003.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
test004.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
test006.phpt bring back the division by zero warning 2015-07-05 20:18:17 +02:00
test007.phpt
test009.phpt Use EXPECT instead of EXPECTF when possible 2018-02-20 21:53:48 +01:00
test010.phpt Another CRLF test fix 2015-03-26 03:18:42 +01:00
test011.phpt run-tests.php: Adding support for sections EXPECT_EXTERNAL, EXPECTF_EXTERNAL and EXPECTREGEX_EXTERNAL. (Issue 55736) 2013-09-03 14:40:43 +02:00
test011.txt run-tests.php: Adding support for sections EXPECT_EXTERNAL, EXPECTF_EXTERNAL and EXPECTREGEX_EXTERNAL. (Issue 55736) 2013-09-03 14:40:43 +02:00
test012.phpt run-tests.php: Adding support for sections EXPECT_EXTERNAL, EXPECTF_EXTERNAL and EXPECTREGEX_EXTERNAL. (Issue 55736) 2013-09-03 14:40:43 +02:00
test012.txt run-tests.php: Adding support for sections EXPECT_EXTERNAL, EXPECTF_EXTERNAL and EXPECTREGEX_EXTERNAL. (Issue 55736) 2013-09-03 14:40:43 +02:00
test013.phpt run-tests.php: Adding support for sections EXPECT_EXTERNAL, EXPECTF_EXTERNAL and EXPECTREGEX_EXTERNAL. (Issue 55736) 2013-09-03 14:40:43 +02:00
test013.txt run-tests.php: Adding support for sections EXPECT_EXTERNAL, EXPECTF_EXTERNAL and EXPECTREGEX_EXTERNAL. (Issue 55736) 2013-09-03 14:40:43 +02:00