mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-26 21:04:25 +08:00
tests: Added Xbox360 and PS3 toolset support
git-svn-id: http://pugixml.googlecode.com/svn/trunk@602 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
fc88f09ac1
commit
2dec6dd505
149
Jamrules.jam
149
Jamrules.jam
@ -411,6 +411,130 @@ else if ( $(toolset:I=^suncc) )
|
||||
sunCC $(>) -o $(<) $(LDFLAGS)
|
||||
}
|
||||
}
|
||||
else if ( $(toolset:I=^xbox360) )
|
||||
{
|
||||
rule GetCFlags CONFIG : DEFINES
|
||||
{
|
||||
local RESULT = /D$(DEFINES) ;
|
||||
|
||||
if ( $(CONFIG) = "debug" )
|
||||
{
|
||||
RESULT += /D_DEBUG /MTd ;
|
||||
}
|
||||
else
|
||||
{
|
||||
RESULT += /DNDEBUG /Ox /MT ;
|
||||
}
|
||||
|
||||
RESULT += /W4 ;
|
||||
|
||||
if ( ! ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) ) )
|
||||
{
|
||||
RESULT += /EHsc ;
|
||||
}
|
||||
else
|
||||
{
|
||||
RESULT += /D_HAS_EXCEPTIONS=0 ;
|
||||
}
|
||||
|
||||
return $(RESULT) ;
|
||||
}
|
||||
|
||||
actions ObjectAction
|
||||
{
|
||||
"%XEDK%\bin\win32\cl.exe" /WX /I"%XEDK%\include\xbox" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
|
||||
}
|
||||
|
||||
actions LibraryAction
|
||||
{
|
||||
"%XEDK%\bin\win32\lib.exe" /NOLOGO /OUT:$(<) $(>)
|
||||
}
|
||||
|
||||
actions LinkAction
|
||||
{
|
||||
"%XEDK%\bin\win32\link.exe" /NOLOGO /OUT:$(<) /PDB:$(<:S=.pdb) $(>) /LIBPATH:"%XEDK%\lib\xbox" $(LDFLAGS)
|
||||
}
|
||||
}
|
||||
else if ( $(toolset:I=^ps3_gcc) )
|
||||
{
|
||||
rule GetCFlags CONFIG : DEFINES
|
||||
{
|
||||
local RESULT = -D$(DEFINES) ;
|
||||
|
||||
RESULT += -W -Wall -Wextra -Werror ;
|
||||
|
||||
if ( $(CONFIG) = "debug" )
|
||||
{
|
||||
RESULT += -D_DEBUG ;
|
||||
}
|
||||
else
|
||||
{
|
||||
RESULT += -DNDEBUG -O3 ;
|
||||
}
|
||||
|
||||
if ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) )
|
||||
{
|
||||
RESULT += -fno-exceptions ;
|
||||
}
|
||||
|
||||
return $(RESULT) ;
|
||||
}
|
||||
|
||||
actions ObjectAction
|
||||
{
|
||||
"%SCE_PS3_ROOT%\host-win32\ppu\bin\ppu-lv2-gcc" -c $(>) -o $(<) $(CCFLAGS)
|
||||
}
|
||||
|
||||
actions LibraryAction
|
||||
{
|
||||
"%SCE_PS3_ROOT%\host-win32\ppu\bin\ppu-lv2-ar" rcs $(<) $(>)
|
||||
}
|
||||
|
||||
actions LinkAction
|
||||
{
|
||||
"%SCE_PS3_ROOT%\host-win32\ppu\bin\ppu-lv2-g++" $(>) -o $(<) $(LDFLAGS)
|
||||
}
|
||||
}
|
||||
else if ( $(toolset:I=^ps3_snc) )
|
||||
{
|
||||
rule GetCFlags CONFIG : DEFINES
|
||||
{
|
||||
local RESULT = -D$(DEFINES) ;
|
||||
|
||||
RESULT += -Werror -Xuninitwarn=0 ;
|
||||
|
||||
if ( $(CONFIG) = "debug" )
|
||||
{
|
||||
RESULT += -D_DEBUG ;
|
||||
}
|
||||
else
|
||||
{
|
||||
RESULT += -DNDEBUG -O3 ;
|
||||
}
|
||||
|
||||
if ! ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) )
|
||||
{
|
||||
RESULT += -Xc+=exceptions ;
|
||||
}
|
||||
|
||||
return $(RESULT) ;
|
||||
}
|
||||
|
||||
actions ObjectAction
|
||||
{
|
||||
"%SCE_PS3_ROOT%\host-win32\sn\bin\ps3ppusnc" -c $(>) -o $(<) $(CCFLAGS)
|
||||
}
|
||||
|
||||
actions LibraryAction
|
||||
{
|
||||
"%SCE_PS3_ROOT%\host-win32\sn\bin\ps3snarl" rcs $(<) $(>)
|
||||
}
|
||||
|
||||
actions LinkAction
|
||||
{
|
||||
"%SCE_PS3_ROOT%\host-win32\sn\bin\ps3ppuld" $(>) -o $(<) $(LDFLAGS)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
exit "Unknown toolset $(toolset)!" ;
|
||||
@ -459,15 +583,28 @@ if ( $(UNIX) )
|
||||
}
|
||||
else
|
||||
{
|
||||
actions screenoutput RunAction
|
||||
if ( $(toolset:I=^(xbox360|ps3)) )
|
||||
{
|
||||
$(>:\\)
|
||||
}
|
||||
actions RunAction
|
||||
{
|
||||
}
|
||||
|
||||
actions RunSampleAction
|
||||
actions RunSampleAction
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cd docs\samples
|
||||
..\..\$(>:\\)
|
||||
actions screenoutput RunAction
|
||||
{
|
||||
$(>:\\)
|
||||
}
|
||||
|
||||
actions RunSampleAction
|
||||
{
|
||||
cd docs\samples
|
||||
..\..\$(>:\\)
|
||||
}
|
||||
}
|
||||
|
||||
actions quietly ignore MakeDirAction
|
||||
|
@ -9,7 +9,12 @@
|
||||
# pragma cpp_extensions on // enable some extensions to include windows.h
|
||||
# endif
|
||||
|
||||
# include <windows.h>
|
||||
# ifdef _XBOX_VER
|
||||
# define NOD3D
|
||||
# include <xtl.h>
|
||||
# else
|
||||
# include <windows.h>
|
||||
# endif
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ sub gcctoolset
|
||||
}
|
||||
|
||||
$fast = (shift eq 'fast');
|
||||
@toolsets = ($^O =~ /MSWin/) ? (bcc, cw, dmc, ic8, ic9, ic9_x64, ic10, ic10_x64, ic11, ic11_x64, mingw34, mingw44, mingw45, mingw45_0x, mingw46_x64, msvc6, msvc7, msvc71, msvc8, msvc8_x64, msvc9, msvc9_x64, msvc10, msvc10_x64) : ($^O =~ /solaris/) ? (suncc, suncc_x64) : &gcctoolset();
|
||||
@toolsets = ($^O =~ /MSWin/) ? (bcc, cw, dmc, ic8, ic9, ic9_x64, ic10, ic10_x64, ic11, ic11_x64, mingw34, mingw44, mingw45, mingw45_0x, mingw46_x64, msvc6, msvc7, msvc71, msvc8, msvc8_x64, msvc9, msvc9_x64, msvc10, msvc10_x64, xbox360, ps3_gcc, ps3_snc) : ($^O =~ /solaris/) ? (suncc, suncc_x64) : &gcctoolset();
|
||||
@configurations = (debug, release);
|
||||
@defines = (PUGIXML_NO_XPATH, PUGIXML_NO_EXCEPTIONS, PUGIXML_NO_STL, PUGIXML_WCHAR_MODE);
|
||||
$stddefine = 'PUGIXML_STANDARD';
|
||||
|
@ -27,12 +27,16 @@ sub prettytoolset
|
||||
return "Microsoft Visual C++ $1.0" . prettysuffix($2) if ($toolset =~ /^msvc(\d+)(.*)$/);
|
||||
return "GNU C++ Compiler $1" . prettysuffix($2) if ($toolset =~ /^gcc([\d.]*)(.*)$/);
|
||||
|
||||
return "Microsoft Xbox360 Compiler" if ($toolset =~ /^xbox360/);
|
||||
return "Sony PlayStation3 GCC" if ($toolset =~ /^ps3_gcc/);
|
||||
return "Sony PlayStation3 SNC" if ($toolset =~ /^ps3_snc/);
|
||||
|
||||
$toolset;
|
||||
}
|
||||
|
||||
sub prettyplatform
|
||||
{
|
||||
my $platform = shift;
|
||||
my ($platform, $toolset) = @_;
|
||||
|
||||
return "solaris" if ($platform =~ /solaris/);
|
||||
|
||||
@ -44,6 +48,9 @@ sub prettyplatform
|
||||
return "fbsd64" if ($platform =~ /64-freebsd/);
|
||||
return "fbsd32" if ($platform =~ /86-freebsd/);
|
||||
|
||||
return "x360" if ($toolset =~ /^xbox360/);
|
||||
return "ps3" if ($toolset =~ /^ps3/);
|
||||
|
||||
return "win64" if ($platform =~ /MSWin32-x64/);
|
||||
return "win32" if ($platform =~ /MSWin32/);
|
||||
|
||||
@ -70,7 +77,7 @@ while (<>)
|
||||
{
|
||||
my ($platform, $toolset, $configuration, $defineset, $info) = ($1, $2, $3, $4, $5);
|
||||
|
||||
my $fulltool = &prettyplatform($platform) . ' ' . &prettytoolset($toolset);
|
||||
my $fulltool = &prettyplatform($platform, $toolset) . ' ' . &prettytoolset($toolset);
|
||||
my $fullconf = "$configuration $defineset";
|
||||
|
||||
if ($info =~ /^prepare/)
|
||||
|
@ -110,6 +110,15 @@ static bool run_test(test_runner* test)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__CELLOS_LV2__) && defined(PUGIXML_NO_EXCEPTIONS) && !defined(__SNC__)
|
||||
#include <stdlib.h>
|
||||
|
||||
void std::exception::_Raise() const
|
||||
{
|
||||
abort();
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifdef __BORLANDC__
|
||||
|
@ -19,6 +19,10 @@
|
||||
# include <io.h> // for unlink in C++0x mode
|
||||
#endif
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
# include <unistd.h> // for unlink
|
||||
#endif
|
||||
|
||||
TEST(document_create_empty)
|
||||
{
|
||||
pugi::xml_document doc;
|
||||
@ -253,6 +257,8 @@ TEST_XML(document_save_file, "<node/>")
|
||||
|
||||
int fd = mkstemp(path);
|
||||
CHECK(fd != -1);
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
const char* path = ""; // no temporary file support
|
||||
#else
|
||||
const char* path = tmpnam(0);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user