summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-28 22:22:19 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-28 22:22:19 +0000
commit0640f87859a5a676b41783be4741a62f4d1ea266 (patch)
treef0a59916b4c1871965f459319add376f3ba5ed6b
parente2ac08d5b40cfa3e4d001be35178ea0e4ef75aad (diff)
tests: More fixes and toolsets support
git-svn-id: http://pugixml.googlecode.com/svn/trunk@190 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--Jamrules.jam80
-rw-r--r--tests/main.cpp10
-rw-r--r--tests/test_document.cpp8
-rw-r--r--tests/test_dom_traverse.cpp8
-rw-r--r--tests/test_xpath_operators.cpp6
5 files changed, 92 insertions, 20 deletions
diff --git a/Jamrules.jam b/Jamrules.jam
index 55138f2..c74764f 100644
--- a/Jamrules.jam
+++ b/Jamrules.jam
@@ -13,25 +13,25 @@ if ( $(toolset:I=^mingw) )
actions ObjectAction
{
- %$(toolset)_PATH%\bin\gcc -W -Wall -Wextra -Werror -pedantic -c $(>) -o $(<) $(CCFLAGS)
+ "%$(toolset)_PATH%\bin\gcc" -W -Wall -Wextra -Werror -pedantic -c $(>) -o $(<) $(CCFLAGS)
}
actions LibraryAction
{
- %$(toolset)_PATH%\bin\ar rc $(<) $(>)
+ "%$(toolset)_PATH%\bin\ar" rc $(<) $(>)
}
actions LinkAction
{
- %$(toolset)_PATH%\bin\g++ $(>) -o $(<) $(LDFLAGS)
+ "%$(toolset)_PATH%\bin\g++" $(>) -o $(<) $(LDFLAGS)
}
actions CoverageAction
{
- %$(toolset)_PATH%\bin\gcov $(>:\\) $(GCOVFLAGS) | perl tests/gcov-filter.pl
+ "%$(toolset)_PATH%\bin\gcov" $(>:\\) $(GCOVFLAGS) | perl tests/gcov-filter.pl
}
}
-else if ( $(toolset:I^=msvc) )
+else if ( $(toolset:I=^msvc) )
{
if ( $(configuration) = "debug" )
{
@@ -53,17 +53,79 @@ else if ( $(toolset:I^=msvc) )
actions ObjectAction
{
- %$(toolset)_PATH%\bin\cl.exe /EHsc /WX /I%$(toolset)_PATH%\include /c $(>) /Fo$(<) /nologo $(CCFLAGS)
+ "%$(toolset)_PATH%\bin\cl.exe" /EHsc /WX /I"%$(toolset)_PATH%\include" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
}
actions LibraryAction
{
- %$(toolset)_PATH%\bin\lib.exe /NOLOGO /OUT:$(<) $(>)
+ "%$(toolset)_PATH%\bin\lib.exe" /NOLOGO /OUT:$(<) $(>)
}
actions LinkAction
{
- %$(toolset)_PATH%\bin\link.exe /SUBSYSTEM:CONSOLE /NOLOGO /OUT:$(<) $(>) /LIBPATH:%$(toolset)_PATH%\lib /LIBPATH:%$(toolset)_PATH%\PlatformSDK\lib $(LDFLAGS)
+ "%$(toolset)_PATH%\bin\link.exe" /SUBSYSTEM:CONSOLE /NOLOGO /OUT:$(<) $(>) /LIBPATH:"%$(toolset)_PATH%\lib" /LIBPATH:"%$(toolset)_PATH%\PlatformSDK\lib" $(LDFLAGS)
+ }
+
+ actions CoverageAction
+ {
+ }
+}
+else if ( $(toolset) = "ic8" )
+{
+ msvc = "msvc7" ;
+
+ if ( $(configuration) = "debug" )
+ {
+ CCFLAGS += /D_DEBUG /MTd ;
+ }
+ else
+ {
+ CCFLAGS += /DNDEBUG /Ox /MT ;
+ }
+
+ actions ObjectAction
+ {
+ "%$(toolset)_PATH%\bin\icl.exe" /EHsc /W4 /WX /Wport /Qwd981,444,280,383,909,304,167 /I"%$(msvc)_PATH%\include" /I"%$(toolset)_PATH%\include" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
+ }
+
+ actions LibraryAction
+ {
+ "%$(msvc)_PATH%\bin\lib.exe" /NOLOGO /OUT:$(<) $(>)
+ }
+
+ actions LinkAction
+ {
+ "%$(msvc)_PATH%\bin\link.exe" /SUBSYSTEM:CONSOLE /NOLOGO /OUT:$(<) $(>) /LIBPATH:"%$(toolset)_PATH%\lib" /LIBPATH:"%$(msvc)_PATH%\lib" /LIBPATH:"%$(msvc)_PATH%\PlatformSDK\lib" $(LDFLAGS)
+ }
+
+ actions CoverageAction
+ {
+ }
+}
+else if ( $(toolset:I=^dmc) )
+{
+ if ( $(configuration) = "debug" )
+ {
+ CCFLAGS += -D_DEBUG ;
+ }
+ else
+ {
+ CCFLAGS += -DNDEBUG ;
+ }
+
+ actions ObjectAction
+ {
+ "%$(toolset)_PATH%\bin\dmc.exe" -c -f -wx -Ae $(>) -o$(<)
+ }
+
+ actions LibraryAction
+ {
+ "%$(toolset)_PATH%\bin\lib.exe" -c $(<) $(>)
+ }
+
+ actions LinkAction
+ {
+ "%$(toolset)_PATH%\bin\link.exe" $(>:\\) , $(<:\\) , nul , $(LDFLAGS:\\)
}
actions CoverageAction
@@ -71,7 +133,7 @@ else if ( $(toolset:I^=msvc) )
}
}
-actions RunAction
+actions screenoutput RunAction
{
$(>:\\)
}
diff --git a/tests/main.cpp b/tests/main.cpp
index 664f171..1886412 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -8,9 +8,9 @@
test_runner* test_runner::_tests = 0;
size_t test_runner::_memory_fail_threshold = 0;
-size_t g_memory_total_size = 0;
+static size_t g_memory_total_size = 0;
-void* custom_allocate(size_t size)
+static void* custom_allocate(size_t size)
{
if (test_runner::_memory_fail_threshold > 0 && test_runner::_memory_fail_threshold < size)
return 0;
@@ -24,7 +24,7 @@ void* custom_allocate(size_t size)
}
}
-void custom_deallocate(void* ptr)
+static void custom_deallocate(void* ptr)
{
if (ptr)
{
@@ -34,7 +34,7 @@ void custom_deallocate(void* ptr)
}
}
-void replace_memory_management()
+static void replace_memory_management()
{
// create some document to touch original functions
{
@@ -87,7 +87,7 @@ int main()
if (failed != 0)
printf("FAILURE: %u out of %u tests failed.\n", failed, total);
else
- printf("Success: %d tests passed.\n", total);
+ printf("Success: %u tests passed.\n", total);
return failed;
}
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index ff5c4d6..ec54e95 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -29,9 +29,11 @@ TEST(document_load_stream_error)
std::ifstream fs1("filedoesnotexist");
CHECK(doc.load(fs1).status == status_io_error);
+#ifndef __DMC__ // Digital Mars CRT does not like 'con' pseudo-file
std::ifstream fs2("con");
CHECK(doc.load(fs2).status == status_io_error);
-
+#endif
+
std::ifstream fs3("nul");
CHECK(doc.load(fs3).status == status_io_error);
@@ -75,7 +77,11 @@ TEST(document_load_file_error)
pugi::xml_document doc;
CHECK(doc.load_file("filedoesnotexist").status == status_file_not_found);
+
+#ifndef __DMC__ // Digital Mars CRT does not like 'con' pseudo-file
CHECK(doc.load_file("con").status == status_io_error);
+#endif
+
CHECK(doc.load_file("nul").status == status_io_error);
test_runner::_memory_fail_threshold = 1;
diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp
index 9c45dc6..ab3ed35 100644
--- a/tests/test_dom_traverse.cpp
+++ b/tests/test_dom_traverse.cpp
@@ -8,13 +8,13 @@
#pragma warning(disable: 4996)
#endif
-template <typename I> I move_iter(I base, int n)
+template <typename I> static I move_iter(I base, int n)
{
std::advance(base, n);
return base;
}
-template <typename T> void generic_bool_ops_test(const T& obj)
+template <typename T> static void generic_bool_ops_test(const T& obj)
{
T null;
@@ -28,7 +28,7 @@ template <typename T> void generic_bool_ops_test(const T& obj)
CHECK(b2);
}
-template <typename T> void generic_rel_ops_test(T obj1, T obj2)
+template <typename T> static void generic_rel_ops_test(T obj1, T obj2)
{
T null = T();
@@ -88,7 +88,7 @@ template <typename T> void generic_rel_ops_test(T obj1, T obj2)
CHECK(!(obj1 >= obj2));
}
-template <typename T> void generic_empty_test(const T& obj)
+template <typename T> static void generic_empty_test(const T& obj)
{
T null;
diff --git a/tests/test_xpath_operators.cpp b/tests/test_xpath_operators.cpp
index db834cd..08a54c4 100644
--- a/tests/test_xpath_operators.cpp
+++ b/tests/test_xpath_operators.cpp
@@ -1,7 +1,11 @@
#include "common.hpp"
#if defined(_MSC_VER) && _MSC_VER == 1200
-#define MSVC6_NAN_BUG // NaN comparison on MSVC6 is incorrect, see http://www.nabble.com/assertDoubleEquals,-NaN---Microsoft-Visual-Studio-6-td9137859.html
+# define MSVC6_NAN_BUG // NaN comparison on MSVC6 is incorrect, see http://www.nabble.com/assertDoubleEquals,-NaN---Microsoft-Visual-Studio-6-td9137859.html
+#endif
+
+#if defined(__INTEL_COMPILER) && __INTEL_COMPILER == 800
+# define MSVC6_NAN_BUG // IC8 seems to have the same bug as MSVC6 does
#endif
TEST_XML(xpath_operators_arithmetic, "<node><foo-bar>10</foo-bar><foo>2</foo><bar>3</bar></node>")