LUMIERA.clone/tests/50components.tests

219 lines
7.3 KiB
Text

TESTING "Component Test Suite: common and basic components" ./test-components --group=common
TEST "Hello test" HelloWorld_test 3 <<END
out: This is how the world ends...
out: This is how the world ends...
out: This is how the world ends...
return: 0
END
TEST "Appconfig_test" Appconfig_test <<END
return: 0
END
TEST "CmdlineWrapper_test" CmdlineWrapper_test <<END
out: wrapping cmdline:...
out: -->
out: wrapping cmdline:
out: ...
out: -->
out: wrapping cmdline:spam...
out: 0|spam|
out: -->spam
out: wrapping cmdline:
out: spam...
out: 0|spam|
out: -->spam
out: wrapping cmdline:eat more 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 Ωoo...
out: 0|Ω|
out: 1|ooΩ|
out: 2|oΩo|
out: 3|Ωoo|
out: -->Ω ooΩ oΩo Ωoo
out: Standard Cmdlineformat:one two
END
TEST "ExceptionError_test" ExceptionError_test <<END
out: caught: LUMIERA_ERROR_LIFE_AND_UNIVERSE:and everything? (don't panic)...the answer is: 42
out: caught lumiera::Error: LUMIERA_ERROR_DERIVED:convoluted exception
out: caught error::Logic: LUMIERA_ERROR_FATAL:floundered (test-2).
out: caught error::Invalid: LUMIERA_ERROR_INVALID:invalid input or parameters (test-3).
out: caught lumiera::Error: LUMIERA_ERROR_EXTERNAL:failure in external service (test-4).
out: caught std::runtime_error: test-5
out: caught std::exception: St9exception
out: intermediate handler caught: LUMIERA_ERROR_EXTERNAL:failure in external service (test-7).....will rethrow as error::State
out: caught lumiera::Error: LUMIERA_ERROR_STATE:unforseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-7).
out: intermediate handler caught: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).....will rethrow as error::State
out: 2nd intermediate handler caught: LUMIERA_ERROR_STATE:unforseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).....will rethrow as error::Config
out: caught lumiera::Error: LUMIERA_ERROR_CONFIG:misconfiguration -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).
END
TEST "Factory_test" Factory_test 5 <<END
out: ctor TargetObj(5) successfull
out: now the smart-ptr has refcount=3
out: .....TargetObj(5): data="*****", array[5]={0,1,2,3,4,}
out: dtor ~TargetObj(5) successfull
END
TEST "Factory_special_test" Factory_special_test 5 <<END
out: checkPlacement--------
out: ctor TargetObj(5) successfull
out: created 3 shared_ptrs to Object placed in static buffer.
out: .....TargetObj(5): data="*****", array[5]={0,1,2,3,4,}
out: dtor ~TargetObj(5) successfull
out: ctor TargetObj(6) successfull
out: created 4 shared_ptrs to Object placed in static buffer.
out: dtor ~TargetObj(6) successfull
out: checkPrivate--------
out: ctor TargetObj(5) successfull
out: created 3 shared_ptrs to paranoid Object.
out: .....TargetObj(5): data="*****", array[5]={0,1,2,3,4,}
out: dtor ~TargetObj(5) successfull
out: checkMalloc--------
out: ctor TargetObj(7) successfull
out: created auto_ptr to malloc-ed Object.
out: .....TargetObj(7): data="*******", array[7]={0,1,2,3,4,5,6,}
out: dtor ~TargetObj(7) successfull
out: checkPImpl--------
out: ctor TargetObj(12) successfull
out: created auto_ptr to Interface Object.
out: .....ImplObj::funky() called
out: .....TargetObj(12): data="************", array[12]={0,1,2,3,4,5,6,7,8,9,10,11,}
out: dtor ~TargetObj(12) successfull
END
TEST "SanitizedIdentifier_test" SanitizedIdentifier_test <<END
out: 'Word' --> 'Word'
out: 'a Sentence' --> 'a_Sentence'
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: '§&Ω%€ leading garbarge' --> 'leading_garbarge'
out: 'mixed Ω garbarge' --> 'mixed_garbarge'
out: 'Bääääh!!' --> 'Bh'
out: '§&Ω%€' --> ''
END
TEST "SingletonTestMock_test" SingletonTestMock_test <<END
out: TestSingletonO::doIt() call=1
out: TestSingletonO::doIt() call=2
out: Mock_1::doIt() call=1
out: Mock_1::doIt() call=2
out: Mock_1::doIt() call=3
out: Mock_1::doIt() call=4
out: Mock_1::doIt() call=5
out: Mock_2::doIt() call=1
out: TestSingletonO::doIt() call=3
END
TEST "Singleton_test" Singleton_test 23 <<END
out: testing TargetObj(23) as Singleton(statically allocated)
out: ctor TargetObj(23) successfull
out: calling a non-static method on the Singleton instance
out: .....TargetObj(23): data="***********************", array[23]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,}
out: testing TargetObj(24) as Singleton(heap allocated)
out: ctor TargetObj(24) successfull
out: calling a non-static method on the Singleton instance
out: .....TargetObj(24): data="************************", array[24]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,}
out: dtor ~TargetObj(23) successfull
out: dtor ~TargetObj(24) successfull
END
TEST "TestOption_test" TestOption_test <<END
out: Testing invocation with cmdline: ...
out: --> Testgroup=ALL
out: --> Test-ID =--missing--
out: --> remaining=
out: Testing invocation with cmdline: --help...
out: --> Testgroup=ALL
out: --> Test-ID =--missing--
out: --> remaining=
out: Testing invocation with cmdline: --group TestGroupID...
out: --> Testgroup=TestGroupID
out: --> Test-ID =--missing--
out: --> remaining=
out: Testing invocation with cmdline: SingleTestID...
out: --> Testgroup=ALL
out: --> Test-ID =SingleTestID
out: --> remaining=SingleTestID
out: Testing invocation with cmdline: SingleTestID --group TestGroupID...
out: --> Testgroup=TestGroupID
out: --> Test-ID =SingleTestID
out: --> remaining=SingleTestID
out: Testing invocation with cmdline: --group TestGroupID SingleTestID ...
out: --> Testgroup=TestGroupID
out: --> Test-ID =SingleTestID
out: --> remaining=SingleTestID
out: Testing invocation with cmdline: --group TestGroupID SingleTestID spam eggs...
out: --> Testgroup=TestGroupID
out: --> Test-ID =SingleTestID
out: --> remaining=SingleTestID spam eggs
out: Testing invocation with cmdline: SingleTestID spam --group TestGroupID --eggs...
out: --> Testgroup=TestGroupID
out: --> Test-ID =SingleTestID
out: --> remaining=SingleTestID spam --eggs
END
TEST "TypeList_test" TypeList_test <<END
out: - 1 -- 2 -- 3 -- 5 -- 8 -- 13 -- The End -
out: ..Size of = 1
return: 0
END
TEST "VisitingTool_test" VisitingTool_test <<END
out: === Babbler meets Boss and BigBoss ===
out: Hello Boss, nice to meet you...
out: Hello Big Boss, nice to meet you...
out: === Babbler meets HomoSapiens and Leader ===
out: Hello Boss, nice to meet you...
return: 0
END
TEST "VisitingToolExtended_test" VisitingToolExtended_test <<END
out: === Babbler meets Boss and BigBoss ===
out: Hello Boss, nice to meet you...
out: Hello Big Boss, nice to meet you...
out: === Babbler meets HomoSapiens and Leader ===
out: Hello Boss, nice to meet you...
out: === Blatherer meets Leader and Visionary masqueraded as Chief ===
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
END