Permalink
Browse files

tests: Add new subdir "stress/" specifically for stress tests.

  • Loading branch information...
1 parent ab69ed7 commit 157056ecdf378898996ba095c3d7bcf625368103 @dpgeorge dpgeorge committed Mar 15, 2016
Showing with 23 additions and 2 deletions.
  1. +2 −2 tests/run-tests
  2. +7 −0 tests/stress/dict_copy.py
  3. +8 −0 tests/stress/dict_create.py
  4. +6 −0 tests/stress/list_sort.py
View
@@ -365,15 +365,15 @@ def main():
if args.test_dirs is None:
if args.target == 'pyboard':
# run pyboard tests
- test_dirs = ('basics', 'micropython', 'float', 'misc', 'extmod', 'pyb', 'pybnative', 'inlineasm')
+ test_dirs = ('basics', 'micropython', 'float', 'misc', 'stress', 'extmod', 'pyb', 'pybnative', 'inlineasm')
elif args.target == 'esp8266':
test_dirs = ('basics', 'micropython', 'float', 'misc', 'extmod')
elif args.target == 'wipy':
# run WiPy tests
test_dirs = ('basics', 'micropython', 'misc', 'extmod', 'wipy')
else:
# run PC tests
- test_dirs = ('basics', 'micropython', 'float', 'import', 'io', 'misc', 'unicode', 'extmod', 'unix', 'cmdline')
+ test_dirs = ('basics', 'micropython', 'float', 'import', 'io', 'misc', 'stress', 'unicode', 'extmod', 'unix', 'cmdline')
else:
# run tests from these directories
test_dirs = args.test_dirs
@@ -0,0 +1,7 @@
+# copying a large dictionary
+
+a = {i:2*i for i in range(1000)}
+b = a.copy()
+for i in range(1000):
+ print(i, b[i])
+print(len(b))
@@ -0,0 +1,8 @@
+# create a large dictionary
+
+d = {}
+x = 1
+while x < 1000:
+ d[x] = x
+ x += 1
+print(d[500])
@@ -0,0 +1,6 @@
+# test large list sorting (should not stack overflow)
+l = list(range(2000))
+l.sort()
+print(l[0], l[-1])
+l.sort(reverse=True)
+print(l[0], l[-1])

0 comments on commit 157056e

Please sign in to comment.