User-facing API for use within an assignment test case for: Interacting with or querying data for the student's assembled binary Test result collection (requirements, pass/fail cases) Performing any other esoteric test-related action.
More...
#include <test_context.hpp>
User-facing API for use within an assignment test case for: Interacting with or querying data for the student's assembled binary Test result collection (requirements, pass/fail cases) Performing any other esoteric test-related action.
◆ TestContext()
◆ create_buffer()
template<std::size_t NumBytes>
AsmBuffer< NumBytes > asmgrader::TestContext::create_buffer |
( |
| ) |
|
Create a buffer of NumBytes
◆ exec_syscall()
Result< SyscallRecord > asmgrader::TestContext::exec_syscall |
( |
u64 | sys_nr, |
|
|
std::array< std::uint64_t, 6 > | args ) |
◆ finalize()
Obtain the final test results Run after the test is complete. Note: has no ill effects if run before test is complete.
◆ find_function()
template<typename Func >
AsmFunction< Func > asmgrader::TestContext::find_function |
( |
std::string | name | ) |
|
Find a named function in the associated program.
◆ find_symbol()
template<typename T >
AsmSymbol< T > asmgrader::TestContext::find_symbol |
( |
std::string_view | name | ) |
|
Find a named symbol in the associated program.
- Template Parameters
-
T | type of data that the symbol refers to |
◆ flush_stdin()
std::size_t asmgrader::TestContext::flush_stdin |
( |
| ) |
|
Flushes any reamaining unread data in the stdin buffer Returns: number of bytes flushed, or error kind if failure occured.
◆ get_full_stdout()
std::string asmgrader::TestContext::get_full_stdout |
( |
| ) |
|
Get all stdout from since the beginning of the test invokation.
◆ get_name()
std::string_view asmgrader::TestContext::get_name |
( |
| ) |
const |
◆ get_registers()
Get the current register state of the program.
◆ get_stdout()
std::string asmgrader::TestContext::get_stdout |
( |
| ) |
|
Get any new stdout from the program since the last call to this function.
◆ get_syscall_records()
const std::vector< SyscallRecord > & asmgrader::TestContext::get_syscall_records |
( |
| ) |
const |
Obtain a list of the syscalls that have been executed so far.
◆ require() [1/2]
◆ require() [2/2]
◆ restart_program()
void asmgrader::TestContext::restart_program |
( |
| ) |
|
Restarts the entire program.
Note: if the asm executable has changed, this will launch with the NEW executable Important: this has the almost certain effect of invalidating all buffers or other addressable references to said program, as the address space WILL change
◆ run()
Run the program normally from _start
◆ send_stdin()
void asmgrader::TestContext::send_stdin |
( |
const std::string & | input | ) |
|
Get any new stdout from the program since the last call to this function.
The documentation for this class was generated from the following files: