Re: [ PATCH ] - Anaconda and python-coverage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Updated patch per:
https://bugzilla.redhat.com/show_bug.cgi?id=1066339#c8


diff --git a/anaconda b/anaconda
index 994497f..5fe1b19 100755
--- a/anaconda
+++ b/anaconda
@@ -31,11 +31,30 @@
 # This toplevel file is a little messy at the moment... (2001-06-22)
 # ...still messy (2013-07-12)
 
+coverage = None
+
+proc_cmdline = open("/proc/cmdline", "r").read()
+proc_cmdline = proc_cmdline.split()
+if ("debug=1" in proc_cmdline) or ("debug" in proc_cmdline):
+    import coverage
+    cov = coverage.coverage(data_file="/mnt/sysimage/root/anaconda.coverage",
+                            branch=True,
+                            source=["/usr/sbin/anaconda", "pyanaconda"]
+                            )
+    cov.start()
+
+
 import atexit, sys, os, time, subprocess
 # keep up with process ID of the window manager if we start it
 wm_pid = None
 
 def exitHandler(rebootData, storage, exitCode=None):
+    # stop and save coverage here b/c later the file system may be unavailable
+    if coverage is not None:
+        cov.stop()
+        if os.path.isdir('/mnt/sysimage/root'):
+            cov.save()
+
     if flags.usevnc:
         vnc.shutdownServer()
 
diff --git a/anaconda.spec.in b/anaconda.spec.in
index a13588d..3ce9e8d 100755
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -142,6 +142,8 @@ Requires: hfsplus-tools
 %endif
 %endif
 
+Requires: python-coverage
+
 # required because of the rescue mode and VNC question
 Requires: anaconda-tui = %{version}-%{release}
 
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux