Fix memoization of functions called with keyset arguments
[hiphop-php.git] / hphp / test / ext / main.cpp
blobcabcfce1d268c10f7099486f4ea3ef37992f461c
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
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"
20 #include <dlfcn.h>
22 #include "hphp/hhvm/process-init.h"
24 using namespace HPHP;
26 ///////////////////////////////////////////////////////////////////////////////
28 int main(int argc, char **argv) {
29 HPHP::register_process_init();
31 #ifdef HHVM_FBMAKE
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);
37 #endif
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];
43 if (argc >= 5) {
44 if (strcmp(argv[4], "quiet") == 0) {
45 Test::s_quiet = true;
46 } else {
47 Logger::LogLevel = (Logger::LogLevelType)atoi(argv[4]);
51 Test::logger.log_url = nullptr;
52 if (argc >= 6) {
53 Test::logger.log_url = argv[5];
56 // Initialize the runtime options with their default values
58 IniSetting::Map ini = IniSetting::Map::object;
59 Hdf empty;
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);
67 hphp_process_init();
68 Test test;
69 auto ret = test.RunTests(suite, which, set) ? 0 : -1;
70 hphp_process_exit();
71 return ret;