This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/3] add testcases for function definitions


On 11/11/2015 08:03 AM, Frank Ch. Eigler wrote:
> I think the more basic problem is the general pattern of these test
> cases, where multiple identical messages are printed to report subtest
> status.  In a more ideal world, instead of:
> 
> systemtap starting probe
> systemtap ending probe
> systemtap test success
> systemtap test success
> systemtap test success
> systemtap test success
> 
> those .stp scripts that can self-diagnose should say simply:
> 
> success
> or
> failure (detail)
> 
> those .stp scripts that cannot self-diagnose should say simply:
> 
> result1 FOO
> result2 BAR
> result3 ZOO
> 
> No "systemtap" / "starting" / "ending" boilerplate is needed; nor
> repeated lines whose counting is critical.

stap_run.exp is probably too complicated. I've attached a small patch to
it that tries to catch any "extra" output. Note that I haven't tried
running the entire testsuite with this patch to see if this breaks anything.

The starting/ending boilerplate doesn't really bother me, but I think we
should modify all the scripts to only print one success/fail line (which
Zhou Wenjian suggested several messages back). That is going to be
simple to test for, but a little more complicated in the test script
itself (but not too bad).

We should also switch the "all_pass_string" to only be one copy of the
"success" string.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp
index dab8e06..dc03d65 100644
--- a/testsuite/lib/stap_run.exp
+++ b/testsuite/lib/stap_run.exp
@@ -90,8 +90,14 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args }
 			-re $warning_regexp {
 			    set probe_errors $expect_out(1,string)
 			    set skipped_probes $expect_out(2,string)}
+			default {
+			    fail "$TEST_NAME unexpected output (after passing output)"
+			}
 		    }
 		}
+		default {
+		    fail "$TEST_NAME unexpected output"
+		}
 		timeout { 
                     fail "$TEST_NAME shutdown (timeout)"
                     kill -INT -[exp_pid]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]