From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6836 invoked by alias); 1 Jun 2008 05:43:04 -0000 Received: (qmail 6809 invoked by uid 9519); 1 Jun 2008 05:43:03 -0000 Date: Sun, 01 Jun 2008 05:43:00 -0000 Message-ID: <20080601054303.6794.qmail@sourceware.org> From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Fix Load/Unload tests, fix UnloadCommand to use correct printLoop method. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: d96a22500414adf1644bc6fd0628c8f61ad5341d X-Git-Newrev: 0aeb3adfa7c2316dcf663be037bc1338c1321653 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q2/txt/msg00312.txt.bz2 The branch, master has been updated via 0aeb3adfa7c2316dcf663be037bc1338c1321653 (commit) from d96a22500414adf1644bc6fd0628c8f61ad5341d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 0aeb3adfa7c2316dcf663be037bc1338c1321653 Author: Rick Moseley Date: Sun Jun 1 00:40:53 2008 -0500 Fix Load/Unload tests, fix UnloadCommand to use correct printLoop method. * TestUnloadCommand.java: New. * TestLoadCommand.java: Fix arg listing error. * UnloadCommand.java: Use printLoop in LoadCommand. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/hpd/ChangeLog | 6 +++ frysk-core/frysk/hpd/TestLoadCommand.java | 10 ++++- frysk-core/frysk/hpd/TestUnloadCommand.java | 61 +++++++++++++++++++++++++++ frysk-core/frysk/hpd/UnloadCommand.java | 2 +- 4 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 frysk-core/frysk/hpd/TestUnloadCommand.java First 500 lines of diff: diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index c11876d..0b67fba 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,9 @@ +2008-06-01 Rick Moseley + + * TestUnloadCommand.java: New. + * TestLoadCommand.java: Fix arg listing error. + * UnloadCommand.java: Use printLoop in LoadCommand. + 2008-05-30 Rick Moseley * InfoArgsCommand.java: Updated how args are gotten. diff --git a/frysk-core/frysk/hpd/TestLoadCommand.java b/frysk-core/frysk/hpd/TestLoadCommand.java index 04d6618..199030d 100644 --- a/frysk-core/frysk/hpd/TestLoadCommand.java +++ b/frysk-core/frysk/hpd/TestLoadCommand.java @@ -114,14 +114,20 @@ public class TestLoadCommand extends TestLib { public void testLoadExeArg() { e = new HpdTestbed(); - e.sendCommandExpectPrompt("load arg0 arg1 -exe /bin/ls", + e.sendCommandExpectPrompt("load /bin/ls arg0 arg1", "/bin/ls\r\n"); - e.sendCommandExpectPrompt("info args", "arg0\r\n" + "arg1\r\n"); + e.sendCommandExpectPrompt("info args", "The args.*/bin/ls.*arg0.*arg1.*"); e.sendCommandExpectPrompt("info exe", "/bin/ls\r\n"); + e.send("quit\n"); + e.expect("Quitting\\.\\.\\."); + e.close(); } public void testLoadPath() { e = new HpdTestbed(); e.sendCommandExpectPrompt("load ls", "/bin/ls\r\n"); + e.send("quit\n"); + e.expect("Quitting\\.\\.\\."); + e.close(); } } diff --git a/frysk-core/frysk/hpd/TestUnloadCommand.java b/frysk-core/frysk/hpd/TestUnloadCommand.java new file mode 100644 index 0000000..e8cf5b4 --- /dev/null +++ b/frysk-core/frysk/hpd/TestUnloadCommand.java @@ -0,0 +1,61 @@ +// This file is part of the program FRYSK. +// +// Copyright 2007, 2008 Red Hat Inc. +// +// FRYSK is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation; version 2 of the License. +// +// FRYSK is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with FRYSK; if not, write to the Free Software Foundation, +// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// In addition, as a special exception, Red Hat, Inc. gives You the +// additional right to link the code of FRYSK with code not covered +// under the GNU General Public License ("Non-GPL Code") and to +// distribute linked combinations including the two, subject to the +// limitations in this paragraph. Non-GPL Code permitted under this +// exception must only link to the code of FRYSK through those well +// defined interfaces identified in the file named EXCEPTION found in +// the source code files (the "Approved Interfaces"). The files of +// Non-GPL Code may instantiate templates or use macros or inline +// functions from the Approved Interfaces without causing the +// resulting work to be covered by the GNU General Public +// License. Only Red Hat, Inc. may make changes or additions to the +// list of Approved Interfaces. You must obey the GNU General Public +// License in all respects for all of the FRYSK code and other code +// used in conjunction with FRYSK except the Non-GPL Code covered by +// this exception. If you modify this file, you may extend this +// exception to your version of the file, but you are not obligated to +// do so. If you do not wish to provide this exception without +// modification, you must delete this exception statement from your +// version and license this file solely under the GPL without +// exception. + +package frysk.hpd; + +import frysk.config.Prefix; + +/** + * This class tests the "unload" command basics of both loading a correct + * executable and trying to unload a non-existent executable. + */ + +public class TestUnloadCommand extends TestLib { + public void testUnloadDisplay() { + e = new HpdTestbed(); + e.sendCommandExpectPrompt("load " + Prefix.pkgLibFile("funit-threads-looper").getPath(), + "\\[0\\.0\\] Loaded executable file.*"); + e.sendCommandExpectPrompt("load " + Prefix.pkgLibFile("funit-hello").getPath(), + "\\[1\\.0\\] Loaded executable file.*"); + e.sendCommandExpectPrompt("unload", "Loaded Procs.*\\[0\\.0\\].*looper.*\\[1\\.0\\].*hello.*"); + e.send("quit\n"); + e.expect("Quitting\\.\\.\\."); + e.close(); + } +} \ No newline at end of file diff --git a/frysk-core/frysk/hpd/UnloadCommand.java b/frysk-core/frysk/hpd/UnloadCommand.java index 26f9485..0e4c056 100644 --- a/frysk-core/frysk/hpd/UnloadCommand.java +++ b/frysk-core/frysk/hpd/UnloadCommand.java @@ -73,7 +73,7 @@ public class UnloadCommand extends ParameterizedCommand { throw new InvalidCommandException("Too many parameters"); } else if (cmd.size() < 1 && !cli.loadedProcs.isEmpty()) { // List the loaded procs if no parameters entered - ViewsetCommand.printLoop(cli.targetset, cli, "Target set", true); + LoadCommand.printLoop(cli, "Loaded Procs", cli.loadedProcs); return; } else if (cmd.size() < 1 && cli.loadedProcs.isEmpty()) { cli.addMessage("No loaded procs currently, must load a proc before unloading", hooks/post-receive -- frysk system monitor/debugger