From e8588b735c98a8458be1b55688d37e50aa089a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odin=20H=C3=B8rthe=20Omdal?= Date: Thu, 12 Feb 2009 02:36:52 +0100 Subject: [PATCH 01/39] test: test.sh imported from newest nobug nobug commit d2d0b769fb7ed3d7174671cde2ef02a64b987397 --- tests/test.sh | 112 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 93 insertions(+), 19 deletions(-) diff --git a/tests/test.sh b/tests/test.sh index 31c92da5b..7c2ca1427 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash # Copyright (C) Lumiera.org # 2007 - 2008, Christian Thaeter # @@ -26,18 +26,34 @@ # stop testing on the first failure export LC_ALL=C +NOBUG_LOGREGEX='^\(\*\*[0-9]*\*\* \)\?[0-9]\{10,\}: \(TRACE\|INFO\|NOTICE\|WARNING\|ERR\):' arg0="$0" srcdir="$(dirname "$arg0")" -ulimit -S -t 2 -v 524288 +ulimit -S -t 5 -v 524288 valgrind="" if [ "$VALGRINDFLAGS" = 'DISABLE' ]; then echo "valgrind explicit disabled" else if [ "$(which valgrind)" ]; then - valgrind="$(which valgrind) --leak-check=yes --show-reachable=yes -q $VALGRINDFLAGS" - ulimit -S -t 10 + ulimit -S -t 20 + if [[ -x 'vgsuppression' ]]; then + if [[ 'vgsuppression' -nt 'vgsuppression.supp' ]]; then + echo 'generating valgrind supression file' + + if [[ -x ".libs/vgsuppression" ]]; then + ./libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes -q --gen-suppressions=all vgsuppression 2>&1 \ + | sed '/^\(==\)\|\(\*\*\)[0-9]*\(==\)\|\(\*\*\)/d;' >vgsuppression.supp + else + valgrind --leak-check=yes --show-reachable=yes -q --gen-suppressions=all ./vgsuppression 2>&1 \ + | sed '/^\(==\)\|\(\*\*\)[0-9]*\(==\)\|\(\*\*\)/d;' >vgsuppression.supp + fi + fi + valgrind="$(which valgrind) --leak-check=yes --show-reachable=no --suppressions=vgsuppression.supp -q $VALGRINDFLAGS" + else + valgrind="$(which valgrind) --leak-check=yes --show-reachable=no -q $VALGRINDFLAGS" + fi else echo "no valgrind found, go without it" fi @@ -50,6 +66,7 @@ TESTCNT=0 SKIPCNT=0 FAILCNT=0 + # the old testlog if existing will be used to check for previous test states if test -f ,testlog; then mv ,testlog ,testlog.pre @@ -59,6 +76,40 @@ fi date >,testlog +function compare_regex() # rxfile plainfile +{ + local regex + local line + local miss + local lineno=1 + local regexno=1 + { + IFS='' read -u 3 -r regex || return 0 + IFS='' read -u 4 -r line || { echo "no output"; return 1; } + while true; do + if [[ $line =~ $regex ]]; then + IFS='' read -u 4 -r line || + if IFS='' read -u 3 -r regex; then + echo "premature end in output, expecting: '$regex':$regexno" + return 1 + else + return 0 + fi + : $((++lineno)) + miss=0 + else + if [[ $((++miss)) -gt 1 ]]; then + echo -e "'$line':$lineno\ndoes not match\n'$regex':$regexno" + return 1 + fi + IFS='' read -u 3 -r regex || { echo "more output than expected: '$line':$lineno"; return 1; } + : $((++regexno)) + fi + done + } 3<"$1" 4<"$2" +} + + function TEST() { name="$1" @@ -69,7 +120,11 @@ function TEST() while read -r line; do cmd="${line%%:*}" - arg="${line#*: }" + arg="${line#*:}" + arg="${arg:1}" + if [[ ! "$arg" ]]; then + arg='^$' + fi expect_return=0 case $cmd in @@ -85,6 +140,9 @@ function TEST() 'return') expect_return="$arg" ;; + '#'*|'') + : + ;; *) echo "UNKOWN TEST COMMAND '$cmd'" 1>&2 exit @@ -128,36 +186,45 @@ function TEST() ((fails+=1)) else + if test -f ,send_stdin; then - cat ,send_stdin | $valgrind $TESTBIN "$@" 2>,stderr >,stdout + env $TESTBIN_PREFIX $TESTBIN "$@" <,send_stdin 2>,stderr >,stdout else - $valgrind $TESTBIN "$@" 2>,stderr >,stdout + env $TESTBIN_PREFIX $TESTBIN "$@" 2>,stderr >,stdout fi &>/dev/null return=$? if test -f ,expect_stdout; then - if ! cmp ,expect_stdout ,stdout &>/dev/null; then + grep -v "$NOBUG_LOGREGEX" <,stdout >,tmp + if ! compare_regex ,expect_stdout ,tmp >>,cmptmp; then echo "unexpected data on stdout" >>,testtmp - grep -v ': \(TRACE\|INFO\|NOTICE\|WARNING\|ERR\):' <,stdout >,tmp - diff -ua ,expect_stdout ,tmp >>,testtmp - rm ,tmp + cat ,cmptmp >>,testtmp ((fails+=1)) fi + rm ,tmp ,cmptmp fi if test -f ,expect_stderr; then - if ! cmp ,expect_stderr ,stderr &>/dev/null; then + grep -v "$NOBUG_LOGREGEX" <,stderr >,tmp + cat ,tmp >>,testtmp + if ! compare_regex ,expect_stderr ,tmp >>,cmptmp; then echo "unexpected data on stderr" >>,testtmp - grep -v ': \(TRACE\|INFO\|NOTICE\|WARNING\|ERR\):' <,stderr >,tmp - diff -ua ,expect_stderr ,tmp >>,testtmp - rm ,tmp + cat ,cmptmp >>,testtmp ((fails+=1)) fi + rm ,tmp ,cmptmp fi - if test "$expect_return" != "$return"; then - echo "unexpected return value $return" >>,testtmp - ((fails+=1)) + if [[ "${expect_return:0:1}" = '!' ]]; then + if [[ "${expect_return#\!}" = "$return" ]]; then + echo "unexpected return value $return, expected $expect_return" >>,testtmp + ((fails+=1)) + fi + else + if [[ "${expect_return}" != "$return" ]]; then + echo "unexpected return value $return, expected $expect_return" >>,testtmp + ((fails+=1)) + fi fi fi @@ -224,7 +291,14 @@ function TESTING() { echo echo "$1" - TESTBIN=$2 + echo -e "\n#### $1" >>,testlog + + if [[ -x ".libs/$2" ]]; then + TESTBIN_PREFIX="./libtool --mode=execute $valgrind" + else + TESTBIN_PREFIX="$valgrind" + fi + TESTBIN="$2" } TESTSUITES="${TESTSUITES}${1:+${TESTSUITES:+,}$1}" From 0c89dbaa629dc33ef6e36545a67cc57bf2f9577a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odin=20H=C3=B8rthe=20Omdal?= Date: Thu, 12 Feb 2009 02:38:58 +0100 Subject: [PATCH 02/39] test: Regexed 00-40, just escaping; no fancy stuff --- tests/15list.tests | 14 +- tests/15locking.tests | 2 +- tests/20config_lowlevel.tests | 6 +- tests/22config_highlevel.tests | 10 +- tests/31plugin.tests | 10 +- tests/40components.tests | 481 ++++++++++++++++----------------- 6 files changed, 253 insertions(+), 270 deletions(-) diff --git a/tests/15list.tests b/tests/15list.tests index e04044f27..1e6558e49 100644 --- a/tests/15list.tests +++ b/tests/15list.tests @@ -2,31 +2,22 @@ TESTING "Linked Lists" ./test-llist TEST "init nodes" basic <line = ' #comment bla' END TEST "check content of configitem with section" configitem_simple_content_check $'[ key.foo suffix.bar ] ' << END -out: item->line = '[ key.foo suffix.bar ] ' +out: item->line = '\[ key\.foo suffix.bar \] ' out: item->key_size = '7' -out: item->key = 'key.foo suffix.bar ] ' -out: item->delim = ' suffix.bar ] ' +out: item->key = 'key.foo suffix.bar \] ' +out: item->delim = ' suffix.bar \] ' END TEST "check content of configitem with directive (without argument)" configitem_simple_content_check $'\t @directive ' << END diff --git a/tests/22config_highlevel.tests b/tests/22config_highlevel.tests index c43baaefe..ac5a90a30 100644 --- a/tests/22config_highlevel.tests +++ b/tests/22config_highlevel.tests @@ -209,18 +209,16 @@ out: ' baz barf gnarf first second' END TEST "wordlist add same word" wordlist_add 'foo.bar' 'baz barf gnarf' same same << END -out: ' baz barf gnarf same' -out: ' baz barf gnarf same' +out: ^' baz barf gnarf same'$ END TEST "wordlist add to empty list" wordlist_add 'foo.bar' '' first second << END -out: ' first' -out: ' first second' +out: ^' first'$ +out: ^' first second'$ END TEST "wordlist add to empty list, same" wordlist_add 'foo.bar' '' same same << END -out: ' same' -out: ' same' +out: ^' same'$ END diff --git a/tests/31plugin.tests b/tests/31plugin.tests index 46844f754..6181c224b 100644 --- a/tests/31plugin.tests +++ b/tests/31plugin.tests @@ -2,7 +2,7 @@ TESTING "testing plugins" ./test-interfaces TEST "discovering plugins, missing path" plugin_discover < out: wrapping cmdline: -out: ... +out: \.\.\. out: --> out: wrapping cmdline:spam... -out: 0|spam| +out: 0\|spam\| out: -->spam out: wrapping cmdline: out: spam... -out: 0|spam| +out: 0\|spam\| out: -->spam out: wrapping cmdline:eat more spam... -out: 0|eat| -out: 1|more| -out: 2|spam| +out: 0\|eat\| +out: 1\|more\| +out: 2\|spam\| out: -->eat more spam -out: wrapping cmdline: oo _O()O_ ä + €... -out: 0|oo| -out: 1|_O()O_| -out: 2|ä| -out: 3|+| -out: 4|€| -out: -->oo _O()O_ ä + € +out: wrapping cmdline: oo _O\(\)O_ ä \+ €... +out: 0\|oo\| +out: 1\|_O\(\)O_\| +out: 2\|ä\| +out: 3\|\+\| +out: 4\|€\| +out: -->oo _O\(\)O_ ä \+ € out: wrapping cmdline:Ω ooΩ oΩo Ωoo... -out: 0|Ω| -out: 1|ooΩ| -out: 2|oΩo| -out: 3|Ωoo| +out: 0\|Ω\| +out: 1\|ooΩ\| +out: 2\|oΩo\| +out: 3\|Ωoo\| out: -->Ω ooΩ oΩo Ωoo out: Standard Cmdlineformat:one two END @@ -62,98 +60,98 @@ out: Conf2 :-<2>- out: Conf3 :-<3>- out: Conf4 :-<2>-<4>- out: AllFlags :-<1>-<2>-<3>-<4>- -out: __________________________ -out: __________________________ check_flags() +out: __________________________$ +out: __________________________ check_flags\(\) out: Flags1 :-<2>-<4>- out: Flags2 :-<2>-<4>- out: SimpleConfig_defined_by_Typelist :-<1>- out: AnotherConfig_defined_by_Typelist :-<1>-<2>-<3>-<4>- -out: __________________________ -out: __________________________ check_instantiation() -out: defined Conf0? ---> 0 -out: defined Conf1? ---> 1 -out: defined Conf2? ---> 1 -out: defined Conf3? ---> 1 -out: defined Conf4? ---> 1 -out: defined Trash? ---> 0 -out: __________________________ -out: __________________________ check_filter() +out: __________________________$ +out: __________________________ check_instantiation\(\) +out: defined Conf0\? ---> 0 +out: defined Conf1\? ---> 1 +out: defined Conf2\? ---> 1 +out: defined Conf3\? ---> 1 +out: defined Conf4\? ---> 1 +out: defined Trash\? ---> 0 +out: __________________________$ +out: __________________________ check_filter\(\) out: SomeFlagsets : -out: +---<1>-<3>-+ -out: +---<2>-<4>-+- +out: \+---<1>-<3>-\+ +out: \+---<2>-<4>-\+- out: Configs_defined_by_Flagsets : -out: +-Conf-[-<1>-<3>-] -out: +-Conf-[-<2>-<4>-]- +out: \+-Conf-\[-<1>-<3>-\] +out: \+-Conf-\[-<2>-<4>-\]- out: Filter_possible_Configs : -out: +-Conf-[-<2>-<4>-]- +out: \+-Conf-\[-<2>-<4>-\]- out: AllFlagCombinations : -out: +---<1>-<2>-<3>-<4>-<·>-+ -out: +---<1>-<2>-<3>-<·>-+ -out: +---<1>-<2>-<4>-<·>-+ -out: +---<1>-<2>-<·>-+ -out: +---<1>-<3>-<4>-<·>-+ -out: +---<1>-<3>-<·>-+ -out: +---<1>-<4>-<·>-+ -out: +---<1>-<·>-+ -out: +---<2>-<3>-<4>-<·>-+ -out: +---<2>-<3>-<·>-+ -out: +---<2>-<4>-<·>-+ -out: +---<2>-<·>-+ -out: +---<3>-<4>-<·>-+ -out: +---<3>-<·>-+ -out: +---<4>-<·>-+ -out: +---<·>-+- +out: \+---<1>-<2>-<3>-<4>-<·>-\+ +out: \+---<1>-<2>-<3>-<·>-\+ +out: \+---<1>-<2>-<4>-<·>-\+ +out: \+---<1>-<2>-<·>-\+ +out: \+---<1>-<3>-<4>-<·>-\+ +out: \+---<1>-<3>-<·>-\+ +out: \+---<1>-<4>-<·>-\+ +out: \+---<1>-<·>-\+ +out: \+---<2>-<3>-<4>-<·>-\+ +out: \+---<2>-<3>-<·>-\+ +out: \+---<2>-<4>-<·>-\+ +out: \+---<2>-<·>-\+ +out: \+---<3>-<4>-<·>-\+ +out: \+---<3>-<·>-\+ +out: \+---<4>-<·>-\+ +out: \+---<·>-\+- out: ListAllConfigs : -out: +-Conf-[-<1>-<2>-<3>-<4>-] -out: +-Conf-[-<1>-<2>-<3>-] -out: +-Conf-[-<1>-<2>-<4>-] -out: +-Conf-[-<1>-<2>-] -out: +-Conf-[-<1>-<3>-<4>-] -out: +-Conf-[-<1>-<3>-] -out: +-Conf-[-<1>-<4>-] -out: +-Conf-[-<1>-] -out: +-Conf-[-<2>-<3>-<4>-] -out: +-Conf-[-<2>-<3>-] -out: +-Conf-[-<2>-<4>-] -out: +-Conf-[-<2>-] -out: +-Conf-[-<3>-<4>-] -out: +-Conf-[-<3>-] -out: +-Conf-[-<4>-] -out: +-Conf-[-]- +out: \+-Conf-\[-<1>-<2>-<3>-<4>-\] +out: \+-Conf-\[-<1>-<2>-<3>-\] +out: \+-Conf-\[-<1>-<2>-<4>-\] +out: \+-Conf-\[-<1>-<2>-\] +out: \+-Conf-\[-<1>-<3>-<4>-\] +out: \+-Conf-\[-<1>-<3>-\] +out: \+-Conf-\[-<1>-<4>-\] +out: \+-Conf-\[-<1>-\] +out: \+-Conf-\[-<2>-<3>-<4>-\] +out: \+-Conf-\[-<2>-<3>-\] +out: \+-Conf-\[-<2>-<4>-\] +out: \+-Conf-\[-<2>-\] +out: \+-Conf-\[-<3>-<4>-\] +out: \+-Conf-\[-<3>-\] +out: \+-Conf-\[-<4>-\] +out: \+-Conf-\[-\]- out: Filter_all_possible_Configs : -out: +-Conf-[-<1>-] -out: +-Conf-[-<2>-<3>-] -out: +-Conf-[-<2>-<4>-] -out: +-Conf-[-<2>-] -out: +-Conf-[-<3>-]- -out: __________________________ -out: __________________________ check_FlagInfo() +out: \+-Conf-\[-<1>-\] +out: \+-Conf-\[-<2>-<3>-\] +out: \+-Conf-\[-<2>-<4>-\] +out: \+-Conf-\[-<2>-\] +out: \+-Conf-\[-<3>-\]- +out: __________________________$ +out: __________________________ check_FlagInfo\(\) out: Flags1 :-<1>-<3>- out: max bit : 3 out: binary code: 10 out: SomeConfigs : -out: +-Conf-[-<1>-<3>-] -out: +-Conf-[-<2>-<4>-]- -out: max bit in [SomeConfigs] : 4 +out: \+-Conf-\[-<1>-<3>-\] +out: \+-Conf-\[-<2>-<4>-\]- +out: max bit in \[SomeConfigs\] : 4 out: TestVisitor application: -out: visit(code=10) --> -out: +-Conf-[-<1>-<3>-]- -out: visit(code=20) --> -out: +-Conf-[-<2>-<4>-]- -out: __________________________ -out: __________________________ check_ConfigSelector() +out: visit\(code=10\) --> +out: \+-Conf-\[-<1>-<3>-\]- +out: visit\(code=20\) --> +out: \+-Conf-\[-<2>-<4>-\]- +out: __________________________$ +out: __________________________ check_ConfigSelector\(\) out: Possible_Configs : -out: +-Conf-[-<1>-] -out: +-Conf-[-<2>-<3>-] -out: +-Conf-[-<2>-<4>-] -out: +-Conf-[-<2>-] -out: +-Conf-[-<3>-]- -out: Flag-code = 2 ConfigSelector() ---> 1010 -out: Flag-code = 12 ConfigSelector() ---> 1023 -out: Flag-code = 20 ConfigSelector() ---> 1024 -out: Flag-code = 4 ConfigSelector() ---> 1020 -out: Flag-code = 8 ConfigSelector() ---> 1030 -out: LUMIERA_ERROR_INVALID:invalid input or parameters (ConfigSelector: No preconfigured factory for config-bits=10111). +out: \+-Conf-\[-<1>-\] +out: \+-Conf-\[-<2>-<3>-\] +out: \+-Conf-\[-<2>-<4>-\] +out: \+-Conf-\[-<2>-\] +out: \+-Conf-\[-<3>-\]- +out: Flag-code = 2 ConfigSelector\(\) ---> 1010 +out: Flag-code = 12 ConfigSelector\(\) ---> 1023 +out: Flag-code = 20 ConfigSelector\(\) ---> 1024 +out: Flag-code = 4 ConfigSelector\(\) ---> 1020 +out: Flag-code = 8 ConfigSelector\(\) ---> 1030 +out: LUMIERA_ERROR_INVALID:invalid input or parameters \(ConfigSelector: No preconfigured factory for config-bits=10111\)\. return: 0 END @@ -164,54 +162,54 @@ END TEST "ExceptionError_test" ExceptionError_test < [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ] -out: removed 0 ---> [ 1, 2, 3, 4, 5, 6, 7, 8, 9, ] -out: removed 9 ---> [ 0, 1, 2, 3, 4, 5, 6, 7, 8, ] -out: removed 5 ---> [ 0, 1, 2, 3, 4, 6, 7, 8, 9, ] -out: removed 0 2 4 6 8 ---> [ 1, 3, 5, 7, 9, ] -out: removed 1 3 5 7 9 ---> [ 0, 2, 4, 6, 8, ] -out: removed 0 1 2 3 4 5 6 7 8 9 ---> [ ] -out: removed 0 1 2 3 4 5 6 7 8 ---> [ 9, ] -out: removed 1 2 3 4 5 6 7 8 9 ---> [ 0, ] -out: removed 0 1 2 3 4 6 7 8 9 ---> [ 5, ] +out: removed nothing ---> \[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, \] +out: removed 0 ---> \[ 1, 2, 3, 4, 5, 6, 7, 8, 9, \] +out: removed 9 ---> \[ 0, 1, 2, 3, 4, 5, 6, 7, 8, \] +out: removed 5 ---> \[ 0, 1, 2, 3, 4, 6, 7, 8, 9, \] +out: removed 0 2 4 6 8 ---> \[ 1, 3, 5, 7, 9, \] +out: removed 1 3 5 7 9 ---> \[ 0, 2, 4, 6, 8, \] +out: removed 0 1 2 3 4 5 6 7 8 9 ---> \[ \] +out: removed 0 1 2 3 4 5 6 7 8 ---> \[ 9, \] +out: removed 1 2 3 4 5 6 7 8 9 ---> \[ 0, \] +out: removed 0 1 2 3 4 6 7 8 9 ---> \[ 5, \] END @@ -241,7 +239,7 @@ out: 'trailing Withespace out: ' --> 'trailing_Withespace' out: 'with a lot out: of Whitespace' --> 'with_a_lot_of_Whitespace' -out: 'with"much (punctuation)[]!' --> 'withmuch_(punctuation)' +out: 'with"much \(punctuation\)\[\]!' --> 'withmuch_\(punctuation\)' out: '§&Ω%€ leading garbage' --> 'leading_garbage' out: 'mixed Ω garbage' --> 'mixed_garbage' out: 'Bääääh!!' --> 'Bh' @@ -250,24 +248,24 @@ END TEST "SingletonSubclass_test" SingletonSubclass_test 13 <... -out: . -out: ..install one element at index[0] -out: . -out: ..*** resize table to 16 elements -out: . -out: .throw some exceptions... +out: \.$ +out: \.\.install one element at index\[0\] +out: ^\.$ +out: \.\.\*\*\* resize table to 16 elements +out: ^\.$ +out: ^\.throw some exceptions... out: checking ScopedPtrHolder... -out: . -out: ..install one element at index[0] -out: . -out: ..*** resize table to 16 elements -out: . -out: .throw some exceptions... +out: ^\.$ +out: ..install one element at index\[0\] +out: ^\.$ +out: ..\*\*\* resize table to 16 elements +out: ^\.$ +out: ^\.throw some exceptions... END @@ -301,16 +299,16 @@ END TEST "Singleton_test" Singleton_test 23 < > out: ctor DoIt > out: ctor DoIt > out: ctor DoIt > -out: Block< 2>::eat(..) -out: Block< 5>::eat(..) -out: Block<13>::eat(..) +out: Block< 2>::eat\(..\) +out: Block< 5>::eat\(..\) +out: Block<13>::eat\(..\) out: gulp! out: dtor DoIt > out: dtor DoIt > @@ -435,87 +433,87 @@ out: Append8 :-<1>-<2>-<3>-<222>- out: Append9 :-<1>-<2>-<3>-<5>-<6>-<7>- out: FilterEven :-<2>-<6>- out: Prefix1 : -out: +---<11>-<22>-+- +out: \+---<11>-<22>-\+- out: Prefix2 : -out: +---<101>-<1>-+ -out: +---<101>-<2>-+ -out: +---<101>-<3>-+- +out: \+---<101>-<1>-\+ +out: \+---<101>-<2>-\+ +out: \+---<101>-<3>-\+- out: Prefix3 : -out: +---<1>-+ -out: +---<2>-+ -out: +---<3>-+- +out: \+---<1>-\+ +out: \+---<2>-\+ +out: \+---<3>-\+- out: Prefix4 : -out: +---<111>-<1>-<2>-<3>-+ -out: +---<111>-<0>-+ -out: +---<111>-<5>-<6>-<7>-+- +out: \+---<111>-<1>-<2>-<3>-\+ +out: \+---<111>-<0>-\+ +out: \+---<111>-<5>-<6>-<7>-\+- out: Prefix5 : -out: +---<1>-<2>-<3>-<5>-+ -out: +---<1>-<2>-<3>-<6>-+ -out: +---<1>-<2>-<3>-<7>-+- +out: \+---<1>-<2>-<3>-<5>-\+ +out: \+---<1>-<2>-<3>-<6>-\+ +out: \+---<1>-<2>-<3>-<7>-\+- out: Prefix6 : -out: +---<1>-<2>-<3>-<1>-<2>-<3>-+ -out: +---<1>-<2>-<3>-<0>-+ -out: +---<1>-<2>-<3>-<5>-<6>-<7>-+- +out: \+---<1>-<2>-<3>-<1>-<2>-<3>-\+ +out: \+---<1>-<2>-<3>-<0>-\+ +out: \+---<1>-<2>-<3>-<5>-<6>-<7>-\+- out: Dist1 : -out: +---<11>-<1>-+ -out: +---<11>-<2>-+ -out: +---<11>-<3>-+- +out: \+---<11>-<1>-\+ +out: \+---<11>-<2>-\+ +out: \+---<11>-<3>-\+- out: Dist2 : -out: +---<11>-<0>-+ -out: +---<22>-<0>-+ -out: +---<33>-<0>-+- +out: \+---<11>-<0>-\+ +out: \+---<22>-<0>-\+ +out: \+---<33>-<0>-\+- out: Dist3 : -out: +---<11>-<1>-+ -out: +---<11>-<2>-+ -out: +---<11>-<3>-+ -out: +---<22>-<1>-+ -out: +---<22>-<2>-+ -out: +---<22>-<3>-+ -out: +---<33>-<1>-+ -out: +---<33>-<2>-+ -out: +---<33>-<3>-+- +out: \+---<11>-<1>-\+ +out: \+---<11>-<2>-\+ +out: \+---<11>-<3>-\+ +out: \+---<22>-<1>-\+ +out: \+---<22>-<2>-\+ +out: \+---<22>-<3>-\+ +out: \+---<33>-<1>-\+ +out: \+---<33>-<2>-\+ +out: \+---<33>-<3>-\+- out: Dist4 : -out: +---<11>-<1>-<2>-<3>-+ -out: +---<11>-<5>-<6>-<7>-+ -out: +---<22>-<1>-<2>-<3>-+ -out: +---<22>-<5>-<6>-<7>-+ -out: +---<33>-<1>-<2>-<3>-+ -out: +---<33>-<5>-<6>-<7>-+- +out: \+---<11>-<1>-<2>-<3>-\+ +out: \+---<11>-<5>-<6>-<7>-\+ +out: \+---<22>-<1>-<2>-<3>-\+ +out: \+---<22>-<5>-<6>-<7>-\+ +out: \+---<33>-<1>-<2>-<3>-\+ +out: \+---<33>-<5>-<6>-<7>-\+- out: Down :-<11>-<10>-<9>-<8>-<7>-<6>-<5>-<4>-<3>-<2>-<1>-<0>- out: Combi : -out: +---<1>-<2>-<3>-<·>-+ -out: +---<1>-<2>-<2>-<·>-+ -out: +---<1>-<2>-<1>-<·>-+ -out: +---<1>-<2>-<0>-<·>-+ -out: +---<1>-<1>-<3>-<·>-+ -out: +---<1>-<1>-<2>-<·>-+ -out: +---<1>-<1>-<1>-<·>-+ -out: +---<1>-<1>-<0>-<·>-+ -out: +---<1>-<0>-<3>-<·>-+ -out: +---<1>-<0>-<2>-<·>-+ -out: +---<1>-<0>-<1>-<·>-+ -out: +---<1>-<0>-<0>-<·>-+ -out: +---<0>-<2>-<3>-<·>-+ -out: +---<0>-<2>-<2>-<·>-+ -out: +---<0>-<2>-<1>-<·>-+ -out: +---<0>-<2>-<0>-<·>-+ -out: +---<0>-<1>-<3>-<·>-+ -out: +---<0>-<1>-<2>-<·>-+ -out: +---<0>-<1>-<1>-<·>-+ -out: +---<0>-<1>-<0>-<·>-+ -out: +---<0>-<0>-<3>-<·>-+ -out: +---<0>-<0>-<2>-<·>-+ -out: +---<0>-<0>-<1>-<·>-+ -out: +---<0>-<0>-<0>-<·>-+- +out: \+---<1>-<2>-<3>-<·>-\+ +out: \+---<1>-<2>-<2>-<·>-\+ +out: \+---<1>-<2>-<1>-<·>-\+ +out: \+---<1>-<2>-<0>-<·>-\+ +out: \+---<1>-<1>-<3>-<·>-\+ +out: \+---<1>-<1>-<2>-<·>-\+ +out: \+---<1>-<1>-<1>-<·>-\+ +out: \+---<1>-<1>-<0>-<·>-\+ +out: \+---<1>-<0>-<3>-<·>-\+ +out: \+---<1>-<0>-<2>-<·>-\+ +out: \+---<1>-<0>-<1>-<·>-\+ +out: \+---<1>-<0>-<0>-<·>-\+ +out: \+---<0>-<2>-<3>-<·>-\+ +out: \+---<0>-<2>-<2>-<·>-\+ +out: \+---<0>-<2>-<1>-<·>-\+ +out: \+---<0>-<2>-<0>-<·>-\+ +out: \+---<0>-<1>-<3>-<·>-\+ +out: \+---<0>-<1>-<2>-<·>-\+ +out: \+---<0>-<1>-<1>-<·>-\+ +out: \+---<0>-<1>-<0>-<·>-\+ +out: \+---<0>-<0>-<3>-<·>-\+ +out: \+---<0>-<0>-<2>-<·>-\+ +out: \+---<0>-<0>-<1>-<·>-\+ +out: \+---<0>-<0>-<0>-<·>-\+- out: OnOff : -out: +---<1>-<2>-<3>-<·>-+ -out: +---<1>-<2>-<·>-+ -out: +---<1>-<3>-<·>-+ -out: +---<1>-<·>-+ -out: +---<2>-<3>-<·>-+ -out: +---<2>-<·>-+ -out: +---<3>-<·>-+ -out: +---<·>-+- +out: \+---<1>-<2>-<3>-<·>-\+ +out: \+---<1>-<2>-<·>-\+ +out: \+---<1>-<3>-<·>-\+ +out: \+---<1>-<·>-\+ +out: \+---<2>-<3>-<·>-\+ +out: \+---<2>-<·>-\+ +out: \+---<3>-<·>-\+ +out: \+---<·>-\+- return: 0 END @@ -546,7 +544,6 @@ out: we-do-everything-for-YOU! out: Hello Mr.Future, nice to meet you... out: === Babbler masqueraded as Tool meets Leader and Visionary masqueraded as HomoSapiens === out: Hello Boss, nice to meet you... -out: Hello Boss, nice to meet you... out: === Babbler masqueraded as Tool meets Leader and Visionary masqueraded as Leader === out: Hello Boss, nice to meet you... return: 0 From bbe2b78c29c9d6aa37cfcf443a337faece4694b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odin=20H=C3=B8rthe=20Omdal?= Date: Thu, 12 Feb 2009 11:49:11 +0100 Subject: [PATCH 03/39] test: Finished regexing the last tests --- tests/41asset.tests | 2 +- tests/44builder.tests | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/41asset.tests b/tests/41asset.tests index b76982317..0af6737c5 100644 --- a/tests/41asset.tests +++ b/tests/41asset.tests @@ -4,7 +4,7 @@ TESTING "Component Test Suite: Asset Manager" ./test-components --group=asset TEST "AssetCategory_test" AssetCategory_test < Date: Fri, 15 May 2009 22:11:59 +0200 Subject: [PATCH 04/39] fixed config lowlevel tests Few tests got broken with the new testsuite and libtool problems to pass empty strings and tabs around. I just removed tabs and unnecessary blanks. This makes some tests somewhat less valuable, but works for now. --- tests/20config_lowlevel.tests | 37 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tests/20config_lowlevel.tests b/tests/20config_lowlevel.tests index 920abb46c..8fe76e895 100644 --- a/tests/20config_lowlevel.tests +++ b/tests/20config_lowlevel.tests @@ -10,7 +10,8 @@ TEST "create configitem with empty line" configitem_simple '' <line = ' #comment bla' +TEST "check content of configitem with comment" configitem_simple_content_check $' #comment bla' << END +out: item->line = ' #comment bla' END TEST "check content of configitem with section" configitem_simple_content_check $'[ key.foo suffix.bar ] ' << END @@ -61,31 +62,31 @@ out: item->key = 'key.foo suffix.bar \] ' out: item->delim = ' suffix.bar \] ' END -TEST "check content of configitem with directive (without argument)" configitem_simple_content_check $'\t @directive ' << END -out: item->line = ' @directive ' +TEST "check content of configitem with directive (without argument)" configitem_simple_content_check $' @directive' << END +out: item->line = ' @directive' out: item->key_size = '9' -out: item->key = '@directive ' +out: item->key = '@directive' END -TEST "check content of configitem with directive (with argument)" configitem_simple_content_check $'\t @directive \targument' << END -out: item->line = ' @directive argument' +TEST "check content of configitem with directive (with argument)" configitem_simple_content_check $' @directive argument' << END +out: item->line = ' @directive argument' out: item->key_size = '9' -out: item->key = '@directive argument' -out: item->delim = ' argument' +out: item->key = '@directive argument' +out: item->delim = ' argument' END -TEST "check content of configitem with configentry" configitem_simple_content_check $' \t\t key.foo \t\t=\tbar' << END -out: item->line = ' key.foo = bar' +TEST "check content of configitem with configentry" configitem_simple_content_check $'key.foo =bar' << END +out: item->line = 'key.foo =bar' out: item->key_size = '7' -out: item->key = 'key.foo = bar' -out: item->delim = '= bar' +out: item->key = 'key.foo =bar' +out: item->delim = '=bar' END -TEST "check content of configitem with configentry (redirect)" configitem_simple_content_check $' \t\t key.foo \t\t<\tkey.bar' << END -out: item->line = ' key.foo < key.bar' +TEST "check content of configitem with configentry (redirect)" configitem_simple_content_check $'key.foo line = 'key.foo key_size = '7' -out: item->key = 'key.foo < key.bar' -out: item->delim = '< key.bar' +out: item->key = 'key.foo delim = ' Date: Thu, 16 Oct 2008 20:31:02 +0200 Subject: [PATCH 05/39] @Joel: a simple convenience wrapper for gavl_time_t --- src/lib/lumitime.cpp | 7 ++- src/lib/lumitime.hpp | 54 +++++++++++++------- tests/components/proc/asset/makecliptest.cpp | 2 +- 3 files changed, 39 insertions(+), 24 deletions(-) diff --git a/src/lib/lumitime.cpp b/src/lib/lumitime.cpp index 9590b6c3a..d9e849a49 100644 --- a/src/lib/lumitime.cpp +++ b/src/lib/lumitime.cpp @@ -1,5 +1,5 @@ /* - Time - unified representation of a time point, including conversion functions + Time - convenience wrapper for working with gavl_time in C++ Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -28,10 +28,9 @@ namespace lumiera { - // TODO: dummy values; should be adjusted when switching to the real time implementation provided by the backend - const Time Time::MAX = +std::numeric_limits::max(); - const Time Time::MIN = -std::numeric_limits::max(); + const Time Time::MAX = +std::numeric_limits::max(); + const Time Time::MIN = -std::numeric_limits::max(); } // namespace lumiera diff --git a/src/lib/lumitime.hpp b/src/lib/lumitime.hpp index 33b5bb4c3..5bc60c044 100644 --- a/src/lib/lumitime.hpp +++ b/src/lib/lumitime.hpp @@ -1,5 +1,5 @@ /* - LUMITIME.hpp - unified representation of a time point, including conversion functions + LUMITIME.hpp - convenience wrapper for working with gavl_time in C++ Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -26,35 +26,51 @@ #include +extern "C" { +#include +} -namespace lumiera - { +namespace lumiera { /** - * denotes a temporal position (time point), based on timeline start. + * C++ convenience wrapper representing a time value, which could denote + * a temporal position (time point) relative to an (implicit) timeline zero + * point, or it could represent a time interval. * - * @todo currently (9/07) this is a dummy implementation to find out - * what interface the Proc layer needs. Cehteh has already written - * elaborate timehandling functions in the backend and the goal - * is for class Time to be just a thin wrapper! + * @note this is currently (10/08) an experimental implementation to ease + * the time handling within C++ code. It is advisable not to use it + * on external interfaces (use gavl_time_t there please). */ - class Time : boost::totally_ordered