summaryrefslogtreecommitdiff
path: root/unix/main.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-05-08 00:19:56 +0100
committerDamien George <damien.p.george@gmail.com>2015-05-08 00:19:56 +0100
commitd3b32caea410897d8bac849489b4558505869dfe (patch)
treedd914fed2f39943b8d05f377cd6ff70a160e3518 /unix/main.c
parent0589c19d5239bb4456f06049925d71851e896d1e (diff)
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.
Diffstat (limited to 'unix/main.c')
-rw-r--r--unix/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/unix/main.c b/unix/main.c
index 4a71bfac6..abea15728 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -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);
}