def check_threads() -> List[Check]: return check_execution('./selfie -c <assignment>syscalls.c -m 128', 'creates a thread, where the parent can join the thread with MIPSTER', success_criteria=70) + \ check_execution('./selfie -c selfie.c -m 128 -c <assignment>syscalls.c -y 64', 'creates a thread, where the parent can join the thread with HYPSTER', success_criteria=70) + \ check_mipster_execution('shared-data.c', 42, 'data section is shared for threads on MIPSTER') + \ check_hypster_execution('shared-data.c', 42, 'data section is shared for threads on HYPSTER') + \ check_mipster_execution('shared-heap.c', 42, 'heap data is shared for threads on MIPSTER') + \ check_hypster_execution('shared-heap.c', 42, 'heap data is shared for threads on HYPSTER')
def check_threads() -> List[Check]: return check_execution('./selfie -c <assignment>syscalls.c -m 128', 'creates a thread, where the parent can join the thread with MIPSTER', success_criteria=70) + \ check_execution('./selfie -c selfie.c -m 128 -c <assignment>syscalls.c -y 64', 'creates a thread, where the parent can join the thread with HYPSTER', success_criteria=70) + \ check_mipster_execution('shared-data.c', 42, 'data section is shared for threads on MIPSTER') + \ check_hypster_execution('shared-data.c', 42, 'data section is shared for threads on HYPSTER') + \ check_mipster_execution('shared-heap.c', 42, 'heap data is shared for threads on MIPSTER') + \ check_hypster_execution('shared-heap.c', 42, 'heap data is shared for threads on HYPSTER') + \ check_mipster_execution('sum-integer-dekker.c', 210, 'two threads correctly calculate the sum from 1 to 20 with Dekker\'s algorithm on MIPSTER') +\ check_hypster_execution('sum-integer-dekker.c', 210, 'two threads correctly calculate the sum from 1 to 20 with Dekker\'s algorithm on HYPSTER')
def check_fork_and_wait() -> List[Check]: return check_compilable('parallel-print.c', 'fork and wait compiled') + \ check_mipster_execution('parallel-print.c', lambda code, out: is_permutation_of( out, [0, 1, 2, 3, 4, 5, 6, 7]), 'fork creates a child process, where the parent can wait for the child process with MIPSTER') + \ check_hypster_execution('parallel-print.c', lambda code, out: is_permutation_of( out, [0, 1, 2, 3, 4, 5, 6, 7]), 'fork creates a child process, where the parent can wait for the child process with HYPSTER')
def check_fork_wait_exit() -> List[Check]: return check_mipster_execution('sum-exit-code.c', 28, 'exit code is returned as status parameter from wait with MIPSTER') + \ check_hypster_execution('sum-exit-code.c', 28, 'exit code is returned as status parameter from wait with HYPSTER') + \ check_mipster_execution('unmapped-page-wait.c', 42, 'wait system call maps page to unmapped virtual address') + \ check_mipster_execution('invalid-address.c', 42, 'wait system call correctly handles invalid addresses') + \ check_mipster_execution('null-ptr.c', 42, 'wait system call returns PID when NULL is passed')
def check_fork_wait_exit() -> List[Check]: return check_compilable('sum-exit-code.c', 'fork and wait compiled') + \ check_mipster_execution('sum-exit-code.c', 28, 'exit code is returned as status parameter from wait with MIPSTER') + \ check_hypster_execution('sum-exit-code.c', 28, 'exit code is returned as status parameter from wait with HYPSTER')