blob: bc66ec3f11a1d6bd5dbef333323b9882d7540352 [file] [log] [blame]
Damien Georged3b32ca2015-05-08 00:19:56 +01001#include <stdio.h>
2
3#include "py/obj.h"
4#include "py/runtime.h"
5#include "py/repl.h"
6
7#if defined(MICROPY_UNIX_COVERAGE)
8
9// function to run extra tests for things that can't be checked by scripts
Damien Georged792d9e2015-05-08 09:18:38 +010010STATIC mp_obj_t extra_coverage(void) {
Damien Georged3b32ca2015-05-08 00:19:56 +010011 // repl autocomplete
12 {
13 const char *str;
Damien Georged792d9e2015-05-08 09:18:38 +010014 mp_uint_t len = mp_repl_autocomplete("__n", 3, &mp_plat_print, &str);
Damien Georged3b32ca2015-05-08 00:19:56 +010015 printf("%.*s\n", (int)len, str);
16
17 mp_store_global(MP_QSTR_sys, mp_import_name(MP_QSTR_sys, mp_const_none, MP_OBJ_NEW_SMALL_INT(0)));
18 mp_repl_autocomplete("sys.", 4, &mp_plat_print, &str);
19 len = mp_repl_autocomplete("sys.impl", 8, &mp_plat_print, &str);
20 printf("%.*s\n", (int)len, str);
21 }
Damien Georged792d9e2015-05-08 09:18:38 +010022
23 return mp_const_none;
Damien Georged3b32ca2015-05-08 00:19:56 +010024}
Damien Georged792d9e2015-05-08 09:18:38 +010025MP_DEFINE_CONST_FUN_OBJ_0(extra_coverage_obj, extra_coverage);
Damien Georged3b32ca2015-05-08 00:19:56 +010026
27#endif