Ver Fonte

Updated catch.

Branimir Karadžić há 8 anos atrás
pai
commit
97eba92e96

Diff do ficheiro suprimidas por serem muito extensas
+ 423 - 132
3rdparty/catch/catch.hpp


+ 1 - 0
include/bx/bx.h

@@ -12,6 +12,7 @@
 #include <stdlib.h> // size_t
 #include <stddef.h> // ptrdiff_t
 
+#include "platform.h"
 #include "config.h"
 #include "macros.h"
 

+ 1 - 1
include/bx/config.h

@@ -6,7 +6,7 @@
 #ifndef BX_CONFIG_H_HEADER_GUARD
 #define BX_CONFIG_H_HEADER_GUARD
 
-#include "platform.h"
+#include "bx.h"
 
 #ifndef BX_CONFIG_ALLOCATOR_DEBUG
 #	define BX_CONFIG_ALLOCATOR_DEBUG 0

+ 0 - 1
include/bx/error.h

@@ -6,7 +6,6 @@
 #ifndef BX_ERROR_H_HEADER_GUARD
 #define BX_ERROR_H_HEADER_GUARD
 
-#include "bx.h"
 #include "string.h"
 
 #define BX_ERROR_SET(_ptr, _result, _msg) \

+ 0 - 1
include/bx/os.h

@@ -6,7 +6,6 @@
 #ifndef BX_OS_H_HEADER_GUARD
 #define BX_OS_H_HEADER_GUARD
 
-#include "bx.h"
 #include "debug.h"
 
 #if BX_PLATFORM_OSX

+ 0 - 1
include/bx/readerwriter.h

@@ -6,7 +6,6 @@
 #ifndef BX_READERWRITER_H_HEADER_GUARD
 #define BX_READERWRITER_H_HEADER_GUARD
 
-#include "bx.h"
 #include "allocator.h"
 #include "error.h"
 #include "uint32_t.h"

+ 3 - 4
include/bx/string.h

@@ -6,11 +6,10 @@
 #ifndef BX_STRING_H_HEADER_GUARD
 #define BX_STRING_H_HEADER_GUARD
 
-#include "bx.h"
-#include <wchar.h>  // wchar_t
-
 #include "allocator.h"
 
+#include <wchar.h> // wchar_t
+
 namespace bx
 {
 	/// Non-zero-terminated string view.
@@ -179,7 +178,7 @@ namespace bx
 	// Finds identifier.
 	const char* findIdentifierMatch(const char* _str, const char* _word);
 
-	// Finds any identifier from NULL terminated array of identifiers.
+	/// Finds any identifier from NULL terminated array of identifiers.
 	const char* findIdentifierMatch(const char* _str, const char* _words[]);
 
 	/// Cross platform implementation of vsnprintf that returns number of

+ 1 - 6
tests/main_test.cpp

@@ -3,16 +3,11 @@
  * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
  */
 
-#define CATCH_CONFIG_RUNNER
 #include "test.h"
 
 static const char* s_argv[] = { "bx.test" };
 
-int runAllTests(int _argc, const char* _argv[])
-{
-	DBG(BX_COMPILER_NAME " / " BX_CPU_NAME " / " BX_ARCH_NAME " / " BX_PLATFORM_NAME);
-	return Catch::Session().run(_argc, _argv);
-}
+int runAllTests(int _argc, const char* _argv[]);
 
 #if BX_PLATFORM_ANDROID
 #	include <android/native_activity.h>

+ 20 - 0
tests/run_test.cpp

@@ -0,0 +1,20 @@
+/*
+ * Copyright 2010-2017 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ */
+
+#define CATCH_CONFIG_RUNNER
+#include "test.h"
+
+int runAllTests(int _argc, const char* _argv[])
+{
+	DBG("Compiler: " BX_COMPILER_NAME
+		", CPU: " BX_CPU_NAME
+		", Architecture: " BX_ARCH_NAME
+		", OS: " BX_PLATFORM_NAME
+		", CRT: " BX_CRT_NAME
+		", Date: " __DATE__
+		", Time: " __TIME__
+		);
+	return Catch::Session().run(_argc, _argv);
+}

+ 1 - 0
tests/test.h

@@ -7,6 +7,7 @@
 #define __TEST_H__
 
 #include <bx/bx.h>
+
 #include <catch/catch.hpp>
 #define TEST(_x) TEST_CASE(#_x, "")
 #define CHECK_EQUAL(_x, _y) REQUIRE(_x == _y)

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff