Skip to content

Commit b6df1dd

Browse files
committed
tests: add a test for failure case in mutest (recursive use)
1 parent bbe0372 commit b6df1dd

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

tests/mutest/mut_failtest.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- coding: utf-8 eval: (blacken-mode 1) -*-
2+
#
3+
# December 28 2022, Christian Hopps <chopps@labn.net>
4+
#
5+
# Copyright (c) 2022, LabN Consulting, L.L.C.
6+
#
7+
# This program is free software; you can redistribute it and/or
8+
# modify it under the terms of the GNU General Public License
9+
# as published by the Free Software Foundation; either version 2
10+
# of the License, or (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License along
18+
# with this program; see the file COPYING; if not, write to the Free Software
19+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20+
#
21+
"""Test mutest execution.
22+
23+
This test is for testing various CLI options and console output of mutest.
24+
"""
25+
from munet.mutest.userapi import test_step
26+
27+
28+
test_step(False, "A failing test case")

tests/mutest/mutest_fail.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# -*- coding: utf-8 eval: (blacken-mode 1) -*-
2+
#
3+
# December 28 2022, Christian Hopps <chopps@labn.net>
4+
#
5+
# Copyright (c) 2022, LabN Consulting, L.L.C.
6+
#
7+
# This program is free software; you can redistribute it and/or
8+
# modify it under the terms of the GNU General Public License
9+
# as published by the Free Software Foundation; either version 2
10+
# of the License, or (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License along
18+
# with this program; see the file COPYING; if not, write to the Free Software
19+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20+
#
21+
"""Test mutest execution.
22+
23+
This test is for testing various CLI options and console output of mutest.
24+
"""
25+
from munet.mutest.userapi import match_step
26+
from munet.mutest.userapi import script_dir
27+
from munet.mutest.userapi import section
28+
29+
30+
section("Test running mutest executable")
31+
32+
sd = script_dir()
33+
match_step(
34+
"host1",
35+
f"cd {sd} && mutest --help",
36+
"positional arguments:.*\n.*paths",
37+
"Check help",
38+
)
39+
match_step(
40+
"host1",
41+
f"cd {sd} && mutest -d /tmp/mutest2/ --file-select='mut_*'",
42+
"FAIL",
43+
"Verify FAIL case",
44+
)

0 commit comments

Comments
 (0)