tests: Improved IntelC support, added more compilers to autotest, removed old autotest script
git-svn-id: http://pugixml.googlecode.com/svn/trunk@490 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
a248138ced
commit
a9d08d9923
43
Jamrules.jam
43
Jamrules.jam
@ -139,15 +139,47 @@ else if ( $(toolset:I=^msvc) )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( $(toolset) = "ic8" )
|
else if ( $(toolset:I=^ic) )
|
||||||
{
|
{
|
||||||
msvc = "msvc7" ;
|
if ( $(toolset) = ic8 || $(toolset) = ic9 )
|
||||||
|
{
|
||||||
|
msvc = "msvc71" ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msvc = "msvc8" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $(toolset) = ic11 )
|
||||||
|
{
|
||||||
|
postfix = "\\ia32" ;
|
||||||
|
CCFLAGS += /fp:precise ;
|
||||||
|
}
|
||||||
|
else if ( $(toolset) = ic11_x64 )
|
||||||
|
{
|
||||||
|
postfix = "\\intel64" ;
|
||||||
|
CCFLAGS += /fp:precise ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
postfix = "" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $(toolset:I=_x64$) )
|
||||||
|
{
|
||||||
|
msvc_postfix = "\\amd64" ;
|
||||||
|
LDFLAGS += /MACHINE:X64 ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msvc_postfix = "" ;
|
||||||
|
}
|
||||||
|
|
||||||
CCFLAGS += /D$(defines) ;
|
CCFLAGS += /D$(defines) ;
|
||||||
|
|
||||||
if ( $(configuration) = "debug" )
|
if ( $(configuration) = "debug" )
|
||||||
{
|
{
|
||||||
CCFLAGS += /D_DEBUG /MTd ;
|
CCFLAGS += /D_DEBUG /Od /MTd ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -161,7 +193,8 @@ else if ( $(toolset) = "ic8" )
|
|||||||
|
|
||||||
actions ObjectAction
|
actions ObjectAction
|
||||||
{
|
{
|
||||||
"%$(toolset)_PATH%\bin\icl.exe" /W4 /WX /Wport /Qwd981,444,280,383,909,304,167,171,177,1419 /I"%$(msvc)_PATH%\include" /I"%$(msvc)_PATH%\PlatformSDK\Include" /I"%$(toolset)_PATH%\include" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
|
set PATH=%$(msvc)_PATH%\bin
|
||||||
|
"%$(toolset)_PATH%\bin$(postfix)\icl.exe" /W3 /WX /Qvec_report0 /I"%$(msvc)_PATH%\include" /I"%$(msvc)_PATH%\PlatformSDK\Include" /I"%$(toolset)_PATH%\include" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
actions LibraryAction
|
actions LibraryAction
|
||||||
@ -171,7 +204,7 @@ else if ( $(toolset) = "ic8" )
|
|||||||
|
|
||||||
actions LinkAction
|
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)
|
"%$(msvc)_PATH%\bin\link.exe" /SUBSYSTEM:CONSOLE /NOLOGO /OUT:$(<) $(>) /LIBPATH:"%$(toolset)_PATH%\lib$(postfix)" /LIBPATH:"%$(msvc)_PATH%\lib$(msvc_postfix)" /LIBPATH:"%$(msvc)_PATH%\PlatformSDK\lib$(msvc_postfix)" $(LDFLAGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
actions CoverageAction
|
actions CoverageAction
|
||||||
|
|||||||
@ -24,7 +24,7 @@ sub gcctoolset
|
|||||||
}
|
}
|
||||||
|
|
||||||
$fast = (shift eq 'fast');
|
$fast = (shift eq 'fast');
|
||||||
@toolsets = ($^O =~ /MSWin/) ? (bcc, cw, dmc, ic8, mingw34, mingw44, mingw45, msvc6, msvc7, msvc71, msvc8, msvc8_x64, msvc9, msvc9_x64, msvc10, msvc10_x64) : ($^O =~ /solaris/) ? (suncc) : (&gcctoolset());
|
@toolsets = ($^O =~ /MSWin/) ? (bcc, cw, dmc, ic8, ic9, ic9_x64, ic10, ic10_x64, ic11, ic11_x64, mingw34, mingw44, mingw45, mingw46_x64, msvc6, msvc7, msvc71, msvc8, msvc8_x64, msvc9, msvc9_x64, msvc10, msvc10_x64) : ($^O =~ /solaris/) ? (suncc) : (&gcctoolset());
|
||||||
@configurations = (debug, release);
|
@configurations = (debug, release);
|
||||||
@defines = (PUGIXML_NO_XPATH, PUGIXML_NO_EXCEPTIONS, PUGIXML_NO_STL, PUGIXML_WCHAR_MODE);
|
@defines = (PUGIXML_NO_XPATH, PUGIXML_NO_EXCEPTIONS, PUGIXML_NO_STL, PUGIXML_WCHAR_MODE);
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,9 @@ sub prettytoolset
|
|||||||
return "Sun C++ 5.10" if ($toolset eq 'suncc');
|
return "Sun C++ 5.10" if ($toolset eq 'suncc');
|
||||||
|
|
||||||
return "Intel C++ Compiler $1.0" if ($toolset =~ /^ic(\d+)$/);
|
return "Intel C++ Compiler $1.0" if ($toolset =~ /^ic(\d+)$/);
|
||||||
return "MinGW32 (GCC $1.$2)" if ($toolset =~ /^mingw(\d)(\d)$/);
|
return "Intel C++ Compiler $1.0 x64" if ($toolset =~ /^ic(\d+)_x64$/);
|
||||||
|
return "MinGW (GCC $1.$2)" if ($toolset =~ /^mingw(\d)(\d)$/);
|
||||||
|
return "MinGW (GCC $1.$2) x64" if ($toolset =~ /^mingw(\d)(\d)_x64$/);
|
||||||
return "Microsoft Visual C++ 7.1" if ($toolset eq 'msvc71');
|
return "Microsoft Visual C++ 7.1" if ($toolset eq 'msvc71');
|
||||||
return "Microsoft Visual C++ $1.0" if ($toolset =~ /^msvc(\d+)$/);
|
return "Microsoft Visual C++ $1.0" if ($toolset =~ /^msvc(\d+)$/);
|
||||||
return "Microsoft Visual C++ $1.0 x64" if ($toolset =~ /^msvc(\d+)_x64$/);
|
return "Microsoft Visual C++ $1.0 x64" if ($toolset =~ /^msvc(\d+)_x64$/);
|
||||||
|
|||||||
@ -1,141 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
|
|
||||||
sub permute
|
|
||||||
{
|
|
||||||
my @defines = @_;
|
|
||||||
my @result = ('');
|
|
||||||
|
|
||||||
foreach $define (@defines)
|
|
||||||
{
|
|
||||||
push @result, map { length($_) == 0 ? $define : "$_,$define" } @result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@result;
|
|
||||||
}
|
|
||||||
|
|
||||||
$fast = (shift eq 'fast');
|
|
||||||
@toolsets = ($^O =~ /win/i) ? (bcc, cw, dmc, ic8, mingw34, mingw44, mingw45, msvc6, msvc7, msvc71, msvc8, msvc8_x64, msvc9, msvc9_x64, msvc10, msvc10_x64) : (gcc);
|
|
||||||
@configurations = (debug, release);
|
|
||||||
@defines = (PUGIXML_NO_XPATH, PUGIXML_NO_EXCEPTIONS, PUGIXML_NO_STL, PUGIXML_WCHAR_MODE);
|
|
||||||
@definesabbr = (noxpath, noexcept, nostl, wchar);
|
|
||||||
|
|
||||||
if ($fast)
|
|
||||||
{
|
|
||||||
@defines = (PUGIXML_WCHAR_MODE);
|
|
||||||
@definesabbr = (wchar);
|
|
||||||
}
|
|
||||||
|
|
||||||
@definesets = permute(@defines);
|
|
||||||
|
|
||||||
$fail = 0;
|
|
||||||
|
|
||||||
system("echo ### autotest begin >autotest.log");
|
|
||||||
|
|
||||||
%results = ();
|
|
||||||
|
|
||||||
foreach $toolset (@toolsets)
|
|
||||||
{
|
|
||||||
foreach $configuration (@configurations)
|
|
||||||
{
|
|
||||||
foreach $defineset (@definesets)
|
|
||||||
{
|
|
||||||
$defineabbr = $defineset;
|
|
||||||
$defineabbr =~ s/,/ /g;
|
|
||||||
|
|
||||||
for ($i = 0; $i < $#definesabbr + 1; ++$i)
|
|
||||||
{
|
|
||||||
$defineabbr =~ s/$defines[$i]/$definesabbr[$i]/;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($defineabbr !~ /noxpath/ && $defineabbr =~ /noexcept/) { next; }
|
|
||||||
if ($defineabbr !~ /noxpath/ && $defineabbr =~ /nostl/) { next; }
|
|
||||||
|
|
||||||
print "*** testing $toolset/$configuration ($defineabbr) ... ***\n";
|
|
||||||
|
|
||||||
my $cmdline = "jam toolset=$toolset configuration=$configuration defines=$defineset";
|
|
||||||
my $coverage_pugixml = 0;
|
|
||||||
my $coverage_pugixpath = 0;
|
|
||||||
|
|
||||||
system("echo ^# $cmdline run_tests >>autotest.log");
|
|
||||||
$result = system("$cmdline run_tests >>autotest.log");
|
|
||||||
|
|
||||||
# get coverage
|
|
||||||
if ($result == 0 && $toolset =~ /mingw|gcc/)
|
|
||||||
{
|
|
||||||
$coverage = `$cmdline coverage`;
|
|
||||||
|
|
||||||
$coverage_pugixml = $1 if ($coverage =~ /pugixml\.cpp' executed:([^%]+)%/);
|
|
||||||
$coverage_pugixpath = $1 if ($coverage =~ /pugixpath\.cpp' executed:([^%]+)%/);
|
|
||||||
}
|
|
||||||
|
|
||||||
# record failures
|
|
||||||
$fail = 1 if ($result != 0);
|
|
||||||
|
|
||||||
# print build report
|
|
||||||
my $report = "";
|
|
||||||
|
|
||||||
if ($result == 0)
|
|
||||||
{
|
|
||||||
my $align = ($coverage_pugixml > 0 || $coverage_pugixpath > 0) ? 'left' : 'center';
|
|
||||||
|
|
||||||
$report .= "<td bgcolor='#00ff00' align='$align'>passed";
|
|
||||||
|
|
||||||
if ($coverage_pugixml > 0 || $coverage_pugixpath > 0)
|
|
||||||
{
|
|
||||||
$report .= " <font size='-2'>$coverage_pugixml% / $coverage_pugixpath%</font>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$report .= "</td>"
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$report .= "<td bgcolor='#ff0000' align='center'>failed</td>"
|
|
||||||
}
|
|
||||||
|
|
||||||
$results{"$configuration $defineabbr"}{$toolset} = $report;
|
|
||||||
}
|
|
||||||
|
|
||||||
last if ($fast);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
system("echo ### autotest end >>autotest.log");
|
|
||||||
|
|
||||||
$date = scalar localtime;
|
|
||||||
|
|
||||||
$report = <<END;
|
|
||||||
<html><head><title>pugixml autotest report</title></head><body>
|
|
||||||
<h3>pugixml autotest report</h3>
|
|
||||||
<table border=0 cellspacing=0 cellpadding=4>
|
|
||||||
<tr><td></td>
|
|
||||||
END
|
|
||||||
|
|
||||||
foreach $toolset (@toolsets)
|
|
||||||
{
|
|
||||||
$report .= "<th>$toolset</th>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$report .= "</tr>\n";
|
|
||||||
|
|
||||||
foreach $k (sort {$a cmp $b} keys %results)
|
|
||||||
{
|
|
||||||
$report .= "<tr><td>$k</td>";
|
|
||||||
|
|
||||||
foreach $toolset (@toolsets)
|
|
||||||
{
|
|
||||||
$report .= $results{$k}{$toolset};
|
|
||||||
}
|
|
||||||
|
|
||||||
$report .= "</tr>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$report .= <<END;
|
|
||||||
</table><br>
|
|
||||||
Generated on $date
|
|
||||||
</body></html>
|
|
||||||
END
|
|
||||||
|
|
||||||
open FILE, ">autotest.html";
|
|
||||||
print FILE $report;
|
|
||||||
close FILE;
|
|
||||||
@ -12,6 +12,9 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __INTEL_COMPILER
|
||||||
|
# pragma warning(disable: 1478)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
|
#define _SCL_SECURE_NO_WARNINGS
|
||||||
|
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
|
|
||||||
@ -541,7 +542,7 @@ struct test_walker: xml_tree_walker
|
|||||||
|
|
||||||
#ifdef PUGIXML_WCHAR_MODE
|
#ifdef PUGIXML_WCHAR_MODE
|
||||||
wchar_t wbuf[32];
|
wchar_t wbuf[32];
|
||||||
std::copy(buf, buf + strlen(buf) + 1, wbuf);
|
std::copy(buf, buf + strlen(buf) + 1, &wbuf[0]);
|
||||||
|
|
||||||
return std::basic_string<pugi::char_t>(wbuf);
|
return std::basic_string<pugi::char_t>(wbuf);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user