Skip to content

Commit

Permalink
update r690
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Sep 7, 2014
1 parent e257fe7 commit 2b6ccde
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 16 deletions.
2 changes: 1 addition & 1 deletion doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = iutest
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.10.0.1
PROJECT_NUMBER = 1.10.0.2

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion include/iutest_assertion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ inline AssertionResult EqFailure(const char* expected_expression, const char* ac
<< "\n Actual: " << FormatForComparisonFailureMessage(val1, val2) \
<< " vs " << FormatForComparisonFailureMessage(val2, val1); \
} \
} \
}

#if !defined(IUTEST_NO_FUNCTION_TEMPLATE_ORDERING)

Expand Down
4 changes: 2 additions & 2 deletions include/iutest_package.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
iuTest_GetTestCasePackageName(const iuTest_TestCasePackage*) { \
return iuTest_GetTestCaseParentPackageName( \
static_cast<iuTest_TestCaseParentPackage*>(NULL)) + #name "."; \
} \
}

#define IIUT_PACKAGE_DECL_PARENT_NAME_FUNC(name) \
static ::std::string IUTEST_ATTRIBUTE_UNUSED_ \
iuTest_GetTestCaseParentPackageName(const iuTest_TestCaseParentPackage*) { \
return iuTest_GetTestCasePackageName(static_cast<iuTest_TestCasePackage*>(NULL)); \
} \
}


#if IUTEST_HAS_IF_EXISTS
Expand Down
4 changes: 2 additions & 2 deletions include/iutest_ver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

//======================================================================
// define
#define IUTEST_VER 0x01100001u //!< iutest version 1.10.0.1
#define IUTEST_VER 0x01100002u //!< iutest version 1.10.0.2
#define IUTEST_MAJORVER 0x01u //!< Major Version
#define IUTEST_MINORVER 0x10u //!< Minor Version
#define IUTEST_BUILD 0x00u //!< Build
#define IUTEST_REVISION 0x01u //!< Revision
#define IUTEST_REVISION 0x02u //!< Revision

/**
* @mainpage
Expand Down
2 changes: 1 addition & 1 deletion include/tr1/iutest_failurecount_assertion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

#define IUTEST_TEST_FAILURECOUNT_LT(statements, count, statements_str, on_failure) \
IUTEST_AMBIGUOUS_ELSE_BLOCKER_ \
if( ::iutest::AssertionResult statemnets_ar = ::iutest::AssertionSuccess() ) {\
if( ::iutest::AssertionResult statemnets_ar = ::iutest::AssertionSuccess() ) { \
::iutest::detail::StatementsFailureCount statement_failure_checker; \
IIUT_STATEMENTS_EXECUTER(statements); \
::iutest::AssertionResult ar = statement_failure_checker.GetResult(count, statements_str); \
Expand Down
2 changes: 1 addition & 1 deletion include/tr1/iutest_value_tmp_tests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*/
#define IIUT_VALUETMP_TEST_(testcase_, testname_) \
template<iutest::BiggestInt iutest_ValueParam> \
class IUTEST_TEST_CLASS_NAME_(testcase_, testname_) : public testcase_<iutest_ValueParam> { \
class IUTEST_TEST_CLASS_NAME_(testcase_, testname_) : public testcase_<iutest_ValueParam> { \
typedef testcase_<iutest_ValueParam> TestFixture; \
static const iutest::BiggestInt ValueParam = iutest_ValueParam; \
protected: virtual void Body(void); \
Expand Down
56 changes: 48 additions & 8 deletions tools/fuse/fuse_iutest_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@
IUTEST_INCLUDE_DIR = os.path.join(os.path.dirname(__file__), '../../include')
INCLUDE_REGEX = re.compile(r'^\s*#\s*include\s*"(.*iutest.*)"')
IFDEF_REGEX = re.compile(r'^\s*#\s*if\s*defined\s*\(.*\)')
COMMENT_REGEX = re.compile(r'^\s*//.*')
C_COMMENT_BEGIN_REGEX = re.compile(r'^\s*(.*)/\*.*')
C_COMMENT_END_REGEX = re.compile(r'^\s*\*/(.*)')
STRING_REGEX = re.compile(r'.*".*?".*')
EMPTYLINE_REGEX = re.compile(r'^\s*$')

def Fuse(root, filename, output_dir):
output_file = codecs.open(os.path.join(output_dir, filename), 'w', 'utf-8-sig')
def Fuse(root, filename, output, output_dir, minimum):
output_file = codecs.open(os.path.join(output_dir, output), 'w', 'utf-8-sig')
processed_files = sets.Set();
def ProcessFile(curr, filename, fileset):
def ProcessFile(curr, filename, fileset, minimum):
path = os.path.join(root, filename)
if not os.path.exists(path):
path = os.path.join(curr, filename)
Expand All @@ -35,25 +40,60 @@ def ProcessFile(curr, filename, fileset):
return

find_ifdef = False;
c_comment = False;
fileset.add(path)
for line in codecs.open(path, 'r', 'utf-8-sig'):
line = re.sub('/\*.*?\*/', '', line)
m = INCLUDE_REGEX.match(line)
if m:
if find_ifdef:
s = sets.Set()
s.add(path)
ProcessFile(os.path.dirname(path), m.group(1), s)
ProcessFile(os.path.dirname(path), m.group(1), s, minimum)
else:
ProcessFile(os.path.dirname(path), m.group(1), fileset)
ProcessFile(os.path.dirname(path), m.group(1), fileset, minimum)
else:
m = IFDEF_REGEX.match(line)
find_ifdef = bool(m)
output_file.write(line)
ProcessFile(root, filename, processed_files)
if minimum:
if c_comment:
m = C_COMMENT_END_REGEX.match(line)
if m:
c_comment = False
if not EMPTYLINE_REGEX.match(m.group(1)):
output_file.write(m.group(1))
else:
m = C_COMMENT_BEGIN_REGEX.match(line)
if m:
c_comment = True
if not EMPTYLINE_REGEX.match(m.group(1)):
output_file.write(m.group(1))
elif not EMPTYLINE_REGEX.match(line):
if not COMMENT_REGEX.match(line):
line = re.sub('//[\S \t]*', '', line)
line = line.strip(' \t')
line = line.rstrip() + '\r\n'
line = re.sub('^\s*#\s*', '#', line)
line = re.sub('^\s*#(.+?)[ \t]+', '#\\1 ', line)
line = re.sub('\s+(".*?")', ' \\1', line)
if not STRING_REGEX.match(line):
line = re.sub('[ \t]+', ' ', line)
line = re.sub('\s+([&|\+\-<>]+)[ \t]+', '\\1', line)
line = re.sub('\s*([{\+\-\*/%=<>&|]+=)[ \t]*', '\\1', line)
#line = re.sub('\w\s*([{\+\-\*/%=<>&|!]+)[ \t]*', '\\1', line)
line = re.sub('\s*,[ \t]*', ',', line)
line = re.sub('\s*\)', ')', line)
line = re.sub('\)\s+{', '){', line)
line = re.sub('\s*\([ \t]*', '(', line)
output_file.write(line)
else:
output_file.write(line)
ProcessFile(root, filename, processed_files, minimum)
output_file.close()

def FuseAll(root, output_dir):
Fuse(root, 'iutest.hpp', output_dir)
Fuse(root, 'iutest.hpp', 'iutest.hpp', output_dir, False)
Fuse(root, 'iutest.hpp', 'iutest.min.hpp', output_dir, True)

def main():
argc = len(sys.argv)
Expand Down

0 comments on commit 2b6ccde

Please sign in to comment.