Skip to content

Commit

Permalink
tests: add a test for failure case in mutest (recursive use)
Browse files Browse the repository at this point in the history
  • Loading branch information
choppsv1 committed Dec 29, 2022
1 parent bbe0372 commit d5434f7
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/mutest/mut_failtest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 eval: (blacken-mode 1) -*-
#
# December 28 2022, Christian Hopps <chopps@labn.net>
#
# Copyright (c) 2022, LabN Consulting, L.L.C.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; see the file COPYING; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
"""Test mutest execution.
This test is for testing various CLI options and console output of mutest.
"""
from munet.mutest.userapi import test_step


test_step(False, "A failing test case")
42 changes: 42 additions & 0 deletions tests/mutest/mutest_fail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- coding: utf-8 eval: (blacken-mode 1) -*-
#
# December 28 2022, Christian Hopps <chopps@labn.net>
#
# Copyright (c) 2022, LabN Consulting, L.L.C.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; see the file COPYING; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
"""Test mutest execution.
This test is for testing various CLI options and console output of mutest.
"""
from munet.mutest.userapi import match_step
from munet.mutest.userapi import script_dir
from munet.mutest.userapi import test_step, section
from munet.mutest.userapi import wait_step


section("Test running mutest executable")

sd = script_dir()
match_step(
"host1",
f"cd {sd} && mutest --help",
"positional arguments:.*\n.*paths",
"Check help",
)
match_step(
"host1", f"cd {sd} && mutest -d /tmp/mutest2/ --file-select='mut_*'", "FAIL", "Verify FAIL case"
)

0 comments on commit d5434f7

Please sign in to comment.