diff options
author | Damien George <damien.p.george@gmail.com> | 2015-05-08 09:18:38 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-05-08 09:18:38 +0100 |
commit | d792d9e49ea89aa8a742f57d70e5b59c9d68939e (patch) | |
tree | b82ccd67eb5b2651a7e6b7637a298da4e0617e71 /unix/coverage.c | |
parent | d3b32caea410897d8bac849489b4558505869dfe (diff) |
unix: Make extra-coverage function callable from Python scripts.
This allows the output of the extra-coverage tests to be checked using
the normal run-tests script.
Diffstat (limited to 'unix/coverage.c')
-rw-r--r-- | unix/coverage.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/unix/coverage.c b/unix/coverage.c index 48dbfd5c7..bc66ec3f1 100644 --- a/unix/coverage.c +++ b/unix/coverage.c @@ -7,13 +7,11 @@ #if defined(MICROPY_UNIX_COVERAGE) // function to run extra tests for things that can't be checked by scripts -void run_extra_coverage_tests(void); - -void run_extra_coverage_tests(void) { +STATIC mp_obj_t extra_coverage(void) { // repl autocomplete { const char *str; - mp_uint_t len = mp_repl_autocomplete("__", 2, &mp_plat_print, &str); + mp_uint_t len = mp_repl_autocomplete("__n", 3, &mp_plat_print, &str); printf("%.*s\n", (int)len, str); mp_store_global(MP_QSTR_sys, mp_import_name(MP_QSTR_sys, mp_const_none, MP_OBJ_NEW_SMALL_INT(0))); @@ -21,6 +19,9 @@ void run_extra_coverage_tests(void) { len = mp_repl_autocomplete("sys.impl", 8, &mp_plat_print, &str); printf("%.*s\n", (int)len, str); } + + return mp_const_none; } +MP_DEFINE_CONST_FUN_OBJ_0(extra_coverage_obj, extra_coverage); #endif |