################################################################################ How to Build: 1. command line options: - EXTRA_DEBUG_MSG, . to print extra debugging message or not. It takes 'yes' as enable, . while any other value will be taken as disable - CROSS_COMPILE, . to specify cross compilation toolchain. . Eg. CROSS_COMPILE=arm-linux-gnueabi- - FAKE_ETB, . whether to use fake ETB node. It takes 'yes' as enable, . while any other value will be taken as disable. . In case of 'yes', there must be a file node name 'ETB' in directory "./debug_stm/", with at least one line of content. . Refer to definition in source code: const char *ETB_FILEPATH = "./debug_stm/ETB"; . Eg. # cat ./debug_stm/ETB Hello world, async 2. Build command (examples): - To build for local machine with extra debug message enabled: . make EXTRA_DEBUG_MSG=yes stm_test - To build for ARM platform with extra debug message enabled: . make EXTRA_DEBUG_MSG=yes CROSS_COMPILE=arm-linux-gnueabi- stm_test - To build for ARM platform with extra debug message enabled, and using fake ETB file . make EXTRA_DEBUG_MSG=yes CROSS_COMPILE=arm-linux-gnueabi- FAKE_ETB=yes stm_test 3. Build command for unit tests: - make EXTRA_DEBUG_MSG=yes param_test . to test param_array.c - make EXTRA_DEBUG_MSG=yes async_test . to test async_veri.c - make EXTRA_DEBUG_MSG=yes redtty_test . to test redirect_ttyprintk.c 4. redtty_test is a useful tool to assist STM Dummy driver testing. It uses /dev/ttyprintk as the message output channel for STM Dummy device. When enabled (./redtty_test on), all message to STM Dummy driver will be redirect to /dev/ttyprintk, who will then write these message to kernel log. And user can view these messages using kernel log tool, such as dmesg. Usage: please run ./redtty_test with no args: $ ./redtty_test ################################################################################ How to use: There are two modes of using this test application. Mode 1: to send one command in commandline each time. Eg: # ./stm_test info Mode 2: The other is to get batch of commmands from standard input. Eg: # ./stm_test < test_input.scp ################################################################################ To get usage: Launch stm_test with no arguments. This can provide a list of all STM test commands this program currently supports. You can use these commands to write test script files, like explained in next sections. Eg: # ./stm_test The following commands are supported: create_chan info chan_info send_msg rm_chan config_chan More details, (explanation comes from main.c) create_chan: * to create one STM channel * SYNOPSIS: create_chan CHANNEL_NAME info: * to get general STM information by reading /stm/request * SYNOPSIS: info chan_info: * to get channel information by reading /stm/_config * SYNOPSIS: chan_info CHANNEL_NAME send_msg: * to send a message to a user channel * SYNOPSIS: send_msg CHANNEL_NAME MESSAGE rm_chan: * to remove one STM channel * SYNOPSIS: rm_chan CHANNEL_NAME config_chan: * to send command to channel's config file * SYNOPSIS: config_chan CHANNEL_NAME COMMAND ################################################################################ Example test script files: For Mode 1: # ./shell_test.scp For Mode 2: # ./stm_test < test_input2.scp >> File contents here << $ cat shell_test.scp ./stm_test info read ./stm_test create_chan my read ./stm_test info read ./stm_test chan_info my read ./stm_test send_msg my "hello world, kitty" read ./stm_test send_msg my "good bye" read ./stm_test chan_info my read ./stm_test rm_chan my read ./stm_test info read ./stm_test create_chan my2d read ./stm_test config_chan my2d chn_disable read ./stm_test send_msg my2d hxx read ./stm_test config_chan my2d chn_enable read ./stm_test send_msg my2d hxx read ./stm_test chan_info my2d read ./stm_test rm_chan my2d read ./stm_test info $ cat test_input2.scp info create_chan my info chan_info my send_msg my "hello world, kitty" send_msg my "good bye" chan_info my rm_chan my info