mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
add stdtask test on REPL
This commit is contained in:
parent
1964761ef8
commit
581281ff8e
@ -7,6 +7,7 @@ def __init__(self): ...
|
||||
|
||||
|
||||
class Task(PikaStdTask.Task):
|
||||
def __init__(self): ...
|
||||
def platformGetTick(self): ...
|
||||
def returnNullString(self) -> str: ...
|
||||
|
||||
|
@ -9,6 +9,12 @@ void GTestTask_Task_platformGetTick(PikaObj* self) {
|
||||
obj_setInt(self, "tick", tick_ms);
|
||||
}
|
||||
|
||||
void PikaStdTask_Task___init__(PikaObj* self);
|
||||
void GTestTask_Task___init__(PikaObj *self){
|
||||
PikaStdTask_Task___init__(self);
|
||||
tick_ms = 0;
|
||||
}
|
||||
|
||||
void GTestTask___init__(PikaObj* self) {
|
||||
if (!obj_isArgExist(self, "testval")) {
|
||||
obj_setInt(self, "testval", 8848);
|
||||
|
@ -472,4 +472,22 @@ TEST(module, REPL_big_script) {
|
||||
obj_deinit(pikaMain);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
}
|
||||
|
||||
TEST(module, REPL_stdtask) {
|
||||
/* init */
|
||||
pikaMemInfo.heapUsedMax = 0;
|
||||
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
||||
extern unsigned char pikaModules_py_a[];
|
||||
obj_linkLibrary(pikaMain, pikaModules_py_a);
|
||||
/* run */
|
||||
__platform_printf("BEGIN\r\n");
|
||||
f_getchar_fp = fopen("test/python/std/stdtask.py", "rb");
|
||||
pikaScriptShell_withGetchar(pikaMain, f_getchar);
|
||||
fclose((FILE*)f_getchar_fp);
|
||||
/* collect */
|
||||
/* assert */
|
||||
/* deinit */
|
||||
obj_deinit(pikaMain);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user