projects
/
mudpy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Run different selftests when debug mode is engaged
[mudpy.git]
/
mudpy
/
tests
/
selftest.py
diff --git
a/mudpy/tests/selftest.py
b/mudpy/tests/selftest.py
index
d5b8ac4
..
0bd2dd9
100644
(file)
--- a/
mudpy/tests/selftest.py
+++ b/
mudpy/tests/selftest.py
@@
-11,6
+11,8
@@
import sys
import telnetlib
import time
import telnetlib
import time
+import yaml
+
# TODO(fungi) Clean this up once Python 3.5 is no longer supported
if sys.version < "3.6":
import collections
# TODO(fungi) Clean this up once Python 3.5 is no longer supported
if sys.version < "3.6":
import collections
@@
-432,6
+434,12
@@
dialogue = odict((
(final_cleanup, "delete remaining accounts"),
))
(final_cleanup, "delete remaining accounts"),
))
+debug_tests = (
+)
+
+nondebug_tests = (
+)
+
def start_service(config):
# Clean up any previously run daemon which didn't terminate
def start_service(config):
# Clean up any previously run daemon which didn't terminate
@@
-526,6
+534,13
@@
def option_callback(telnet_socket, command, option):
telnet_socket.send(telnetlib.IAC + telnetlib.DONT + option)
telnet_socket.send(telnetlib.IAC + telnetlib.DONT + option)
+def check_debug():
+ if len(sys.argv) > 1:
+ config = yaml.safe_load(open(sys.argv[1]))
+ return config.get(".mudpy.limit.debug", False)
+ return False
+
+
def main():
captures = ["", "", ""]
lusers = [telnetlib.Telnet(), telnetlib.Telnet(), telnetlib.Telnet()]
def main():
captures = ["", "", ""]
lusers = [telnetlib.Telnet(), telnetlib.Telnet(), telnetlib.Telnet()]
@@
-542,6
+557,12
@@
def main():
luser.open("::1", 4000)
luser.set_option_negotiation_callback(option_callback)
selected_dialogue = odict(dialogue)
luser.open("::1", 4000)
luser.set_option_negotiation_callback(option_callback)
selected_dialogue = odict(dialogue)
+ if check_debug():
+ for test in nondebug_tests:
+ del selected_dialogue[test]
+ else:
+ for test in debug_tests:
+ del selected_dialogue[test]
for test, description in selected_dialogue.items():
tlog("\nTesting %s..." % description)
test_start = time.time()
for test, description in selected_dialogue.items():
tlog("\nTesting %s..." % description)
test_start = time.time()