6ec64e8bf9
I was learning from @jdelong and he said that you should use double quotes for local includes and angle brackets for library includes. I asked why our code was the way it was, and he said he wanted to clean it up. I beat him to it :) Conflicts: hphp/runtime/base/server/admin_request_handler.cpp hphp/runtime/vm/named_entity.h
74 linhas
2.4 KiB
C++
74 linhas
2.4 KiB
C++
/*
|
|
+----------------------------------------------------------------------+
|
|
| HipHop for PHP |
|
|
+----------------------------------------------------------------------+
|
|
| Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
|
|
+----------------------------------------------------------------------+
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
| available through the world-wide-web at the following url: |
|
|
| http://www.php.net/license/3_01.txt |
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
+----------------------------------------------------------------------+
|
|
*/
|
|
|
|
#include "hphp/test/test.h"
|
|
#include "hphp/util/logger.h"
|
|
#include "hphp/runtime/base/program_functions.h"
|
|
#include <dlfcn.h>
|
|
|
|
#include "hphp/hhvm/process_init.h"
|
|
|
|
using namespace HPHP;
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
extern "C" void compiler_hook_initialize();
|
|
|
|
int main(int argc, char **argv) {
|
|
HPHP::register_process_init();
|
|
|
|
#ifdef HHVM_FBMAKE
|
|
// In an fbmake build, override the locations of hphp and hhvm that
|
|
// dirs.mk will think we're using. (This is used in test.mk when
|
|
// building/running tests.)
|
|
setenv("TEST_OVERRIDE_HHVM", "_bin/hphp/hhvm/hhvm", true);
|
|
setenv("TEST_OVERRIDE_HPHP", "_bin/hphp/hhvm/hphp", true);
|
|
#endif
|
|
|
|
#ifdef FACEBOOK
|
|
compiler_hook_initialize();
|
|
#endif
|
|
|
|
std::string suite, which, set;
|
|
if (argc >= 2) suite = argv[1];
|
|
if (argc >= 3) which = argv[2];
|
|
if (argc >= 4) set = argv[3];
|
|
if (argc >= 5) {
|
|
if (strcmp(argv[4], "quiet") == 0) {
|
|
Test::s_quiet = true;
|
|
} else {
|
|
Logger::LogLevel = (Logger::LogLevelType)atoi(argv[4]);
|
|
}
|
|
}
|
|
|
|
Test::logger.log_url = nullptr;
|
|
if (argc >= 6) {
|
|
Test::logger.log_url = argv[5];
|
|
}
|
|
|
|
// Initialize the runtime options with their default values
|
|
{
|
|
Hdf empty;
|
|
RuntimeOption::Load(empty);
|
|
}
|
|
|
|
// Initialize compiler state
|
|
compile_file(0, 0, MD5(), 0);
|
|
hphp_process_init();
|
|
Test test;
|
|
return test.RunTests(suite, which, set) ? 0 : -1;
|
|
}
|