Ejemplo n.º 1
0
 def setUpClass(cls):  # pylint: disable=invalid-name
     result = os.system("{} {} build posix.unittest.simple".format(
         sys.executable, base_path('prj', 'app', 'prj.py')))
     system = "out/posix/unittest/simple/system" + get_executable_extension(
     )
     assert result == 0
     cls.simple = ctypes.CDLL(system)
Ejemplo n.º 2
0
 def setUpClass(cls):  # pylint: disable=invalid-name
     prj_path = base_path('prj', 'app', 'prj.py')
     command = "build posix.unittest.blocking-mutex"
     result = os.system("{} {} {}".format(sys.executable, prj_path, command))
     system = "out/posix/unittest/blocking-mutex/system" + get_executable_extension()
     assert result == 0
     cls.impl = ctypes.CDLL(system)
     cls.impl_mutex = (ctypes.POINTER(MutexStruct * NUM_MUTEXES)).in_dll(cls.impl, 'pub_mutexes')[0]
Ejemplo n.º 3
0
 def setUpClass(cls):  # pylint: disable=invalid-name
     result = os.system("{} {} build posix.unittest.sched-rr".format(
         sys.executable, base_path('prj', 'app', 'prj.py')))
     system = "out/posix/unittest/sched-rr/system" + get_executable_extension(
     )
     assert result == 0
     cls.impl = ctypes.CDLL(system)
     cls.impl_sched = ctypes.POINTER(sched.get_rr_sched_struct(10)).in_dll(
         cls.impl, 'pub_sched_tasks')[0]
Ejemplo n.º 4
0
 def setUpClass(cls):  # pylint: disable=invalid-name
     result = os.system("{} {} build posix.unittest.simple-semaphore"
                        .format(sys.executable, base_path('prj', 'app', 'prj.py')))
     system = "out/posix/unittest/simple-semaphore/system" + get_executable_extension()
     assert result == 0
     cls.impl = ctypes.CDLL(system)
     cls.impl_sem = ctypes.POINTER(SemaphoreStruct).in_dll(cls.impl, 'pub_semaphores')
     cls.impl_waiters = ctypes.POINTER(ctypes.c_ubyte).in_dll(cls.impl, 'pub_waiters')
     cls.impl.rtos_sem_try_wait.res_type = ctypes.c_bool
     cls.unblock_func_ptr = None
     cls.block_func_ptr = None
     cls.get_current_task_ptr = None