diff --git a/README.md b/README.md index 3378f8f8da..b460a48417 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/doc/Doxyfile b/doc/Doxyfile index c59644c697..400b5630d9 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -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 diff --git a/include/internal/iutest_internal.hpp b/include/internal/iutest_internal.hpp index da594cdbbf..470246583d 100644 --- a/include/internal/iutest_internal.hpp +++ b/include/internal/iutest_internal.hpp @@ -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_) \ diff --git a/include/internal/iutest_option_message.hpp b/include/internal/iutest_option_message.hpp index 5f374ff4c1..7262c81033 100644 --- a/include/internal/iutest_option_message.hpp +++ b/include/internal/iutest_option_message.hpp @@ -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); diff --git a/include/iutest_config.hpp b/include/iutest_config.hpp index 530b620e51..07d113cdbb 100644 --- a/include/iutest_config.hpp +++ b/include/iutest_config.hpp @@ -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 diff --git a/include/iutest_ver.hpp b/include/iutest_ver.hpp index 31c377631d..8c1ea51f0b 100644 --- a/include/iutest_ver.hpp +++ b/include/iutest_ver.hpp @@ -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 diff --git a/test/benchmark/GNUmakefile b/test/benchmark/GNUmakefile index a47e36890a..27f168b4c2 100644 --- a/test/benchmark/GNUmakefile +++ b/test/benchmark/GNUmakefile @@ -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 diff --git a/test/iutest_param_test_tests1.cpp b/test/iutest_param_test_tests1.cpp index a6e0314353..3f4694d3fe 100644 --- a/test/iutest_param_test_tests1.cpp +++ b/test/iutest_param_test_tests1.cpp @@ -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 */ diff --git a/test/iutest_param_test_tests2.cpp b/test/iutest_param_test_tests2.cpp index 98eb69869e..cf71dd3896 100644 --- a/test/iutest_param_test_tests2.cpp +++ b/test/iutest_param_test_tests2.cpp @@ -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 */ @@ -36,6 +36,18 @@ IUTEST_P(TupleGetTest, Test) IUTEST_INSTANTIATE_TEST_CASE_P(A, TupleGetTest , ::iutest::Values( ::iutest::tuples::tuple(true, 10) ) ); +#if !defined(IUTEST_USE_GTEST) + +class TypeConversionParamTest : public ::iutest::TestWithParam {}; + +IUTEST_P(TypeConversionParamTest, Test) +{ +} + +IUTEST_INSTANTIATE_TEST_CASE_P(My1, TypeConversionParamTest, ::iutest::Values(4)); + +#endif + #endif #endif diff --git a/tools/twilio/Makefile b/tools/twilio/Makefile index f297abe0aa..cf5ab4b11b 100644 --- a/tools/twilio/Makefile +++ b/tools/twilio/Makefile @@ -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 diff --git a/tools/twilio/iutwilio.py b/tools/twilio/iutwilio.py index 989ea1450f..6baf574e42 100644 --- a/tools/twilio/iutwilio.py +++ b/tools/twilio/iutwilio.py @@ -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' @@ -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.' @@ -137,7 +141,8 @@ 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, @@ -145,6 +150,60 @@ def call(client, options): 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): @@ -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 @@ -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) # # @@ -178,7 +243,7 @@ def main(): setup(options) parse_ini(options.ini) if options.dump: - dump() + dump(options) else: run(options)