Permalink
Browse files

Kill some dead code

Summary: Its been gone for a while...

Reviewed By: ricklavoie

Differential Revision: D3828359

fbshipit-source-id: 2c95fb3c0c3c9a5db3e27d03aa7bc91ef6de00ef
  • Loading branch information...
1 parent 6b1f427 commit 411b0c3398b411ad549a69239c4760d97e72fa1b @markw65 markw65 committed with Hhvm Bot Sep 8, 2016
View
@@ -27,10 +27,7 @@ hphp.log
/hphp/runtime/ext/*/CMakeLists.txt
/hphp/runtime/ext/*/*.so
-/hphp/runtime/tmp/Test*
-/hphp/runtime/tmp/run
-/hphp/runtime/tmp/run.sh
-/hphp/runtime/tmp/libtest.so
+/hphp/runtime/tmp/string
/hphp/hhvm/gen
@@ -1,5 +1 @@
-Test*
-run
-run.sh
-libtest.so
string
@@ -1,6 +0,0 @@
-#/bin/sh
-# called by src/
-cd runtime/tmp
-
-# remove all the sub directories
-rm -fR Test*
@@ -19,17 +19,12 @@
#include "hphp/runtime/base/apc-file-storage.h"
#include "hphp/runtime/base/comparisons.h"
#include "hphp/compiler/option.h"
+#include <folly/Format.h>
using namespace HPHP;
///////////////////////////////////////////////////////////////////////////////
-#ifndef PHP_PATH
-#define PHP_PATH "php"
-#endif
-
-const char *php_path = PHP_PATH;
-
int Test::s_total = 0;
int Test::s_passed = 0;
int Test::s_skipped = 0;
@@ -86,17 +81,16 @@ bool Test::logTestResults(std::string name, std::string details, int pass,
long useconds = finish.tv_usec - start.tv_usec;
long mseconds = ((seconds) * 1000 + useconds / 1000.0) + 0.5; // round up
- char summary[100];
- sprintf(summary, "PASSED (%d)", pass);
+ auto summary = folly::sformat("PASSED ({})", pass);
const char* status = "passed";
if (skip > 0) {
- sprintf(summary, "SKIPPED (%d)", skip);
+ summary += folly::sformat(",SKIPPED ({})", skip);
}
if (fail > 0) {
status = "failed";
- sprintf(summary, "FAILED (%d)", fail);
+ summary += folly::sformat("FAILED ({})", fail);
}
ArrayInit data(8, ArrayInit::Map{});
View
@@ -75,17 +75,6 @@ struct Test {
test.fail_count, test.skip_count); \
} \
-#ifdef SEP_EXTENSION
-#define IMPLEMENT_SEP_EXTENSION_TEST(name) \
- void Test::RunTestsImpl(bool &allPassed, std::string &suite, \
- std::string &which, std::string &set) { \
- RUN_TESTSUITE(TestExt ## name); \
- }
-#else
-#define IMPLEMENT_SEP_EXTENSION_TEST(name)
-#endif
-
-extern const char *php_path;
///////////////////////////////////////////////////////////////////////////////
#endif // incl_HPHP_TEST_H_
@@ -24,8 +24,6 @@
///////////////////////////////////////////////////////////////////////////////
-char TestBase::error_buffer[MAXPATHLEN];
-
TestBase::TestBase() {
Option::KeepStatementsWithNoEffect = true;
}
@@ -21,6 +21,7 @@
#include "hphp/runtime/base/type-conversions.h"
#include "hphp/test/ext/test.h"
+#include "hphp/util/text-util.h"
#include <cassert>
#include <exception>
@@ -33,9 +34,7 @@ struct TestBase {
TestBase();
virtual ~TestBase() {}
- virtual bool preTest() { return true; }
virtual bool RunTests(const std::string &which) = 0;
- virtual bool postTest() { return true; }
int fail_count;
int skip_count;
@@ -53,8 +52,6 @@ struct TestBase {
double v1, double v2);
bool array_value_exists(const Variant& var, const Variant& value);
- static char error_buffer[];
-
template<class T>
bool runTestImpl(T test, const std::string& which, const std::string& name) {
bool ret = true;
@@ -65,7 +62,7 @@ struct TestBase {
SCOPE_EXIT { fflush(nullptr); };
test_name = name;
try {
- if (preTest() && test() && postTest()) {
+ if (test()) {
if (!Test::s_quiet) {
pass();
}
@@ -107,11 +104,12 @@ typedef WithOption<false> WithNoOpt;
if (!runTestImpl([=] { return test(); }, which, #test)) ret = false; \
} while(false)
-#define LOG_TEST_ERROR(...) \
- sprintf(TestBase::error_buffer, __VA_ARGS__); \
- printf("%s\n", TestBase::error_buffer); \
- error_messages += "\n\n"; \
- error_messages += TestBase::error_buffer; \
+#define LOG_TEST_ERROR(...) do { \
+ std::string msg; \
+ string_printf(msg, __VA_ARGS__); \
+ printf("%s\n", msg.c_str()); \
+ error_messages += "\n\n" + msg; \
+ } while (false)
#define SKIP(reason) \
LOG_TEST_ERROR("%s skipped [%s]", __FUNCTION__, #reason); \
Oops, something went wrong.

0 comments on commit 411b0c3

Please sign in to comment.