unix: Add special function to improve coverage.

The function and corresponding command-line option are only enabled for
the coverage build.  They are used to exercise uPy features that can't
be properly tested by Python scripts.
This commit is contained in:
Damien George
2015-05-08 00:19:56 +01:00
parent 0589c19d52
commit d3b32caea4
4 changed files with 38 additions and 1 deletions

View File

@@ -434,6 +434,12 @@ int main(int argc, char **argv) {
MP_STATE_VM(mp_optimise_value) = 0;
for (char *p = argv[a] + 1; *p && *p == 'O'; p++, MP_STATE_VM(mp_optimise_value)++);
}
#if defined(MICROPY_UNIX_COVERAGE)
} else if (strcmp(argv[a], "--coverage") == 0) {
void run_extra_coverage_tests(void);
run_extra_coverage_tests();
ret = 0;
#endif
} else {
return usage(argv);
}