2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present 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"
21 #include "hphp/hhvm/process-init.h"
25 ///////////////////////////////////////////////////////////////////////////////
27 int main(int argc
, char **argv
) {
28 HPHP::StaticString::CreateAll();
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];
57 SCOPE_EXIT
{ rds::local::fini(); };
59 // Initialize the runtime options with their default values
61 IniSetting::Map ini
= IniSetting::Map::object
;
63 RuntimeOption::Load(ini
, empty
);
64 // This one's default value changed recently
65 Cfg::Server::AlwaysPopulateRawPostData
= true;
69 SCOPE_EXIT
{ hphp_process_exit(); };
71 return test
.RunTests(suite
, which
, set
) ? 0 : -1;