2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #include "hphp/test/ext/test.h"
18 #include "hphp/util/logger.h"
19 #include "hphp/runtime/base/program-functions.h"
22 #include "hphp/hhvm/process-init.h"
26 ///////////////////////////////////////////////////////////////////////////////
28 int main(int argc
, char **argv
) {
29 HPHP::register_process_init();
32 // In an fbmake build, override the locations of hphp and hhvm that
33 // dirs.mk will think we're using. (This is used in test.mk when
34 // building/running tests.)
35 setenv("TEST_OVERRIDE_HHVM", "_bin/hphp/hhvm/hhvm", true);
36 setenv("TEST_OVERRIDE_HPHP", "_bin/hphp/hhvm/hphp", true);
39 std::string suite
, which
, set
;
40 if (argc
>= 2) suite
= argv
[1];
41 if (argc
>= 3) which
= argv
[2];
42 if (argc
>= 4) set
= argv
[3];
44 if (strcmp(argv
[4], "quiet") == 0) {
47 Logger::LogLevel
= (Logger::LogLevelType
)atoi(argv
[4]);
51 Test::logger
.log_url
= nullptr;
53 Test::logger
.log_url
= argv
[5];
56 // Initialize the runtime options with their default values
58 IniSetting::Map ini
= IniSetting::Map::object
;
60 RuntimeOption::Load(ini
, empty
);
61 // This one's default value changed recently
62 RuntimeOption::AlwaysPopulateRawPostData
= true;
65 // Initialize compiler state
66 compile_file(0, 0, MD5(), 0);
69 auto ret
= test
.RunTests(suite
, which
, set
) ? 0 : -1;