1f08c3bdfSopenharmony_ci#!/bin/sh -e
2f08c3bdfSopenharmony_ci# SPDX-License-Identifier: GPL-2.0-or-later
3f08c3bdfSopenharmony_ci# Copyright (c) 2022 Petr Vorel <pvorel@suse.cz>
4f08c3bdfSopenharmony_ci
5f08c3bdfSopenharmony_ciTST_TESTFUNC=test
6f08c3bdfSopenharmony_ciTST_CNT=6
7f08c3bdfSopenharmony_ci
8f08c3bdfSopenharmony_ci# not needed, just cover more code
9f08c3bdfSopenharmony_ciTST_SETUP=setup
10f08c3bdfSopenharmony_ciTST_CLEANUP=cleanup
11f08c3bdfSopenharmony_ciTST_NEEDS_TMPDIR=1
12f08c3bdfSopenharmony_ci
13f08c3bdfSopenharmony_cisetup()
14f08c3bdfSopenharmony_ci{
15f08c3bdfSopenharmony_ci	tst_res TINFO "in setup"
16f08c3bdfSopenharmony_ci}
17f08c3bdfSopenharmony_ci
18f08c3bdfSopenharmony_cicleanup()
19f08c3bdfSopenharmony_ci{
20f08c3bdfSopenharmony_ci	tst_res TINFO "in cleanup"
21f08c3bdfSopenharmony_ci}
22f08c3bdfSopenharmony_ci
23f08c3bdfSopenharmony_cirun()
24f08c3bdfSopenharmony_ci{
25f08c3bdfSopenharmony_ci	tst_res TINFO "LTP_COLORIZE_OUTPUT: '$LTP_COLORIZE_OUTPUT'"
26f08c3bdfSopenharmony_ci	tst_res TPASS "shell library works with set -e"
27f08c3bdfSopenharmony_ci}
28f08c3bdfSopenharmony_ci
29f08c3bdfSopenharmony_citest1()
30f08c3bdfSopenharmony_ci{
31f08c3bdfSopenharmony_ci    export LTP_COLORIZE_OUTPUT=y
32f08c3bdfSopenharmony_ci    run
33f08c3bdfSopenharmony_ci}
34f08c3bdfSopenharmony_ci
35f08c3bdfSopenharmony_citest2()
36f08c3bdfSopenharmony_ci{
37f08c3bdfSopenharmony_ci    export LTP_COLORIZE_OUTPUT=n
38f08c3bdfSopenharmony_ci    run
39f08c3bdfSopenharmony_ci}
40f08c3bdfSopenharmony_ci
41f08c3bdfSopenharmony_citest3()
42f08c3bdfSopenharmony_ci{
43f08c3bdfSopenharmony_ci    export LTP_COLORIZE_OUTPUT=0
44f08c3bdfSopenharmony_ci    run
45f08c3bdfSopenharmony_ci}
46f08c3bdfSopenharmony_ci
47f08c3bdfSopenharmony_citest4()
48f08c3bdfSopenharmony_ci{
49f08c3bdfSopenharmony_ci    export LTP_COLORIZE_OUTPUT=1
50f08c3bdfSopenharmony_ci    run
51f08c3bdfSopenharmony_ci}
52f08c3bdfSopenharmony_ci
53f08c3bdfSopenharmony_citest5()
54f08c3bdfSopenharmony_ci{
55f08c3bdfSopenharmony_ci    export LTP_COLORIZE_OUTPUT=
56f08c3bdfSopenharmony_ci    run
57f08c3bdfSopenharmony_ci}
58f08c3bdfSopenharmony_ci
59f08c3bdfSopenharmony_citest6()
60f08c3bdfSopenharmony_ci{
61f08c3bdfSopenharmony_ci    unset LTP_COLORIZE_OUTPUT
62f08c3bdfSopenharmony_ci    run
63f08c3bdfSopenharmony_ci}
64f08c3bdfSopenharmony_ci
65f08c3bdfSopenharmony_ci. tst_test.sh
66f08c3bdfSopenharmony_citst_run
67