This is the mail archive of the frysk-cvs@sources.redhat.com mailing list for the frysk 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]

[SCM] master: Clean up test processes.


The branch, master has been updated
       via  2e243654a18792a02b13c4ffa90261c5aa1867d7 (commit)
      from  7a7b1daa37efb9051540f89f92b27e4ed04d6f30 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 2e243654a18792a02b13c4ffa90261c5aa1867d7
Author: Andrew Cagney <cagney@redhat.com>
Date:   Thu Jan 24 17:56:33 2008 -0500

    Clean up test processes.
    
    frysk-core/frysk/bindir/ChangeLog
    2008-01-24  Andrew Cagney  <cagney@redhat.com>
    
    	* TestLib.java: New.
    	* TestFcore.java: Extend TestLib.
    	* TestFhd.java: Ditto.
    	* TestFauxv.java: Ditto.
    	* TestFexe.java: Ditto.
    	* TestFtrace.java: Ditto.
    	* TestFmaps.java: Ditto.
    	* TestFdebuginfo.java: Ditto.
    	* TestFStep.java: Ditto.
    	* TestFcatch.java: Ditto.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/bindir/ChangeLog                  |   11 ++
 frysk-core/frysk/bindir/TestFStep.java             |    9 +--
 frysk-core/frysk/bindir/TestFauxv.java             |    7 +-
 frysk-core/frysk/bindir/TestFcatch.java            |   24 +----
 frysk-core/frysk/bindir/TestFcore.java             |  105 +++++++++-----------
 frysk-core/frysk/bindir/TestFdebuginfo.java        |   59 ++++-------
 frysk-core/frysk/bindir/TestFexe.java              |   15 +---
 frysk-core/frysk/bindir/TestFhd.java               |   20 +---
 frysk-core/frysk/bindir/TestFmaps.java             |   17 ++--
 frysk-core/frysk/bindir/TestFtrace.java            |   77 ++++++---------
 .../frysk/bindir/{TestFexe.java => TestLib.java}   |   43 +++++----
 11 files changed, 157 insertions(+), 230 deletions(-)
 copy frysk-core/frysk/bindir/{TestFexe.java => TestLib.java} (77%)

First 500 lines of diff:
diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog
index a2f3f7a..426ffe9 100644
--- a/frysk-core/frysk/bindir/ChangeLog
+++ b/frysk-core/frysk/bindir/ChangeLog
@@ -4,6 +4,17 @@
 
 2008-01-24  Andrew Cagney  <cagney@redhat.com>
 
+	* TestLib.java: New.
+	* TestFcore.java: Extend TestLib.
+	* TestFhd.java: Ditto.
+	* TestFauxv.java: Ditto.
+	* TestFexe.java: Ditto.
+	* TestFtrace.java: Ditto.
+	* TestFmaps.java: Ditto.
+	* TestFdebuginfo.java: Ditto.
+	* TestFStep.java: Ditto.
+	* TestFcatch.java: Ditto.
+
 	* TestFmaps.java: Update; CoreFileAtSignal renamed to
 	CorefileFactory.
 	* TestFstack.java: Ditto.
diff --git a/frysk-core/frysk/bindir/TestFStep.java b/frysk-core/frysk/bindir/TestFStep.java
index 20cfde6..bde2a24 100644
--- a/frysk-core/frysk/bindir/TestFStep.java
+++ b/frysk-core/frysk/bindir/TestFStep.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2007, Red Hat Inc.
+// 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
@@ -42,14 +42,9 @@ package frysk.bindir;
 
 import frysk.Config;
 import frysk.expunit.*;
-
-import frysk.testbed.TestLib;
-
 import lib.dwfl.*;
 
