Skip to content
Tim Watson edited this page Jun 4, 2013 · 5 revisions

#Module systest#

This is the primary interface to the SysTest application.

##Description## ----------------------------------------------------------------------------

##Function Index##

activate_process/1 Activates a process that has been configured to postpone startup (viz the process activate_on_start config key).
config/1 attempts to lookup the supplied key - see systest_config:get_config/1.
env/1 attempts to lookup the supplied environment variable - see systest_config:get_env/1.
get_system_under_test/0 Returns the System Under Test associated with the current session.
get_system_under_test/1 Returns the System Under Test associated with the supplied configuration.
kill_after/2 Sets up a timer that will kill the Process once it expires, and returns immediately.
kill_and_wait/1 Kills the Process and waits until it has fully stopped.
kill_no_wait/1 Stops the Systest (Operating) Process ProcRef
list_processes/1 Lists all Processes that are part of the given System Under Test
log/1
log/2
log_sut_info/1
print_sut_info/1
process_activity_state/1 Returns the activity_state flag for the supplied Process - the the systest_proc documentation for further details.
process_data/2 Returns data for the required Field from a Process record or ProcRef.
read_process_user_data/1 Returns any configured user-data from the given Process.
reset/0 resets the application state.
restart_process/2 Restarts the specified Process, which must be registered with the supplied reference to a System Under Test.
settings/0 lists all installed settings for the current test run.
settings/1 searches for the supplied Key in the current settings.
sigkill/1 Sends a SIGKILL signal to the provided (OS) process id.
start/0 Starts the systest OTP application.
start/2 starts any resources associated with the given scope.
start/3 starts any resources associated with the given scope, using the provided identity when registering them with the testing framework.
start_suite/2 starts any resources associated with the supplied Suite.
stop/0
stop/1 politely asks any resources associated with the given scope to stop, given them time to clean up and exit without causing any test case to fail.
stop_and_wait/1 Instructs the Process to stop and waits until it has completed its shutdown and fully stopped.
stop_no_wait/1 Stops the Systest (Operating) Process ProcRef
stop_scope/2 immediately stops any resources associated with the supplied Scope.
trace_off/1 Disables trace debugging.
trace_on/2 Enables trace debugging.
write_process_user_data/2 Writes the given data (term) to the indicated Process.

##Function Details##

###activate_process/1##

activate_process(ProcRef) -> any()

Activates a process that has been configured to postpone startup (viz the process activate_on_start config key).

###config/1##

config(Key) -> any()

attempts to lookup the supplied key - see systest_config:get_config/1

###env/1##

env(Key) -> any()

attempts to lookup the supplied environment variable - see systest_config:get_env/1

###get_system_under_test/0##

get_system_under_test() -> any()

Returns the System Under Test associated with the current session. This call is only valid for standalone, shell and debug test runners. To obtain the sut for a common_test run, use get_system_under_test/1 instead.

###get_system_under_test/1##

get_system_under_test(Config) -> any()

Returns the System Under Test associated with the supplied configuration. NB: this function fails the activetest case if no SUT is registered with the supplied Config!

###kill_after/2##

kill_after(Timeout, Target) -> any()

Sets up a timer that will kill the Process once it expires, and returns immediately. Killing a Process in this way does not cause a test case to fail, as the System Under Test handler is informed that the shutdown is expected.

###kill_and_wait/1##

kill_and_wait(ProcRef) -> any()

Kills the Process and waits until it has fully stopped. Killing a Process in this way does not cause a test case to fail, as the System Under Test handler is informed that the shutdown is expected.

###kill_no_wait/1##

kill_no_wait(ProcRef) -> any()

Stops the Systest (Operating) Process ProcRef

###list_processes/1##

list_processes(SutRef) -> any()

Lists all Processes that are part of the given System Under Test

###log/1##

log(Message) -> any()

###log/2##

log(Format, Args) -> any()

###log_sut_info/1##

log_sut_info(SUT) -> any()

###print_sut_info/1##

print_sut_info(SUT) -> any()

###process_activity_state/1##

process_activity_state(ProcRef) -> any()

Returns the activity_state flag for the supplied Process - the the systest_proc documentation for further details.

###process_data/2##

process_data(Field, ProcRec) -> any()

Returns data for the required Field from a Process record or ProcRef. The version of this function taking a proc record is intended for use in handler/user callbacks, whilst the version that takes a process identifier (pid) is intended for remote calls.

###read_process_user_data/1##

read_process_user_data(ProcRef) -> any()

Returns any configured user-data from the given Process.

###reset/0##

reset() -> any()

resets the application state

###restart_process/2##

restart_process(SutRef, ProcRef) -> any()

Restarts the specified Process, which must be registered with the supplied reference to a System Under Test.

###settings/0##

settings() -> any()

lists all installed settings for the current test run.

###settings/1##

settings(Key) -> any()

searches for the supplied Key in the current settings

###sigkill/1##

sigkill(Pid) -> any()

Sends a SIGKILL signal to the provided (OS) process id

###start/0##

start() -> any()

Starts the systest OTP application.

###start/2##

start(Scope, Config) -> any()

starts any resources associated with the given scope

###start/3##

start(Scope, Identity, Config) -> any()

starts any resources associated with the given scope, using the provided identity when registering them with the testing framework

###start_suite/2##

start_suite(Suite, Config) -> any()

starts any resources associated with the supplied Suite.

###stop/0##

stop() -> any()

###stop/1##

stop(Scope) -> any()

politely asks any resources associated with the given scope to stop, given them time to clean up and exit without causing any test case to fail

###stop_and_wait/1##

stop_and_wait(ProcRef) -> any()

Instructs the Process to stop and waits until it has completed its shutdown and fully stopped. Stopping a Process in this way does not cause a test case to fail, as the System Under Test handler is informed that the shutdown is expected.

###stop_no_wait/1##

stop_no_wait(ProcRef) -> any()

Stops the Systest (Operating) Process ProcRef

###stop_scope/2##

stop_scope(Scope, Timeout) -> any()

immediately stops any resources associated with the supplied Scope

###trace_off/1##

trace_off(Config) -> any()

Disables trace debugging. See the Tracing/Debugging Guide for more details.

###trace_on/2##

trace_on(Scope, Config) -> any()

Enables trace debugging. See the Tracing/Debugging Guide for more details.

###write_process_user_data/2##

write_process_user_data(ProcRef, Data) -> any()

Writes the given data (term) to the indicated Process.