Arquivos
hhvm/hphp/test
Edwin Smith f29ee5314d Remove String::operator const char*().
Too many ways to shoot self in foot with this gem.
2013-04-25 11:34:21 -07:00
..
2013-02-11 02:10:41 -08:00
2013-04-25 00:49:50 -07:00
2013-04-18 12:19:35 -07:00
2013-04-17 09:08:16 -07:00
2013-04-11 10:58:54 -07:00
2013-04-25 11:34:20 -07:00
2013-04-17 10:12:39 -07:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-04-25 00:50:01 -07:00
2013-02-14 09:09:27 -08:00
2013-04-17 10:12:46 -07:00
2013-04-25 00:50:12 -07:00
2013-02-11 02:10:41 -08:00
2013-04-22 14:43:51 -07:00
2013-04-22 14:43:47 -07:00
2013-03-08 18:44:01 -08:00
2013-04-22 14:43:51 -07:00
2013-04-22 14:43:51 -07:00
2013-02-11 02:10:41 -08:00
2013-04-17 10:12:48 -07:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-03-18 15:12:16 -07:00
2013-03-14 14:27:16 -07:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-04-22 14:43:21 -07:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-03-14 14:27:16 -07:00
2013-03-14 14:27:16 -07:00
2013-02-11 02:10:41 -08:00
2013-02-19 06:57:54 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-04-22 14:43:50 -07:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-19 06:57:54 -08:00
2013-04-25 00:50:02 -07:00
2013-04-01 13:48:31 -07:00

Suites

Tests are grouped into "suites". They are just directories. Suites can have subdirectories if you want to group them even more. Running a suite will run all sub-suites.

  • quick - The most common. Put your test here by default.
  • slow - Slower full featured tests. Grouped into sub-suites.
  • zend/good - Passing tests from Zend's suite.
  • zend/bad - Failing tests from Zend. Fix these and move them to zend/good.
  • vm-perf - Some performance tests that aren't commonly run.

Examples how to run them

  • Quick suite with the JIT on - test/run test/quick

  • Zend tests just with the interpreter in RepoAuthoritative mode - test/run test/zend/good -m interp -r

  • Slow tests with the JIT in IR mode - test/run test/slow -m hhir

  • Run evertyhing that is supposed to pass - fbmake runtests

File Layout

The format is the same as Zend's .phpt but instead of sections it is separate files with the section name converted to an extension. This allows you to easily run the .php file without first running the test suite.

These are the allowed extensions:

  • .php - The source of the test.
  • .expect - The exact string expected output.
  • .expectf - The exact string expected output with formating characters.
  • .expectregex - A regex that matches the output.
  • .out - When you run the test, the output will be stored here.
  • .opts - Runtime options to pass to hhvm.
  • .diff - The diff for .expect tests.
  • .hhas - HipHop Assembly.

You must have one .php; one and only one of .expect, .expectf, and .expectregex; and the rest are optional.

Any suite can have a config.hdf file in it that will be used. If one isn't present, then the parent suite it checked recusrivly until we use test/config.hdf.

Name your test in a descriptive manner and when in doubt break your test into many files. You can use comments too so future engineers know if it is a real breakage or they need to change the expected output.

Format Characters

These can appear in .expectf files.

Char Description Regex
%e Path separator /
%s Any characters except newlines [^\r\n]+
%S Optionally any characters except newlines [^\r\n]*
%a Any characters .+
%A Optionally any characters .*
%w Optional whitespace \s*
%i Integer with optional sign [+-]?\d+
%d Digits \d+
%x Hex [0-9a-fA-F]+
%f Float [+-]?.?\d+.?\d
%c Character .