Skip to content

Commit 5df1105

Browse files
committed
fix some tests; allow running tests selectivly with
1 parent 4d7a176 commit 5df1105

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,5 +375,6 @@ coverage-fresh:
375375
make -j -C ports/unix VARIANT=coverage
376376

377377
.PHONY: run-tests
378+
# If TESTS="abc.py def.py" is specified as an arg, run only those tests. Otherwise, run all tests.
378379
run-tests:
379-
cd tests; MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-tests.py
380+
cd tests; MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-tests.py $(TESTS)

ports/unix/main.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,14 @@ MP_NOINLINE int main_(int argc, char **argv) {
768768
#endif
769769

770770
// printf("total bytes = %d\n", m_get_total_bytes_allocated());
771-
return ret & 0xff;
771+
772+
// CIRCUITPY-CHANGE: handle PYEXEC_EXCEPTION
773+
if (ret & PYEXEC_EXCEPTION) {
774+
// Return exit status code 1 so the invoker knows there was an uncaught exception.
775+
return 1;
776+
} else {
777+
return ret & 0xff;
778+
}
772779
}
773780

774781
void nlr_jump_fail(void *val) {

shared/runtime/pyexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int parse_compile_execute(const void *source, mp_parse_input_kind_t input
118118
// source is a lexer, parse and compile the script
119119
qstr source_name = lex->source_name;
120120
// CIRCUITPY-CHANGE
121-
#if MICROPY_PY___FILE__
121+
#if MICROPY_MODULE___FILE__
122122
if (input_kind == MP_PARSE_FILE_INPUT) {
123123
mp_store_global(MP_QSTR___file__, MP_OBJ_NEW_QSTR(source_name));
124124
}

tests/basics/io_buffered_writer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
try:
22
import io
33

4-
try:
54
io.BytesIO
65
io.BufferedWriter
76
except (AttributeError, ImportError):

0 commit comments

Comments
 (0)