delete most PHP in C++

Sadly I can't get TestDebugger, TestServer, TestExt, QuickTests, or TestPerformance as they are all unsuported by verify. Someday.
Esse commit está contido em:
Paul Tarjan
2013-04-21 12:55:46 -07:00
commit de Sara Golemon
commit eca135cb31
5 arquivos alterados com 9 adições e 33358 exclusões
-1
Ver Arquivo
@@ -1,5 +1,4 @@
<?php
# test_code_run.cpp:29360
class MyDerivedClass {
public function __construct() {
+6 -33
Ver Arquivo
@@ -24,16 +24,6 @@ void Test::RunTestsImpl(bool &allPassed, std::string &suite,
std::string &which, std::string &set) {
// individual test suites
s_suite = suite;
if (suite == "TestCodeRun") {
RUN_TESTSUITE(TestCodeRun);
return;
}
if (suite == "TestCodeRunStatic") {
suite = "TestCodeRun";
TestCodeRun::FastMode = false;
RUN_TESTSUITE(TestCodeRun);
return;
}
if (suite == "TestDebugger" || suite == "TestDebuggerJit") {
if (suite == "TestDebuggerJit") {
RuntimeOption::EvalJit = true;
@@ -44,30 +34,13 @@ void Test::RunTestsImpl(bool &allPassed, std::string &suite,
RUN_TESTSUITE(TestDebugger);
return;
}
if (suite == "TestCodeRunVM" || suite == "TestCodeRunRepo") {
suite = "TestCodeRun";
Option::EnableEval = Option::FullEval;
RuntimeOption::EvalJit = false;
RUN_TESTSUITE(TestCodeRun);
return;
}
if (suite == "TestCodeRunJit" || suite == "TestCodeRunRepoJit" ||
suite == "TestCodeRunJitIR" || suite == "TestCodeRunRepoJitIR") {
suite = "TestCodeRun";
Option::EnableEval = Option::FullEval;
RuntimeOption::EvalJit = true;
if (suite == "TestCodeRunJitIR" || suite == "TestCodeRunRepoJitIR") {
RuntimeOption::EvalJitUseIR = true;
}
RUN_TESTSUITE(TestCodeRun);
return;
}
if (suite == "TestServer") {
Option::EnableEval = Option::FullEval;
RUN_TESTSUITE(TestServer);
return;
}
// set based tests with many suites
if (set == "TestUnit") {
RUN_TESTSUITE(TestParserExpr);
RUN_TESTSUITE(TestParserStmt);
@@ -76,11 +49,11 @@ void Test::RunTestsImpl(bool &allPassed, std::string &suite,
RUN_TESTSUITE(TestCppBase);
return;
}
if (set == "TestExt") {
// complete extension tests
#include "test_ext.inc"
if (suite == "" && set != "NoCodeRun" && set != "TestExt") {
RUN_TESTSUITE(TestCodeRun);
return;
}
printf("Unknown suite: %s\n", suite.c_str());
}
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+1 -240
Ver Arquivo
@@ -21,200 +21,16 @@
///////////////////////////////////////////////////////////////////////////////
class VCRInfo {
public:
VCRInfo(const char *i, const char *o, const char *f = "", int l = 0,
bool nw = false, bool fo = false)
: input(i), output(o), file(f), line(l), nowarnings(nw), fileoutput(fo) { }
const char *input;
const char *output;
const char *file;
int line;
bool nowarnings;
bool fileoutput;
};
typedef std::vector<VCRInfo> VCRInfoVec;
class OptionSetter;
/**
* Testing PHP -> C++ -> execution.
*/
class TestCodeRun : public TestBase {
friend class OptionSetter;
public:
TestCodeRun();
virtual bool preTest();
virtual bool postTest();
virtual bool RunTests(const std::string &which);
// test test harness
bool TestSanity();
// test code generation process
bool TestInnerFunction();
bool TestInnerClass();
bool TestVariableArgument();
bool TestArgumentHandling();
bool TestListAssignment();
bool TestExceptions();
bool TestPredefined();
bool TestLabels();
bool TestPerfectVirtual();
// test types
bool TestBoolean();
bool TestInteger();
bool TestDouble();
bool TestString();
bool TestArray();
bool TestArrayInit();
bool TestArrayCopy();
bool TestArrayEscalation();
bool TestArrayOffset();
bool TestArrayAccess();
bool TestArrayIterator();
bool TestArrayForEach();
bool TestArrayAssignment();
bool TestArrayFunctions();
bool TestArrayCSE();
bool TestScalarArray();
bool TestRange();
bool TestVariant();
bool TestObject();
bool TestObjectProperty();
bool TestObjectMethod();
bool TestClassMethod();
bool TestObjectMagicMethod();
bool TestObjectInvokeMethod();
bool TestObjectAssignment();
bool TestNewObjectExpression();
bool TestObjectPropertyExpression();
bool TestCollectionClasses();
bool TestComparisons();
bool TestTernary();
bool TestTypes();
bool TestSwitchStatement();
// test semantics
bool TestUnset();
bool TestReference();
bool TestDynamicConstants();
bool TestDynamicVariables();
bool TestDynamicProperties();
bool TestDynamicFunctions();
bool TestDynamicMethods();
bool TestVolatile();
bool TestSuperGlobals();
bool TestGlobalStatement();
bool TestStaticStatement();
bool TestIfStatement();
bool TestBreakStatement();
bool TestContinueStatement();
bool TestReturnStatement();
bool TestAdd();
bool TestMinus();
bool TestMultiply();
bool TestDivide();
bool TestModulus();
bool TestOperationTypes();
bool TestUnaryOperators();
bool TestSilenceOperator();
bool TestLogicalOperators();
bool TestGetClass();
bool TestGetParentClass();
bool TestRedeclaredFunctions();
bool TestRedeclaredClasses();
bool TestReassignThis();
bool TestClone();
bool TestEvalOrder();
bool TestGetObjectVars();
bool TestSerialization();
bool TestJson();
bool TestExit();
bool TestConstructorDestructor();
bool TestConcat();
bool TestConstant();
bool TestClassConstant();
bool TestConstantFunction();
bool TestDefined();
bool TestAssignment();
bool TestPrint();
bool TestVarExport();
bool TestLocale();
bool TestBadFunctionCalls();
bool TestConstructor();
bool TestIntIsset();
// misc
bool TestHereDoc();
bool TestProgramFunctions();
bool TestCompilation();
bool TestReflection();
bool TestReflectionClasses();
bool TestErrorHandler();
bool TestAssertOptions();
bool TestExtMisc();
bool TestInvalidArgument();
bool TestThrift();
bool TestCreateFunction();
bool TestSimpleXML();
bool TestXML();
bool TestDOMDocument();
bool TestDirectory();
bool TestFile();
bool TestUserWrappers();
bool TestUselessAssignment();
bool TestExtString();
bool TestExtArray();
bool TestExtFile();
bool TestExtDate();
bool TestExtImage();
bool TestExtSplFile();
bool TestExtIterator();
bool TestExtSoap();
bool TestExtCollator();
bool TestExtSocket();
bool TestAPC();
bool TestInlining();
bool TestCopyProp();
bool TestRenameFunction();
bool TestIntercept();
bool TestMaxInt();
bool TestParser();
bool TestTypeAssertions();
bool TestSerialize();
bool TestHoisting();
// PHP 5.3
bool TestVariableClassName();
bool TestLateStaticBinding();
bool TestCallStatic();
bool TestNowDoc();
bool TestTernaryShortcut();
bool TestGoto();
bool TestClosure();
bool TestNamespace();
// PHP 5.4
bool TestTraits();
// PHP 5.5
bool TestUConverter();
// HipHop specific
bool TestYield();
bool TestHint();
bool TestUserAttributes();
bool TestStrictMode();
// debugging purpose
bool TestAdHoc();
static bool FastMode;
static const char *Filter;
virtual bool RunTests(const std::string &which) = 0;
protected:
bool CleanUp();
@@ -226,64 +42,9 @@ class TestCodeRun : public TestBase {
bool nowarnings = false, bool fileoutput = false);
bool m_perfMode;
VCRInfoVec m_infos;
std::string m_compileOptions;
std::string m_runtimeOptions;
std::string m_envVars;
int m_test;
};
class OptionSetter {
public:
enum Kind { CompileTime, RunTime, Env };
OptionSetter(TestCodeRun *tcr, Kind k, const char *opt) :
m_str(Get(tcr,k)), m_saved(m_str) {
m_str += opt;
m_str += "\n";
}
~OptionSetter() {
m_str = m_saved;
}
private:
std::string &Get(TestCodeRun *tcr, Kind k) {
if (k == CompileTime) return tcr->m_compileOptions;
if (k == RunTime) return tcr->m_runtimeOptions;
return tcr->m_envVars;
}
std::string &m_str;
std::string m_saved;
};
class XhpSyntax {
public:
XhpSyntax(TestCodeRun *tcr) :
m_compile(tcr, OptionSetter::CompileTime, "-vEnableXHP=1"),
m_runtime(tcr, OptionSetter::RunTime, "-vEval.EnableXHP=1") {}
private:
OptionSetter m_compile;
OptionSetter m_runtime;
};
class HipHopSyntax {
public:
HipHopSyntax(TestCodeRun *tcr) :
m_compile(tcr, OptionSetter::CompileTime, "-vEnableHipHopSyntax=1"),
m_runtime(tcr, OptionSetter::RunTime, "-vEval.EnableHipHopSyntax=1") {}
private:
OptionSetter m_compile;
OptionSetter m_runtime;
};
class FinallyStatement {
public:
FinallyStatement(TestCodeRun *tcr) :
m_compile(tcr, OptionSetter::CompileTime, "-vEnableFinallyStatement=1"),
m_runtime(tcr, OptionSetter::RunTime, "-vEval.EnableFinallyStatement=1") {}
private:
OptionSetter m_compile;
OptionSetter m_runtime;
};
///////////////////////////////////////////////////////////////////////////////
// macros
+1 -3
Ver Arquivo
@@ -36,9 +36,7 @@ using namespace HPHP;
///////////////////////////////////////////////////////////////////////////////
TestServer::TestServer() {
TestCodeRun::FastMode = false;
}
TestServer::TestServer() { }
static int s_server_port = 0;
static int s_admin_port = 0;