Skip to content

Commit 75562e5

Browse files
authored
Merge pull request #1363 from kmod/cpython_tests
Take a pass over the CPython tests
2 parents 9042baf + a2c2b89 commit 75562e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+291
-213
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ endmacro()
333333
add_pyston_test(defaults tests --order-by-mtime -t50)
334334
add_pyston_test(force_llvm tests -a=-n -t90)
335335
if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
336-
add_pyston_test(max_compilation_tier tests -a=-O -t50)
336+
add_pyston_test(max_compilation_tier tests -a=-L -t50)
337337
endif()
338338
add_pyston_test(defaults cpython --exit-code-only --skip-failing -t100)
339339
add_pyston_test(defaults integration --exit-code-only --skip-failing -t900)

Makefile

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ GTEST_DIR := $(DEPS_DIR)/gtest-1.7.0
3131

3232
USE_DEBUG_LIBUNWIND := 0
3333

34-
MAX_MEM_KB := 500000
35-
MAX_DBG_MEM_KB := 500000
34+
MAX_MEM_KB := 1500000
35+
MAX_DBG_MEM_KB := 1500000
3636

3737
TEST_THREADS := 1
3838

@@ -411,10 +411,10 @@ $1_unittest:
411411
$(NINJA) -C $(CMAKE_DIR_DBG) $1_unittest $(NINJAFLAGS)
412412
ln -sf $(CMAKE_DIR_DBG)/$1_unittest .
413413
dbg_$1_unittests: $1_unittest
414-
zsh -c 'ulimit -m $(MAX_MEM_KB); time $(GDB) $(GDB_CMDS) --args ./$1_unittest --gtest_break_on_failure $(ARGS)'
414+
zsh -c 'ulimit -v $(MAX_MEM_KB); time $(GDB) $(GDB_CMDS) --args ./$1_unittest --gtest_break_on_failure $(ARGS)'
415415
unittests:: $1_unittest
416416
run_$1_unittests: $1_unittest
417-
zsh -c 'ulimit -m $(MAX_MEM_KB); time ./$1_unittest $(ARGS)'
417+
zsh -c 'ulimit -v $(MAX_MEM_KB); time ./$1_unittest $(ARGS)'
418418
run_unittests:: run_$1_unittests
419419
)
420420
endef
@@ -759,23 +759,23 @@ define make_target
759759
$(eval \
760760
.PHONY: test$1 check$1
761761
check$1 test$1: $(PYTHON_EXE_DEPS) pyston$1
762-
$(PYTHON) $(TOOLS_DIR)/tester.py -R pyston$1 -j$(TEST_THREADS) -a=-S -k $(TESTS_DIR) $(ARGS)
762+
$(PYTHON) $(TOOLS_DIR)/tester.py -q -R pyston$1 -j$(TEST_THREADS) -a=-S -k $(TESTS_DIR) $(ARGS)
763763
@# we pass -I to cpython tests and skip failing ones because they are sloooow otherwise
764-
$(PYTHON) $(TOOLS_DIR)/tester.py -R pyston$1 -j$(TEST_THREADS) -a=-S -k --exit-code-only --skip-failing -t50 $(TEST_DIR)/cpython $(ARGS)
765-
$(PYTHON) $(TOOLS_DIR)/tester.py -R pyston$1 -j$(TEST_THREADS) -k -a=-S --exit-code-only --skip-failing -t600 $(TEST_DIR)/integration $(ARGS)
766-
$(PYTHON) $(TOOLS_DIR)/tester.py -R pyston$1 -j$(TEST_THREADS) -a=-n -a=-S -t50 -k $(TESTS_DIR) $(ARGS)
767-
$(PYTHON) $(TOOLS_DIR)/tester.py -R pyston$1 -j$(TEST_THREADS) -a=-O -a=-S -k $(TESTS_DIR) $(ARGS)
764+
$(PYTHON) $(TOOLS_DIR)/tester.py -q -R pyston$1 -j$(TEST_THREADS) -a=-S -k --exit-code-only --skip-failing -t50 $(TEST_DIR)/cpython $(ARGS)
765+
$(PYTHON) $(TOOLS_DIR)/tester.py -q -R pyston$1 -j$(TEST_THREADS) -k -a=-S --exit-code-only --skip-failing -t600 $(TEST_DIR)/integration $(ARGS)
766+
$(PYTHON) $(TOOLS_DIR)/tester.py -q -R pyston$1 -j$(TEST_THREADS) -a=-n -a=-S -t50 -k $(TESTS_DIR) $(ARGS)
767+
$(PYTHON) $(TOOLS_DIR)/tester.py -q -R pyston$1 -j$(TEST_THREADS) -a=-L -a=-S -k $(TESTS_DIR) $(ARGS)
768768
769769
.PHONY: run$1 dbg$1
770770
run$1: pyston$1 $$(RUN_DEPS)
771771
PYTHONPATH=test/test_extension:$${PYTHONPATH} ./pyston$1 $$(ARGS)
772772
dbg$1: pyston$1 $$(RUN_DEPS)
773-
PYTHONPATH=test/test_extension:$${PYTHONPATH} zsh -c 'ulimit -m $$(MAX_DBG_MEM_KB); $$(GDB) $$(GDB_CMDS) --args ./pyston$1 $$(ARGS)'
773+
PYTHONPATH=test/test_extension:$${PYTHONPATH} zsh -c 'ulimit -v $$(MAX_DBG_MEM_KB); $$(GDB) $$(GDB_CMDS) --args ./pyston$1 $$(ARGS)'
774774
nosearch_run$1_%: %.py pyston$1 $$(RUN_DEPS)
775-
$(VERB) PYTHONPATH=test/test_extension:$${PYTHONPATH} zsh -c 'ulimit -m $$(MAX_MEM_KB); time ./pyston$1 $$(ARGS) $$<'
775+
$(VERB) PYTHONPATH=test/test_extension:$${PYTHONPATH} zsh -c 'ulimit -v $$(MAX_MEM_KB); time ./pyston$1 $$(ARGS) $$<'
776776
$$(call make_search,run$1_%)
777777
nosearch_dbg$1_%: %.py pyston$1 $$(RUN_DEPS)
778-
$(VERB) PYTHONPATH=test/test_extension:$${PYTHONPATH} zsh -c 'ulimit -m $$(MAX_DBG_MEM_KB); $$(GDB) $$(GDB_CMDS) --args ./pyston$1 $$(ARGS) $$<'
778+
$(VERB) PYTHONPATH=test/test_extension:$${PYTHONPATH} zsh -c 'ulimit -v $$(MAX_DBG_MEM_KB); $$(GDB) $$(GDB_CMDS) --args ./pyston$1 $$(ARGS) $$<'
779779
$$(call make_search,dbg$1_%)
780780
781781
ifneq ($$(ENABLE_VALGRIND),0)
@@ -905,7 +905,7 @@ opreportcg:
905905

906906
.PHONY: watch_% watch wdbg_%
907907
watch_%:
908-
@ ( ulimit -t 60; ulimit -m $(MAK_MEM_KB); \
908+
@ ( ulimit -t 60; ulimit -v $(MAK_MEM_KB); \
909909
TARGET=$(dir $@)$(patsubst watch_%,%,$(notdir $@)); \
910910
clear; $(MAKE) $$TARGET $(WATCH_ARGS); true; \
911911
while inotifywait -q -e modify -e attrib -e move -e move_self -e create -e delete -e delete_self \
@@ -921,7 +921,7 @@ wdbg_%:
921921
$(MAKE) $(patsubst wdbg_%,watch_dbg_%,$@) GDB_POST_CMDS="--ex quit"
922922

923923
.PHONY: head_%
924-
HEAD := 40
924+
HEAD ?= 40
925925
HEAD_SKIP := 6
926926
head_%:
927927
@ bash -c "set -o pipefail; script -e -q -c '$(MAKE) $(dir $@)$(patsubst head_%,%,$(notdir $@))' /dev/null | tail -n+$(HEAD_SKIP) | head -n$(HEAD)"
@@ -953,7 +953,7 @@ test_cpp_ll:
953953
.PHONY: bench_exceptions
954954
bench_exceptions:
955955
$(CLANGPP_EXE) $(TEST_DIR)/bench_exceptions.cpp -o bench_exceptions -O3 -std=c++11
956-
zsh -c 'ulimit -m $(MAX_MEM_KB); time ./bench_exceptions'
956+
zsh -c 'ulimit -v $(MAX_MEM_KB); time ./bench_exceptions'
957957
rm bench_exceptions
958958

959959
TEST_EXT_MODULE_NAMES := basic_test descr_test slots_test type_test api_test

from_cpython/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Copy any changed stdlib files to the destination:
22
file(GLOB_RECURSE STDLIB_SRCS Lib/*.py)
3+
4+
file(GLOB STDLIB_MORE_SRCS Lib/lib2to3/*.txt)
5+
set(STDLIB_SRCS ${STDLIB_MORE_SRCS} ${STDLIB_SRCS})
6+
7+
file(GLOB STDLIB_MORE_SRCS Lib/email/test/data/*)
8+
set(STDLIB_SRCS ${STDLIB_MORE_SRCS} ${STDLIB_SRCS})
9+
310
file(GLOB_RECURSE STD_INCLUDES Include/*.h)
411
set(STDLIB_TARGETS "")
512
foreach(STDLIB_FILE ${STDLIB_SRCS})
@@ -181,6 +188,7 @@ add_custom_command(OUTPUT ${STDMODULES}
181188
DEPENDS
182189
pyston
183190
copy_stdlib
191+
setup.py
184192
Modules/_multiprocessing/multiprocessing.c
185193
Modules/_multiprocessing/semaphore.c
186194
Modules/_multiprocessing/socket_connection.c

from_cpython/Lib/_threading_local.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
42
1616
1717
You can also access the local-object's dictionary:
18+
(Pyston change: changed this to dict(mydata.__dict__) to make more portable)
1819
19-
>>> mydata.__dict__
20+
>>> dict(mydata.__dict__)
2021
{'number': 42}
2122
>>> mydata.__dict__.setdefault('widgets', [])
2223
[]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# -*- coding: uft-8 -*-
2+
# skip-if: True
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#coding: utf8
2+
# skip-if: True
23
print '我'

from_cpython/Lib/test/script_helper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import os.path
88
import tempfile
99
import subprocess
10-
# Pyston change: we can't import this currently
11-
# import py_compile
10+
import py_compile
1211
import contextlib
1312
import shutil
1413
try:

from_cpython/Lib/test/test_cfgparser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# expected: fail
21
import ConfigParser
32
import StringIO
43
import os

from_cpython/Lib/test/test_coding.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# expected: fail
2-
31
import test.test_support, unittest
42
import os
53

from_cpython/Lib/test/test_fork1.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# expected: fail
21
"""This test checks for correct fork() behavior.
32
"""
43

0 commit comments

Comments
 (0)