Arquivos
hhvm/hphp/test/main.cpp
T
mwilliams 18a45ba0d0 Get rid of invoke_builtin
It was only used to fold SimpleFunctionCall nodes. Ive setup enough
of the runtime that we can call invoke (which goes through hhvm's
normal Func dispatch), and then removed it.
2013-03-07 20:19:00 -08:00

74 linhas
2.3 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 <test/test.h>
#include <util/logger.h>
#include <runtime/base/program_functions.h>
#include <dlfcn.h>
#include "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
VM::compile_file(0, 0, MD5(), 0);
hphp_process_init();
Test test;
return test.RunTests(suite, which, set) ? 0 : -1;
}