From f11b1c7f251ffaf836896b327471593ce5a253e6 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Thu, 3 May 2007 21:12:15 -0700
Subject: [PATCH] makefile: delete .pycs before running tests, since our build
 process puts the wrong filenames into them

---
 GNUmakefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/GNUmakefile b/GNUmakefile
index 9f15ce0b..2b3160ad 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -122,7 +122,16 @@ test-all: test-foolscap test
 
 # use 'make test REPORTER=--reporter=bwverbose' from buildbot, to supress the
 # ansi color sequences
+
+# our current build process embeds bogus filenames inside the .pyc files
+# (they start with /lib). Blow them away and allow the test process to
+# regenerate them, so that tracebacks and figleaf data can refer to the
+# correct filenames (and thus find their source code).
+#
+# TODO: remove this hack, since it requires redoing the byte-compliation on
+# every single test run
 test: build
+	find $(INSTDIR) -name '*.pyc' |xargs rm
 	$(PP) $(TRIAL) $(REPORTER) $(TEST)
 
 # foolscap tests need to be run in their own source dir, so that the paths to
@@ -133,6 +142,7 @@ test-foolscap:
 	cd src/foolscap && PYTHONPATH=$(ORIGPYTHONPATH) $(TRIAL) $(REPORTER) foolscap
 
 test-figleaf: build
+	find $(INSTDIR) -name '*.pyc' |xargs rm
 	rm -f .figleaf
 	$(PP) $(TRIAL) --reporter=bwverbose-figleaf $(TEST)
 
-- 
2.45.2