Debian Codegraph @

testing/tests/parts-teardown.test

raw
1 # This test consists of three parts, with the second one triggering an error.
2 # We define a PartTeardown that should kick in after the first and second
3 # parts. Since the third part never runs, no point in calling its teardown.
4
5 # %TEST-EXEC-FAIL: btest t/test
6 # %TEST-EXEC: btest-diff output
7
8 # %TEST-START-FILE btest.cfg
9 [btest]
10 TestDirs = t
11 TmpDir = .tmp
12 BaselineDir = Baseline
13 PartTeardown = echo Teardown $TEST_PART >>../../output
14 # %TEST-END-FILE
15
16 # %TEST-START-FILE t/test
17 @TEST-EXEC: echo "Hello, world!." >>../../output
18 # %TEST-END-FILE
19
20 # %TEST-START-FILE t/test#2
21 @TEST-EXEC: echo "Hello, world! Again, with error." >>../../output && false
22 # %TEST-END-FILE
23
24 # %TEST-START-FILE t/test#3
25 @TEST-EXEC: echo "Hello, world! Again, but you won't see this." >>../../output
26 # %TEST-END-FILE