Skip to content

Commit

Permalink
update r856
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed May 25, 2015
1 parent d19f3a2 commit 0db291e
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ License
Copyright (c) 2011-2015, Takazumi Shirayanagi,
All rights reserved.

This software is released under the new(3-clause) BSD License, see LICENSE
This software is released under the [new(3-clause) BSD License](http://opensource.org/licenses/BSD-3-Clause), see LICENSE


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.11.99.16
PROJECT_NUMBER = 1.11.99.17

# 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
10 changes: 7 additions & 3 deletions include/internal/iutest_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,13 @@
#define IIUT_CHECK_TESTFIXTURE(testfixture_) IIUT_CHECK_TESTFIXTURE_(IIUT_TO_VARNAME_(testfixture_))

#if !defined(IUTEST_TEST_STRICT_)
#define IUTEST_TEST_STRICT_(testcase_, testname_, parent_class_, type_id_) \
IIUT_CHECK_TESTFIXTURE(testcase_) \
IUTEST_TEST_(testcase_, testname_, parent_class_, type_id_)
#if IUTEST_CHECK_STRICT
# define IUTEST_TEST_STRICT_(testcase_, testname_, parent_class_, type_id_) \
IIUT_CHECK_TESTFIXTURE(testcase_) \
IUTEST_TEST_(testcase_, testname_, parent_class_, type_id_)
#else
# define IUTEST_TEST_STRICT_ IUTEST_TEST_
#endif
#endif

#define IUTEST_TEST_F_(testfixture_, testname_) IUTEST_TEST_(testfixture_, testname_, IIUT_TO_VARNAME_(testfixture_) \
Expand Down
1 change: 1 addition & 0 deletions include/internal/iutest_option_message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ inline void iuOptionMessage::ShowFeature(void)
SHOW_MACRO(IUTEST_HAS_VARIADIC_COMBINE);
SHOW_MACRO(IUTEST_HAS_VARIADIC_PAIRWISE);
SHOW_MACRO(IUTEST_HAS_VARIADIC_VALUES);
SHOW_MACRO(IUTEST_CHECK_STRICT);
SHOW_MACRO(IUTEST_PLATFORM);
SHOW_MACRO(IUTEST_REPORT_SKIPPED);
SHOW_MACRO(IUTEST_USE_THROW_ON_ASSERTION_FAILURE);
Expand Down
5 changes: 5 additions & 0 deletions include/iutest_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@
* @{
*/

//! テストのチェック機能の有無
#if !defined(IUTEST_CHECK_STRICT)
# define IUTEST_CHECK_STRICT 1
#endif

#if !defined(IUTEST_HAS_MINIDUMP)
//! MiniDump 出力が有効かどうか
# if defined(_MSC_VER) && _MSC_VER >= 1310
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 0x01119916u //!< iutest version 1.11.99.16
#define IUTEST_VER 0x01119917u //!< iutest version 1.11.99.17
#define IUTEST_MAJORVER 0x01u //!< Major Version
#define IUTEST_MINORVER 0x11u //!< Minor Version
#define IUTEST_BUILD 0x99u //!< Build
#define IUTEST_REVISION 0x16u //!< Revision
#define IUTEST_REVISION 0x17u //!< Revision

/**
* @mainpage
Expand Down
4 changes: 4 additions & 0 deletions test/benchmark/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ CXXFLAGS += -Werror=undef
LIBS_ = $(LIBS:%=-l%)
LDFLAGS += $(LIBS_)

ifdef NO_CHECK_STRICT
CXXFLAGS += -DIUTEST_CHECK_STRICT=0
endif

ifdef USE_LIB
CXXFLAGS += -DIUTEST_USE_LIB=1 -L../../lib
LDFLAGS += -liutest
Expand Down
2 changes: 1 addition & 1 deletion test/iutest_param_test_tests1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2012-2014, Takazumi Shirayanagi\n
* Copyright (C) 2012-2015, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
Expand Down
14 changes: 13 additions & 1 deletion test/iutest_param_test_tests2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2012-2014, Takazumi Shirayanagi\n
* Copyright (C) 2012-2015, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
Expand Down Expand Up @@ -36,6 +36,18 @@ IUTEST_P(TupleGetTest, Test)
IUTEST_INSTANTIATE_TEST_CASE_P(A, TupleGetTest
, ::iutest::Values( ::iutest::tuples::tuple<bool, int>(true, 10) ) );

#if !defined(IUTEST_USE_GTEST)

class TypeConversionParamTest : public ::iutest::TestWithParam<double> {};

IUTEST_P(TypeConversionParamTest, Test)
{
}

IUTEST_INSTANTIATE_TEST_CASE_P(My1, TypeConversionParamTest, ::iutest::Values(4));

#endif

#endif

#endif
Expand Down
8 changes: 8 additions & 0 deletions tools/twilio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ exec_sample: sample
- ./sample --iutest_output=xml:result.xml

dryrun: exec_sample
ifdef SMS
./iutwilio.py result.xml --dryrun --sms ${CALL_NUMBER}
else
./iutwilio.py result.xml --dryrun --call ${CALL_NUMBER}
endif

run: exec_sample
ifdef SMS
./iutwilio.py result.xml --sms ${CALL_NUMBER}
else
./iutwilio.py result.xml --call ${CALL_NUMBER}
endif

setup:
#pip install twilio
Expand Down
75 changes: 70 additions & 5 deletions tools/twilio/iutwilio.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def parse_command_line():
'-v'
, '--version'
, action='version'
, version=u'%(prog)s version 0.1'
, version=u'%(prog)s version 0.2'
)
parser.add_argument(
'--ini'
Expand All @@ -37,6 +37,10 @@ def parse_command_line():
'--call'
, help = 'call to number.'
)
parser.add_argument(
'--sms'
, help = 'send message number.'
)
parser.add_argument(
'--account_sid'
, help = 'account sid.'
Expand Down Expand Up @@ -137,14 +141,69 @@ def make_twilio():
# call twilio
def call(client, options):
if options.dryrun:
print 'twilio call to ' + options.call + ' from ' + my_number
print 'twilio call to ' + options.call
print body
else:
call = client.calls.create(url=options.url,
to=options.call,
from_=my_number)
print call.sid


#
# make_message
def make_message(options):
body = ""
filepath = options.xml
if filepath and os.path.exists(filepath):
tree = ET.parse(filepath)
root = tree.getroot()
tests = int(root.get('tests'))
testcases = len(root.findall('testsuite'))
failures = int(root.get('failures'))
disabled = int(root.get('disabled'))
skipped = int(root.get('skip'))
passed = tests - failures - skipped
time = root.get('time')
timestamp = root.get('timestamp')

if timestamp:
body += "%s\n" % (timestamp)

body += "%d tests from %s testcase ran. (%sms total)\n" % (tests, testcases, time)
body += "[ PASSED ] %d\n" % (passed)
if disabled:
body += "[ DISABLED ] %d\n" % (disabled)
if skipped:
body += "[ SKIPPED ] %d\n" % (skipped)
body += "[ FAILED ] %d\n" % (failures)
failure_testsuites = root.findall('testsuite')
for suite in failure_testsuites:
if int(suite.get('failures')):
for test in suite:
if test.find('.//failure') != None:
name = "%s.%s\n" % ( suite.get('name'), test.get('name') )
if len(body) + len(name) < 155:
body += name;
else:
body += "..."
return body
return body


#
# message
def message(client, options):
m = make_message(options)
if options.dryrun:
print 'twilio call to ' + options.sms
print m
else:
call = client.messages.create(body=m,
to=options.sms,
from_=my_number)
print call.sid

#
# run
def run(options):
Expand All @@ -154,7 +213,9 @@ def run(options):
sys.exit(1)
else:
if parse_xml(filepath) > 0:
if options.call:
if options.sms:
message(make_twilio(), options)
elif options.call:
call(make_twilio(), options)
else:
print 'was failed ' + filepath
Expand All @@ -166,10 +227,14 @@ def run(options):

#
# dump
def dump():
def dump(options):
print 'account_sid: %s' % (account_sid)
print 'auth_token : %s' % (auth_token)
print 'my_number : %s' % (my_number)
if options.call:
print 'call : %s' % (options.call)
if options.sms:
print 'sms : %s' % (options.sms)

#
#
Expand All @@ -178,7 +243,7 @@ def main():
setup(options)
parse_ini(options.ini)
if options.dump:
dump()
dump(options)
else:
run(options)

Expand Down

0 comments on commit 0db291e

Please sign in to comment.