Skip to content

Commit

Permalink
Merge pull request boostorg#471 from boostorg/develop
Browse files Browse the repository at this point in the history
Pre Boost 1.70 merge
  • Loading branch information
Kojoley authored Feb 25, 2019
2 parents d59dc01 + 83d77ff commit 3cafb2b
Show file tree
Hide file tree
Showing 192 changed files with 1,271 additions and 1,101 deletions.
18 changes: 10 additions & 8 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ clone_depth: 50
environment:
global:
PROJECT: libs\spirit
TEST_LINK_DEPS: date_time,filesystem,regex,system,thread
TEST_LINK_DEPS: date_time,filesystem,regex,thread
APPVEYOR_SAVE_CACHE_ON_ERROR: true
CLCACHE_HARDLINK: 1
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma2 -mx=3 -md=32m -ms=on"
Expand All @@ -16,7 +16,6 @@ environment:
- { APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015', ADDRMDL: 64, TOOLSET: 'msvc-12.0' }
- { APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015', ADDRMDL: 32, TOOLSET: 'msvc-11.0' }
- { APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015', ADDRMDL: 32, TOOLSET: 'msvc-10.0' }
- { APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015', ADDRMDL: 32, TOOLSET: 'msvc-9.0' }

cache:
- '%USERPROFILE%\clcache'
Expand All @@ -35,7 +34,7 @@ before_build:
# Creating %USERPROFILE%/user-config.jam file
@'
import feature os regex toolset ;
import feature os regex toolset pch ;
# clcache
local toolset = [ regex.split [ os.environ TOOLSET ] "-" ] ;
Expand All @@ -53,6 +52,9 @@ before_build:
-wd4459 # declaration of 'varname' hides global declaration
: unchecked ;
# A subfeature that tells Spirit tests to use PCH
feature.subfeature pch on : version : spirit : optional propagated incidental ;
'@ | sc "$env:USERPROFILE/user-config.jam"
- set BRANCH=%APPVEYOR_REPO_BRANCH%
Expand All @@ -67,8 +69,8 @@ before_build:
- ps: |
$git = Get-Command git | Select-Object -ExpandProperty Definition
$git = Split-Path -Parent $git | Split-Path -Parent
$git = [io.path]::combine($git, 'mingw64', 'bin', 'git.exe')
(Get-Content -Raw $git).Replace("--depth=1","--depth=9") | Set-Content $git
Get-ChildItem -Path "$git\mingw64\*" -Include *.exe -Recurse |
ForEach-Object -Process {(Get-Content -Raw $_).Replace("--depth=1","--depth=9") | Set-Content $_}
# Checkout Boost
- git clone -j10 --branch=%BRANCH% --depth=1 --quiet
Expand Down Expand Up @@ -107,6 +109,6 @@ build_script:
test_script:
- set B2_ARGS=%B2_ARGS% warnings=on known-warnings=suppress warnings-as-errors=on
- echo B2 argumets %B2_ARGS%
- b2 %B2_ARGS% %PROJECT%\classic\test
- b2 %B2_ARGS% %PROJECT%\repository\test
- b2 %B2_ARGS% %PROJECT%\test
- b2 %B2_ARGS% pch=on-spirit %PROJECT%\classic\test
- b2 %B2_ARGS% pch=on-spirit %PROJECT%\repository\test
- b2 %B2_ARGS% pch=on-spirit %PROJECT%\test
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ env:
- PROJECT=libs/spirit
- BOOST_ROOT=$HOME/boost
- BOOST_BUILD_PATH=$HOME/build-boost
- TEST_LINK_DEPS=date_time,filesystem,regex,system,thread
- TEST_LINK_DEPS=date_time,filesystem,regex,thread

matrix:
include:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ executable.

The newest Spirit shines faster compile times. Currently only a parser framework.

Requires C++14 compiler (GCC 5, Clang 3.5, VS 2015 Update 3).
Requires C++14 compiler (GCC 5, Clang 3.6, VS 2015 Update 3).

### Spirit V2 (2nd generation)

Expand Down
51 changes: 30 additions & 21 deletions classic/test/Jamfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#==============================================================================
# Copyright (c) 2002 Joel de Guzman
# Copyright (c) 2003-2004 Martin Wille
# Copyright (c) 2019 Nikita Kniazev
# http://spirit.sourceforge.net/
#
# Use, modification and distribution is subject to the Boost Software
Expand All @@ -12,22 +13,30 @@
# Joel de Guzman [Sept 27, 2002]
#

project spirit-classic
: requirements
<include>.
;

###############################################################################

# VP, 2005/04/14: Inside boost, we inherit proper <include>
# from Jamroot.
# Not sure about standalone Spirit.
# SPIRIT_HEADER_INCLUDE ?= ../../.. ;
# spirit-header-include = <include>$(SPIRIT_HEADER_INCLUDE) ;
cpp-pch pch : pch.hpp : : : <include>. <toolset>msvc:<cxxflags>"/FIpch.hpp" ;
cpp-pch pch-dbg : pch.hpp : <define>BOOST_SPIRIT_DEBUG :
: <include>. <toolset>msvc:<cxxflags>"/FIpch.hpp" ;

explicit pch pch-dbg ;

###############################################################################

rule spirit-run ( sources + : args * : input-files * : requirements * : name ? : default-build * )
{
name ?= $(sources[1]:D=:S=) ;
return
[ run $(sources) : $(args) : $(input-files) : $(requirements) : $(name)
[ run $(sources) : $(args) : $(input-files) : $(requirements)
<pch>on-spirit:<source>pch : $(name)
: $(default-build) ]
[ run $(sources) : $(args) : $(input-files) : $(requirements)
<define>BOOST_SPIRIT_DEBUG=1 : $(name)_debug
<pch>on-spirit:<source>pch-dbg <define>BOOST_SPIRIT_DEBUG : $(name)_debug
: $(default-build) ]
;
}
Expand All @@ -44,7 +53,7 @@ local opt-metrowerks = <toolset>cw:<optimization>speed ;
# VP, 2005/04/14: MT is not available with Como, but this is
# not handled yet.
local multi-threading = <library>/boost/thread//boost_thread
<threading>multi <define>BOOST_ALL_NO_LIB=1 ;
<threading>multi <define>BOOST_ALL_NO_LIB ;

test-suite "spirit.classic.core.kernel"
: [ spirit-run match_tests.cpp ]
Expand All @@ -53,7 +62,7 @@ local multi-threading = <library>/boost/thread//boost_thread

test-suite "spirit.classic.core.scanner"
: [ spirit-run scanner_tests.cpp ]
[ spirit-run scanner_value_type_tests.cpp ]
[ spirit-run scanner_value_type_tests.cpp : : : <pch>off ]
;

test-suite "spirit.classic.core.primitive"
Expand All @@ -73,9 +82,9 @@ local multi-threading = <library>/boost/thread//boost_thread
;

test-suite "spirit.classic.core.non_terminal"
: [ spirit-run rule_tests.cpp ]
[ spirit-run owi_st_tests.cpp ]
[ spirit-run grammar_tests.cpp : : : $(opt-metrowerks) ]
: [ spirit-run rule_tests.cpp : : : <pch>off ]
[ spirit-run owi_st_tests.cpp : : : <undef>BOOST_SPIRIT_THREADSAFE ]
[ spirit-run grammar_tests.cpp : : : <pch>off $(opt-metrowerks) ]
[ spirit-run grammar_multi_instance_tst.cpp : : : $(opt-metrowerks) ]
[ spirit-run subrule_tests.cpp ]
[ run owi_mt_tests.cpp : : : $(multi-threading) ]
Expand All @@ -87,7 +96,7 @@ local multi-threading = <library>/boost/thread//boost_thread
test-suite "spirit.classic.meta"
: [ spirit-run fundamental_tests.cpp ]
[ spirit-run parser_traits_tests.cpp ]
[ spirit-run traverse_tests.cpp : : : <toolset>intel:<debug-symbols>off ]
[ spirit-run traverse_tests.cpp : : : <pch>off <toolset>intel:<debug-symbols>off ]
;

test-suite "spirit.classic.attribute"
Expand Down Expand Up @@ -120,20 +129,20 @@ local multi-threading = <library>/boost/thread//boost_thread
[ spirit-run for_tests.cpp ]
[ spirit-run while_tests.cpp ]
[ spirit-run lazy_tests.cpp ]
[ spirit-run switch_tests_eps_default.cpp ]
[ spirit-run switch_tests_general_def.cpp ]
[ spirit-run switch_tests_wo_default.cpp ]
[ spirit-run switch_tests_single.cpp ]
[ spirit-run switch_tests_eps_default.cpp : : : <pch>off ]
[ spirit-run switch_tests_general_def.cpp : : : <pch>off ]
[ spirit-run switch_tests_wo_default.cpp : : : <pch>off ]
[ spirit-run switch_tests_single.cpp : : : <pch>off ]
[ spirit-run switch_problem.cpp ]
[ spirit-run select_p_with_rule.cpp ]
[ spirit-run select_p_with_rule.cpp : : : <pch>off ]
;

test-suite "spirit.classic.utility.parsers"
: [ spirit-run chset_tests.cpp ]
[ spirit-run confix_tests.cpp ]
[ spirit-run loops_tests.cpp ]
[ spirit-run symbols_tests.cpp ]
[ spirit-run symbols_add_null.cpp ]
[ spirit-run symbols_add_null.cpp : : : <pch>off ]
[ spirit-run symbols_find_null.cpp ]
[ spirit-run escape_char_parser_tests.cpp : : : $(opt) ]
[ spirit-run distinct_tests.cpp ]
Expand All @@ -151,7 +160,7 @@ local multi-threading = <library>/boost/thread//boost_thread
[ compile-fail fixed_size_queue_fail_tests.cpp ]
[ spirit-run file_iterator_tests.cpp : : : <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS ]
[ spirit-run multi_pass_tests.cpp : : : $(opt-metrowerks) ]
[ spirit-run sf_bug_720917.cpp : : : $(opt-metrowerks) ]
[ spirit-run sf_bug_720917.cpp : : : <pch>off $(opt-metrowerks) ]
[ spirit-run position_iterator_tests.cpp : : : $(opt-metrowerks) ]
[ compile multi_pass_compile_tests.cpp ]
;
Expand All @@ -176,7 +185,7 @@ local multi-threading = <library>/boost/thread//boost_thread
;

test-suite "spirit.classic.utility.actors"
: [ spirit-run actor/$(actor_test_sources).cpp : : : <library>/boost/system//boost_system ]
: [ spirit-run actor/$(actor_test_sources).cpp ]
;

test-suite "spirit.classic.typeof-support"
Expand Down
4 changes: 0 additions & 4 deletions classic/test/for_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@
// Tests for spirit::for_p
// [13-Jan-2003]
////////////////////////////////////////////////////////////////////////////////
#define qDebug 0
#include <iostream>
#include <cstring>
#if qDebug
#define SPIRIT_DEBUG
#endif
#include <string>
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_assign_actor.hpp>
Expand Down
4 changes: 0 additions & 4 deletions classic/test/if_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@
// Tests for BOOST_SPIRIT_CLASSIC_NS::if_p
// [28-Dec-2002]
////////////////////////////////////////////////////////////////////////////////
#define qDebug 0
#include <iostream>
#include <cstring>
#if qDebug
#define BOOST_SPIRIT_DEBUG
#endif
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_if.hpp>
#include <boost/spirit/include/classic_assign_actor.hpp>
Expand Down
2 changes: 0 additions & 2 deletions classic/test/loops_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include <iostream>
#include <boost/detail/lightweight_test.hpp>


//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_loops.hpp>
using namespace BOOST_SPIRIT_CLASSIC_NS;
Expand Down
1 change: 0 additions & 1 deletion classic/test/operators_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

using namespace std;

//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/classic_core.hpp>
using namespace BOOST_SPIRIT_CLASSIC_NS;

Expand Down
3 changes: 3 additions & 0 deletions classic/test/owi_st_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
=============================================================================*/
// vim:ts=4:sw=4:et

#if defined(BOOST_BUILD_PCH_ENABLED) && defined(BOOST_SPIRIT_THREADSAFE)
# error BOOST_SPIRIT_THREADSAFE has to be undefined for this test
#endif
#undef BOOST_SPIRIT_THREADSAFE
#include <boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp>
#include <boost/detail/lightweight_test.hpp>
Expand Down
15 changes: 15 additions & 0 deletions classic/test/pch.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*=============================================================================
Copyright (c) 2019 Nikita Kniazev
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifdef BOOST_BUILD_PCH_ENABLED

#include <boost/spirit/include/classic.hpp>
#include <boost/core/lightweight_test.hpp>
#include <vector>
#include <string>
#include <iostream>

#endif
52 changes: 29 additions & 23 deletions classic/test/position_iterator_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <cstddef>
#include <boost/config.hpp>
#include <boost/concept_check.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/list.hpp>
#include <boost/mpl/for_each.hpp>

Expand Down Expand Up @@ -479,6 +480,7 @@ void CheckDistance(void)

namespace test_impl {

template <bool AsValue = false>
class check_singular_iterator
{
bool singular_;
Expand All @@ -488,18 +490,18 @@ namespace test_impl {
typedef std::forward_iterator_tag iterator_category;
typedef int value_type;
typedef std::ptrdiff_t difference_type;
typedef int* pointer;
typedef int& reference;
typedef int const* pointer;
typedef typename boost::mpl::if_c<AsValue, int, int const&>::type reference;

check_singular_iterator() : singular_(true), count_(0) {}
explicit check_singular_iterator(int x) : singular_(false), count_(x) {}

int const& operator*() const {
reference operator*() const {
BOOST_TEST(!singular_);
return count_;
}

int const* operator->() const {
pointer operator->() const {
BOOST_TEST(!singular_);
return &count_;
}
Expand All @@ -526,11 +528,11 @@ namespace test_impl {
}
};

template <typename CountIterator>
void CheckSingular()
template <typename CountIterator, typename Iterator>
void CheckSingularImpl()
{
CountIterator begin(check_singular_iterator(5), check_singular_iterator(0));
CountIterator end1(check_singular_iterator(0), check_singular_iterator(0));
CountIterator begin(Iterator(5), Iterator(0));
CountIterator end1(Iterator(0), Iterator(0));
CountIterator end2;

BOOST_TEST(begin == begin);
Expand All @@ -554,24 +556,28 @@ namespace test_impl {

BOOST_TEST(std::distance(end2, end1) == 0);
BOOST_TEST(std::distance(end2, end2) == 0);

BOOST_TEST(*begin == 5);
}

template <typename PositionT>
void CheckSingular()
{
{
typedef check_singular_iterator<false> interator_type;
CheckSingularImpl<position_iterator<interator_type, PositionT>, interator_type>();
CheckSingularImpl<position_iterator2<interator_type, PositionT>, interator_type>();
}
{
typedef check_singular_iterator<true> interator_type;
CheckSingularImpl<position_iterator<interator_type, PositionT>, interator_type>();
CheckSingularImpl<position_iterator2<interator_type, PositionT>, interator_type>();
}
}
}

void CheckSingular()
{
test_impl::CheckSingular<
position_iterator<test_impl::check_singular_iterator, file_position>
>();

test_impl::CheckSingular<
position_iterator<test_impl::check_singular_iterator, file_position_without_column>
>();

test_impl::CheckSingular<
position_iterator2<test_impl::check_singular_iterator, file_position>
>();

test_impl::CheckSingular<
position_iterator2<test_impl::check_singular_iterator, file_position_without_column>
>();
test_impl::CheckSingular<file_position>();
test_impl::CheckSingular<file_position_without_column>();
}
5 changes: 3 additions & 2 deletions classic/test/symbols_add_null.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# undef NDEBUG
#endif

#include <boost/config.hpp>
#include <stdexcept>

#define BOOST_SPIRIT_ASSERT_EXCEPTION ::spirit_exception
Expand All @@ -23,9 +24,9 @@ struct spirit_exception : std::exception
: message(msg)
{
}
~spirit_exception() throw() {}
~spirit_exception() BOOST_NOEXCEPT_OR_NOTHROW {}

char const* what() const throw() { return message; }
char const* what() const BOOST_NOEXCEPT_OR_NOTHROW { return message; }

char const * message;
};
Expand Down
Loading

0 comments on commit 3cafb2b

Please sign in to comment.