summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall/README
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.syscall/README')
-rw-r--r--testsuite/systemtap.syscall/README52
1 files changed, 52 insertions, 0 deletions
diff --git a/testsuite/systemtap.syscall/README b/testsuite/systemtap.syscall/README
new file mode 100644
index 00000000..41e6d895
--- /dev/null
+++ b/testsuite/systemtap.syscall/README
@@ -0,0 +1,52 @@
+How these tests work:
+
+Dejagnu finds all *.c files, compiles them and runs them in a temporary
+directory while running the systemtap script sys.stp. To avoid
+recompiling sys.stp over and over, the test.exp is smart enough to
+compile sys.stp once and save the module.
+
+
+You can run all the tests here with
+> runtest test.exp
+
+You can run single tests with
+> gcc -o testname testname.c
+>./test.tcl testname
+
+OR, if you want to run multiple tests and don't want all the delays
+with recompiling sys.stp each time,
+
+> stap -kp4 sys.stp
+Keeping temporary directory "/tmp/stapPThTaQ"
+> ./test.tcl testname /tmp/stapPThTaQ/*.ko
+> ./test.tcl testname2 /tmp/stapPThTaQ/*.ko
+...
+> rm -rf /tmp/stapPThTaQ
+
+Finally, if you need to know why a test is failing, use
+"test-debug.tcl" exactly as above. After running the test, it will open a
+window with the results and expected results.
+
+
+
+HOW TO WRITE TESTS
+
+1. write a test case C file using some system calls.
+
+2. After each system call, put a comment on the next line starting with "//"
+The comment should have the expected output. Where an arbitrary number
+is expected, put "NNNN" (for decimal) or "XXXX" (for hex). Or you can
+just write regular expressions. The "NNNN" and "XXXX" are just shorthand to
+aid readability and are converted to regular expressions in test.tcl.
+
+3. Somewhere is your test program puts a comment line like this:
+/* COVERAGE: syscall1 syscall2 ... */
+where you list the systemcalls that are tested. Then you can run
+coverage.tcl and get a coverage report.
+
+You probably want to write your test case without the comments first. Make
+sure it compiles and works as expected. Then try it with
+"stap sys.stp -c ./testname" or test-debug.tcl to see the output.
+
+IMPORTANT: Note that the test scripts create a temporary directory for each
+test program. Each program will run in an empty directory.