diff options
-rw-r--r-- | .travis.yml | 26 | ||||
-rw-r--r-- | src/global.cc | 2 | ||||
-rw-r--r-- | src/utils.cc | 2 | ||||
-rw-r--r-- | src/utils.h | 2 | ||||
-rwxr-xr-x | test/DocTests.py | 2 | ||||
-rw-r--r-- | test/baseline/opt-trace.test | 15 | ||||
-rwxr-xr-x[-rw-r--r--] | tools/prepare-commit-msg | 2 |
7 files changed, 28 insertions, 23 deletions
diff --git a/.travis.yml b/.travis.yml index b4999235..11d399e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,5 @@ # Since the Travis CI environment http://docs.travis-ci.com/user/ci-environment/ -# provides GNU GCC 4.6, which does not support -std=c++11 GNU GCC 4.8 is -# installed. Additionally boost 1.55.0 is compiled from source, since in the -# Travis CI environment only boost 1.46 is available and no backported package -# was found on the net. +# provides GNU GCC 4.6, which does not support -std=c++11 GNU GCC 4.8 is installed language: cpp compiler: @@ -10,31 +7,24 @@ compiler: - gcc before_install: - # Add software package repository, containing updated build toochain, i.e. GNU GCC 4.8 + # Add software package repositories with recent versions of gcc and boost - sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes + - sudo add-apt-repository ppa:boost-latest/ppa --yes - sudo apt-get update -qq - # Download boost 1.55 and extract the source archive - - wget --no-verbose --output-document=boost-trunk.tar.bz2 http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2/download - - export BOOST_ROOT="$TRAVIS_BUILD_DIR/../boost-trunk" - - export CMAKE_MODULE_PATH="$BOOST_ROOT" - - mkdir -p $BOOST_ROOT - - tar jxf boost-trunk.tar.bz2 --strip-components=1 -C $BOOST_ROOT install: # Install GNU GCC 4.8 required by use of C++11 - sudo apt-get install -qq g++-4.8 gcc-4.8 - export CXX="g++-4.8" CC="gcc-4.8" - # Build boost libraries required by ledger - - (cd $BOOST_ROOT; ./bootstrap.sh --with-libraries=date_time,filesystem,system,iostreams,regex,python,test) - - (cd $BOOST_ROOT; ./b2 threading=multi --prefix=$BOOST_ROOT -d0 install) - # Install further dependencies - - ./acprep dependencies + # Install Ledger dependencies + - sudo apt-get install -qq libboost1.55 libgmp-dev libmpfr-dev libeditline-dev before_script: - - ./acprep opt make --python --boost=$BOOST_ROOT + - export JOBS=2 + - ./acprep opt make --jobs $JOBS --python script: - - ./acprep check -- --output-on-failure + - ./acprep check --jobs $JOBS -- --output-on-failure - PYTHONPATH=. python python/demo.py notifications: diff --git a/src/global.cc b/src/global.cc index a58bba54..e5a2f809 100644 --- a/src/global.cc +++ b/src/global.cc @@ -514,7 +514,7 @@ void handle_debug_options(int argc, char * argv[]) #if TRACING_ON _log_level = LOG_TRACE; try { - _trace_level = boost::lexical_cast<uint8_t>(argv[i + 1]); + _trace_level = boost::lexical_cast<uint16_t>(argv[i + 1]); } catch (const boost::bad_lexical_cast&) { throw std::logic_error(_("Argument to --trace must be an integer")); diff --git a/src/utils.cc b/src/utils.cc index 741ce79d..7b7c468c 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -574,7 +574,7 @@ std::ostream * _log_stream = &std::cerr; std::ostringstream _log_buffer; #if TRACING_ON -uint8_t _trace_level; +uint16_t _trace_level; #endif static bool logger_has_run = false; diff --git a/src/utils.h b/src/utils.h index c3dcf562..95c87929 100644 --- a/src/utils.h +++ b/src/utils.h @@ -251,7 +251,7 @@ void logger_func(log_level_t level); #if TRACING_ON -extern uint8_t _trace_level; +extern uint16_t _trace_level; #define SHOW_TRACE(lvl) \ (ledger::_log_level >= ledger::LOG_TRACE && lvl <= ledger::_trace_level) diff --git a/test/DocTests.py b/test/DocTests.py index be28fae1..dbd24634 100755 --- a/test/DocTests.py +++ b/test/DocTests.py @@ -114,7 +114,7 @@ class DocTests: if command[0] == '$': command.remove('$') index = command.index('ledger') command[index] = self.ledger - for i,argument in enumerate('--init-file /dev/null --columns 80'.split()): + for i,argument in enumerate('--args-only --columns 80'.split()): command.insert(index+i+1, argument) try: diff --git a/test/baseline/opt-trace.test b/test/baseline/opt-trace.test new file mode 100644 index 00000000..9034018e --- /dev/null +++ b/test/baseline/opt-trace.test @@ -0,0 +1,15 @@ +2007/02/02 RD VMMXX + Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 + Income:Dividends:Vanguard:VMMXX $-0.35 + +; Using values with two or more digits as the argument to the --trace option +; resulted in a segmentation fault. +; Since ledger prints debugging information to stderr when the --trace option +; was given and that debugging information contains timing information, e.g. [1ms] +; which is likely to differ on each test run, this test only checks that ledger +; does not crash when the --trace options was specified. +test reg --trace 10 2>/dev/null +07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX + In:Divid:Vanguar:VMMXX $-0.35 $-0.35 + 0.350 VMMXX +end test diff --git a/tools/prepare-commit-msg b/tools/prepare-commit-msg index c943fa2b..e103888a 100644..100755 --- a/tools/prepare-commit-msg +++ b/tools/prepare-commit-msg @@ -24,4 +24,4 @@ EOF } ## MAIN -add_ci_skip '\(^src\|^test\|^doc/ledger3.texi\|CMakeLists.txt\)' "$@" +add_ci_skip '\(^src\|^test\|^doc/ledger3.texi\|^\.travis.yml\|CMakeLists.txt\)' "$@" |