From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16727 invoked by alias); 26 Mar 2008 01:43:40 -0000 Received: (qmail 16718 invoked by uid 22791); 26 Mar 2008 01:43:39 -0000 X-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_47,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Mar 2008 01:43:22 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m2Q1hKY3016171 for ; Tue, 25 Mar 2008 21:43:20 -0400 Received: from pobox-3.corp.redhat.com (pobox-3.corp.redhat.com [10.11.255.67]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2Q1hK0a022881 for ; Tue, 25 Mar 2008 21:43:20 -0400 Received: from localhost.localdomain (vpn-14-107.rdu.redhat.com [10.11.14.107]) by pobox-3.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2Q1hJMr001410 for ; Tue, 25 Mar 2008 21:43:20 -0400 Message-ID: <47E9AA37.3080908@redhat.com> Date: Wed, 26 Mar 2008 01:43:00 -0000 From: Nurdin Premji User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: frysk Subject: How to send signals to test programs? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q1/txt/msg00180.txt.bz2 Trying to create a test for stepping over and through signals. I have a simple the test program and I'm copying testcases from frysk-core/frysk/stepping/TestStepping.java How do I send a signal to my test program from the TestStepping test? Thank you, Nurdin funit-signal.c: #include #include #include #include volatile int j = 0; void catch_usr (int sig_num) { signal(SIGUSR1, catch_usr); // _signalSigHandlerEntry_ --j; ++j; } int main ( int argc, char *argv[]) { signal(SIGUSR1, catch_usr); --j; // _startTestEntry_ ++j; return 0; } TestStepping.java addition: public void testStepThroughSignal() { /** Variable setup */ String source = Config.getRootSrcDir() + "frysk-core/frysk/pkglibdir/funit-signal.c"; this.scanner = new TestfileTokenScanner(new File(source)); /* The line number where the test begins */ int start = this.scanner.findTokenLine("_startTestEntry_"); /* The line number the test should end up at */ int end = this.scanner.findTokenLine("_signalSigHandlerEntry_"); /* The test process */ SynchronizedOffspring process = new SynchronizedOffspring(Signal.USR1, new String[] { getExecPath("funit-signal") }); this.testStarted = false; /** Test initialization */ Task myTask = initTask(process, source, start, end); this.currentTest = new AssertLine(end, myTask); DebugInfoFrame frame = DebugInfoStackFactory .createDebugInfoStackTrace(myTask); assertTrue("Line information present", frame.getLine() != SourceLocation.UNKNOWN); /** The stepping operation */ this.se.stepLine(myTask); /* TODO: Send Signal to myTask */ this.testStarted = true; /** Run to completion */ assertRunUntilStop("Running test"); cleanup(); }