aboutsummaryrefslogtreecommitdiff
path: root/ninja_test.cc
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-08-10 20:06:50 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-08-11 14:03:43 +0900
commitb3591eda330af9688f9fe4c1b1f59ccbcd9696c5 (patch)
tree85a72658cf1b2ffab53513e34dda019ffbd14d73 /ninja_test.cc
parent680139718cb041860c3c88aab7d516ab842869f7 (diff)
downloadkati-b3591eda330af9688f9fe4c1b1f59ccbcd9696c5.tar.gz
[C++] Improve NormalizePath
So now NormalizePath("../foo") will be "../foo" and "/../foo" will be "/foo".
Diffstat (limited to 'ninja_test.cc')
-rw-r--r--ninja_test.cc18
1 files changed, 2 insertions, 16 deletions
diff --git a/ninja_test.cc b/ninja_test.cc
index f1fb522..5fc410e 100644
--- a/ninja_test.cc
+++ b/ninja_test.cc
@@ -18,25 +18,10 @@
#include "log.h"
#include "ninja.h"
+#include "testutil.h"
namespace {
-#define ASSERT_EQ(a, b) \
- do { \
- if ((a) != (b)) { \
- fprintf(stderr, \
- "Assertion failure at %s:%d: %s (which is \"%s\") vs %s\n", \
- __FILE__, __LINE__, #a, c_str(a), #b); \
- } \
- } while(0)
-
-const char* c_str(const string& s) { return s.c_str(); }
-const char* c_str(size_t v) {
- static char buf[64];
- sprintf(buf, "%zd", v);
- return buf;
-}
-
string GetDepfile(string cmd, string* new_cmd) {
new_cmd->clear();
string r;
@@ -90,4 +75,5 @@ int main() {
g_log_no_exit = true;
TestGetDepfile();
TestGetGomaccPosForAndroidCompileCommand();
+ assert(!g_failed);
}