-public class TestFStep
-  extends TestLib
-{
+public class TestFStep extends TestLib {
   // Makes sure that fstep at least comes across the entry point of the
   // stepped program.
   public void testFirstStep() throws Exception
diff --git a/frysk-core/frysk/bindir/TestFauxv.java b/frysk-core/frysk/bindir/TestFauxv.java
index af60ef9..a8d1030 100644
--- a/frysk-core/frysk/bindir/TestFauxv.java
+++ b/frysk-core/frysk/bindir/TestFauxv.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2007, Red Hat Inc.
+// 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
@@ -39,15 +39,12 @@
 
 package frysk.bindir;
 
-import frysk.junit.TestCase;
 import frysk.expunit.Expect;
 import frysk.Config;
 import java.io.File;
 import frysk.testbed.TearDownExpect;
 
-public class TestFauxv
-    extends TestCase
-{
+public class TestFauxv extends TestLib {
     
     private Expect fauxv(File coreFile) {
 	String[] argv = new String[2];
diff --git a/frysk-core/frysk/bindir/TestFcatch.java b/frysk-core/frysk/bindir/TestFcatch.java
index 28262b5..d95e779 100644
--- a/frysk-core/frysk/bindir/TestFcatch.java
+++ b/frysk-core/frysk/bindir/TestFcatch.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2007, Red Hat Inc.
+// 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
@@ -42,26 +42,14 @@ package frysk.bindir;
 
 import frysk.Config;
 import frysk.expunit.Expect;
-import frysk.junit.TestCase;
 
-public class TestFcatch
-    extends TestCase
-{
-  Expect e;
-
-    public void testBackTrace () {
+public class TestFcatch extends TestLib {
+    public void testBackTrace() {
 	e = new Expect(new String[] {
-			   Config.getBinFile("fcatch").getAbsolutePath(),
-			   Config.getPkgLibFile("funit-stackframe").getAbsolutePath()
-		       });
+		Config.getBinFile("fcatch").getAbsolutePath(),
+		Config.getPkgLibFile("funit-stackframe").getAbsolutePath()
+	    });
 	// just look for main.
 	e.expect(" in main ");
     }
-
-  public void tearDown ()
-  {
-    if (e != null)
-      e.close();
-    e = null;
-  }
 }
diff --git a/frysk-core/frysk/bindir/TestFcore.java b/frysk-core/frysk/bindir/TestFcore.java
index ba34aa2..8cec521 100644
--- a/frysk-core/frysk/bindir/TestFcore.java
+++ b/frysk-core/frysk/bindir/TestFcore.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2006, 2007, Red Hat Inc.
+// Copyright 2006, 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
@@ -39,88 +39,77 @@
 
 package frysk.bindir;
 
-import frysk.junit.TestCase;
 import frysk.expunit.Expect;
 import frysk.Config;
 
-public class TestFcore
-    extends TestCase
-{
-    Expect e;
-    public void tearDown ()
-    {
-	if (e != null)
-	    e.close ();
-	e = null;
-    }
-    
+public class TestFcore extends TestLib {
     public void testNoArguments() {
-	e = new Expect (Config.getBinFile("fcore"));
-	e.expect ("Error: No pid provided.");      
+	e = new Expect(Config.getBinFile("fcore"));
+	e.expect("Error: No pid provided.");      
     }
 
     public void testBadArguments () {
-	e = new Expect (new String[] {
-			    Config.getBinFile("fcore").getAbsolutePath (),
-			    "this is a bad argument"
-			});
-	e.expect ("Error: Commands not supported.");
+	e = new Expect(new String[] {
+		Config.getBinFile("fcore").getAbsolutePath (),
+		"this is a bad argument"
+	    });
+	e.expect("Error: Commands not supported.");
     }
 
     public void testBadConsoleParameter () {
-	e = new Expect (new String[] {
-			    Config.getBinFile("fcore").getAbsolutePath (),
-			    "-console", "frysk=SILLY",
-			    "1"
-			});
-	e.expect ("fcore: Invalid log console: SILLY");
+	e = new Expect(new String[] {
+		Config.getBinFile("fcore").getAbsolutePath (),
+		"-console", "frysk=SILLY",
+		"1"
+	    });
+	e.expect("fcore: Invalid log console: SILLY");
     }
 
     public void testBadLogParameter () {
-	e = new Expect (new String[] {
-			    Config.getBinFile("fcore").getAbsolutePath (),
-			    "-log", "frysk=SILLY",
-			    "1"
-			});
-	e.expect ("fcore: Invalid log level: SILLY");
+	e = new Expect(new String[] {
+		Config.getBinFile("fcore").getAbsolutePath (),
+		"-log", "frysk=SILLY",
+		"1"
+	    });
+	e.expect("fcore: Invalid log level: SILLY");
     }
 
     public void testGoodConsoleBadLogParameter () {
-	e = new Expect (new String[] {
-			    Config.getBinFile("fcore").getAbsolutePath (),
-			    "-console", "frysk=FINE",
-			    "-log", "frysk=SILLY",
-			    "1"
-			});
+	e = new Expect(new String[] {
+		Config.getBinFile("fcore").getAbsolutePath (),
+		"-console", "frysk=FINE",
+		"-log", "frysk=SILLY",
+		"1"
+	    });
 	e.expect ("fcore: Invalid log level: SILLY");
     }
 
     public void testBadConsoleBadLogParameter () {
-	e = new Expect (new String[] {
-			    Config.getBinFile("fcore").getAbsolutePath (),
-			    "-console", "frysk=SILLY",
-			    "-log", "frysk=SILLY",
-			    "1"
-			});
-	e.expect ("fcore: Invalid log console: SILLY");
+	e = new Expect(new String[] {
+		Config.getBinFile("fcore").getAbsolutePath (),
+		"-console", "frysk=SILLY",
+		"-log", "frysk=SILLY",
+		"1"
+	    });
+	e.expect("fcore: Invalid log console: SILLY");
     }
 
     public void testBadConsoleGoodLogParameter () {
-	e = new Expect (new String[] {
-			    Config.getBinFile("fcore").getAbsolutePath (),
-			    "-console", "frysk=SILLY",
-			    "-log", "frysk=FINE",
-			    "1"
-			});
-	e.expect ("fcore: Invalid log console: SILLY");
+	e = new Expect(new String[] {
+		Config.getBinFile("fcore").getAbsolutePath (),
+		"-console", "frysk=SILLY",
+		"-log", "frysk=FINE",
+		"1"
+	    });
+	e.expect("fcore: Invalid log console: SILLY");
     }
 
     public void testInvalidArgument () {
-	e = new Expect (new String[] {
-			    Config.getBinFile("fcore").getAbsolutePath (),
-			    "-z",
-			    "1"
-			});
-	e.expect ("fcore: unrecognized option");
+	e = new Expect(new String[] {
+		Config.getBinFile("fcore").getAbsolutePath (),
+		"-z",
+		"1"
+	    });
+	e.expect("fcore: unrecognized option");
     }
 }
diff --git a/frysk-core/frysk/bindir/TestFdebuginfo.java b/frysk-core/frysk/bindir/TestFdebuginfo.java
index 185c375..26e7048 100644
--- a/frysk-core/frysk/bindir/TestFdebuginfo.java
+++ b/frysk-core/frysk/bindir/TestFdebuginfo.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2007, Red Hat Inc.
+// 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
@@ -42,64 +42,47 @@ package frysk.bindir;
 import frysk.Config;
 import frysk.expunit.Expect;
 import frysk.proc.Task;
-import frysk.testbed.TestLib;
 import frysk.testbed.SlaveOffspring;
 
 /**
  * This tests the basic functionality of the fdebuginfo
  * utility.
  */
-public class TestFdebuginfo
-    extends TestLib
-{
-    Expect e;
-    
-    public void tearDown ()
-    {
-	if (e != null)
-	    e.close ();
-	e = null;
-    }    
+public class TestFdebuginfo extends TestLib {
 
-    public void testPathListing ()
-    {
+    public void testPathListing() {
         // Create an unattached child process.
 	SlaveOffspring child = SlaveOffspring.createChild();
 	Task task = child.findTaskUsingRefresh(true);
-
 	e = new Expect(new String[] {
-		       Config.getBinFile("fdebuginfo").getAbsolutePath(),
-					      ""+task.getProc().getPid() 
-	});
+		Config.getBinFile("fdebuginfo").getAbsolutePath(),
+		""+task.getProc().getPid() 
+	    });
 	// Look for the path of executable
 	e.expect(task.getProc().getExe());	
     }
     
-    public void testNoArguments()
-    {
-        e = new Expect (new String[] { 
-                        Config.getBinFile("fdebuginfo").getAbsolutePath ()
-        });
-                  
-        e.expect ("Error: No pid provided.");      
+    public void testNoArguments() {
+        e = new Expect(new String[] { 
+		Config.getBinFile("fdebuginfo").getAbsolutePath ()
+	    });
+        e.expect("Error: No pid provided.");      
     }    
 
-    public void testBadArguments ()
-    {
-	e = new Expect (new String[] {
+    public void testBadArguments() {
+	e = new Expect(new String[] {
 		Config.getBinFile("fdebuginfo").getAbsolutePath (),
-	    "this is a bad argument"
-	});
-	e.expect ("Error: Commands not supported.");
+		"this is a bad argument"
+	    });
+	e.expect("Error: Commands not supported.");
     }
     
-    public void testInvalidArgument ()
-    {
+    public void testInvalidArgument() {
 	e = new Expect (new String[] {
 		Config.getBinFile("fdebuginfo").getAbsolutePath (),
-	    "-z",
-	    "1"
-	});
-	e.expect ("fdebuginfo: unrecognized option");
+		"-z",
+		"1"
+	    });
+	e.expect("fdebuginfo: unrecognized option");
     }    
 }    
diff --git a/frysk-core/frysk/bindir/TestFexe.java b/frysk-core/frysk/bindir/TestFexe.java
index adb9a70..d29324f 100644
--- a/frysk-core/frysk/bindir/TestFexe.java
+++ b/frysk-core/frysk/bindir/TestFexe.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2007, Red Hat Inc.
+// 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
@@ -39,25 +39,14 @@
 
 package frysk.bindir;
 
-import frysk.junit.TestCase;
 import frysk.expunit.Expect;
 import frysk.Config;
 import java.io.File;
 
-public class TestFexe
-    extends TestCase
-{
-    Expect e;
-    public void tearDown () {
-	if (e != null)
-	    e.close ();
-	e = null;
-    }
-    
+public class TestFexe extends TestLib {
     public void testExeOfPid() {
 	File fexe = Config.getBinFile("fexe");
 	e = new Expect(fexe.getAbsolutePath () + " $$");
 	e.expect(fexe + "\r\n");
     }
-
 }
diff --git a/frysk-core/frysk/bindir/TestFhd.java b/frysk-core/frysk/bindir/TestFhd.java
index 1cfe4d7..0749af7 100755
--- a/frysk-core/frysk/bindir/TestFhd.java
+++ b/frysk-core/frysk/bindir/TestFhd.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2006, 2007, Red Hat Inc.
+// Copyright 2006, 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
@@ -41,7 +41,6 @@ package frysk.bindir;
 
 import frysk.Config;
 import frysk.expunit.Expect;
-import frysk.testbed.TestLib;
 
 /**
  * This performs a "sniff" test of Fstack, confirming basic
@@ -50,21 +49,8 @@ import frysk.testbed.TestLib;
  * For more specific tests see frysk.hpd.
  */
 
-public class TestFhd
-  extends TestLib
-{
-  Expect e;
-  Expect child;
-  String prompt = "\\(fhpd\\) ";
-  public void tearDown ()
-  {
-    if (e != null)
-      e.close ();
-    e = null;
-    if (child != null)
-      child.close ();
-    child = null;
-  }
+public class TestFhd extends TestLib {
+    String prompt = "\\(fhpd\\) ";
   
     public void testHpdPid () {
 	child = new Expect(Config.getPkgLibFile("hpd-c"));
diff --git a/frysk-core/frysk/bindir/TestFmaps.java b/frysk-core/frysk/bindir/TestFmaps.java
index 802bc9a..64f540f 100644
--- a/frysk-core/frysk/bindir/TestFmaps.java
+++ b/frysk-core/frysk/bindir/TestFmaps.java
@@ -39,22 +39,19 @@
 
 package frysk.bindir;
 
-import frysk.junit.TestCase;
 import frysk.expunit.Expect;
 import frysk.Config;
 import java.io.File;
 import frysk.testbed.TearDownExpect;
 import frysk.testbed.CorefileFactory;
 
-public class TestFmaps
-  extends TestCase
-{
+public class TestFmaps extends TestLib {
   
-  /**
-   * Start fmaps with both a core file and an executable; avoids
-   * problems with Linux's bone-head COREFILE format storing only
-   * the first 50 characters of the executable.
-   */
+    /**
+     * Start fmaps with both a core file and an executable; avoids
+     * problems with Linux's bone-head COREFILE format storing only
+     * the first 50 characters of the executable.
+     */
     private Expect fmaps(String program, String[] args) {
 	File coreExe = Config.getPkgLibFile(program);
 	File coreFile = CorefileFactory.constructCoreAtSignal(coreExe);
@@ -74,7 +71,7 @@ public class TestFmaps
     // Basic sniff test, are we getting output that looks like a map?
     // getMaps is tested in the frysk-core/proc namespalce
     public void testExeOfPid() {
-	Expect e  = fmaps("funit-stack-outlined", new String[0]);
+	Expect e = fmaps("funit-stack-outlined", new String[0]);
 	e.expect("funit-stack-outlined");
 	
     }
diff --git a/frysk-core/frysk/bindir/TestFtrace.java b/frysk-core/frysk/bindir/TestFtrace.java
index 0d095ec..c9425e2 100644
--- a/frysk-core/frysk/bindir/TestFtrace.java
+++ b/frysk-core/frysk/bindir/TestFtrace.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2006, 2007, Red Hat Inc.


hooks/post-receive
--
frysk system monitor/debugger


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