From 0ec17f2f922a484ca260c6bf8ee34a26dd94d78c Mon Sep 17 00:00:00 2001
From: Ian Lynagh <igloo@earth.li>
Date: Sat, 9 May 2009 16:12:58 +0000
Subject: [PATCH] In the tests, get the hpc location from the driver rather
 than trying to find it ourselves

---
 tests/Makefile          | 11 +++----
 tests/fork/Makefile     |  3 --
 tests/fork/test.T       |  5 +--
 tests/function/Makefile |  3 --
 tests/function/test.T   |  5 +--
 tests/raytrace/test.T   | 21 +++++++------
 tests/simple/Makefile   |  3 --
 tests/simple/test.T     | 69 ++++++++++++++++++++---------------------
 8 files changed, 50 insertions(+), 70 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index 7ffc1a9..8f4b306 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -6,9 +6,6 @@ TOP=../../../testsuite
 include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
-HPCDIR=$(TOP)/../utils/hpc
-HPC   = $(HPCDIR)/hpc-std
-
 #
 # This is measuring coverage of the hpc tool itself.
 #  In the hpc directory 
@@ -31,13 +28,13 @@ hpc-tool-coverage-clean::
 	find . -name 'hpc.tix' -print | xargs rm -f
 
 hpc-tool-coverage::
-	$(HPC) overlay hpc.ovr --output=$(HPC_EXC_TIX) --srcdir=$(HPCDIR)
+	$(HPC) overlay hpc.ovr --output=$(HPC_EXC_TIX)
 	$(HPC) sum $(shell find . -name 'hpc-inplace.tix' -print) $(HPC_EXC_TIX) \
 			--output=$(HPC_ALL_TIX)  --union
 	date							    >> $(COVERAGE_OUT)
-	$(HPC) report $(HPC_ALL_TIX) --srcdir=$(HPCDIR) --xml-output    >> $(COVERAGE_OUT)
+	$(HPC) report $(HPC_ALL_TIX) --xml-output    >> $(COVERAGE_OUT)
 	echo OMIT: $(HPCTOOLS_BORING)				   >> $(COVERAGE_OUT)
-	$(HPC) report $(HPC_ALL_TIX) --srcdir=$(HPCDIR) --xml-output $(BORING_FLAGS) \
+	$(HPC) report $(HPC_ALL_TIX) --xml-output $(BORING_FLAGS) \
 									>> $(COVERAGE_OUT)
-	$(HPC) markup $(HPC_ALL_TIX) --srcdir=$(HPCDIR) $(BORING_FLAGS) --destdir=html 
+	$(HPC) markup $(HPC_ALL_TIX) $(BORING_FLAGS) --destdir=html 
 
diff --git a/tests/fork/Makefile b/tests/fork/Makefile
index 3f4f799..12924c2 100644
--- a/tests/fork/Makefile
+++ b/tests/fork/Makefile
@@ -6,6 +6,3 @@ TOP=../../../../testsuite
 include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
-HPCDIR=$(TOP)/../utils/hpc
-HPC   = $(HPCDIR)/hpc-std
-
diff --git a/tests/fork/test.T b/tests/fork/test.T
index 35db9b6..c881102 100644
--- a/tests/fork/test.T
+++ b/tests/fork/test.T
@@ -2,10 +2,7 @@ setTestOpts(compose(only_compiler_types(['ghc']),
 		    compose(omit_ways(['ghci','threaded2']),
 			    skip_if_fast)))
 
-# Set up the hpc common variable(s).
-hpc = config.top + '/../utils/hpc/install-inplace/bin/hpc'
-
-hpc_prefix = 'perl ../hpcrun.pl --clear --exeext=' + config.exeext + ' --hpc=' + hpc;
+hpc_prefix = 'perl ../hpcrun.pl --clear --exeext=' + config.exeext + ' --hpc=' + config.hpc;
 
 test('hpc_fork', cmd_prefix(hpc_prefix), compile_and_run, ['-fhpc'])
 
diff --git a/tests/function/Makefile b/tests/function/Makefile
index 4a6ea34..474197b 100644
--- a/tests/function/Makefile
+++ b/tests/function/Makefile
@@ -6,9 +6,6 @@ TOP=../../../../testsuite
 include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
-HPCDIR=$(TOP)/../utils/hpc
-HPC   = $(HPCDIR)/hpc-std
-
 build-tix-tar::
 	rm -Rf .hpc hpc001.o a.out
 	$(TOP)/../compiler/ghc-inplace -fhpc hpc001.hs
diff --git a/tests/function/test.T b/tests/function/test.T
index d049885..d86da6f 100644
--- a/tests/function/test.T
+++ b/tests/function/test.T
@@ -2,10 +2,7 @@ setTestOpts(compose(only_compiler_types(['ghc']),
 		    compose(omit_ways(['ghci']),
 			    skip_if_fast)))
 
-# Set up the hpc common variable(s).
-hpc = config.top + '/../utils/hpc/install-inplace/bin/hpc'
-
-hpc_prefix = 'perl ../hpcrun.pl --clear --exeext=' + config.exeext + ' --hpc=' + hpc;
+hpc_prefix = 'perl ../hpcrun.pl --clear --exeext=' + config.exeext + ' --hpc=' + config.hpc;
 
 test('tough', cmd_prefix(hpc_prefix), compile_and_run, ['-fhpc'])
 
diff --git a/tests/raytrace/test.T b/tests/raytrace/test.T
index ae7a23d..0853a74 100644
--- a/tests/raytrace/test.T
+++ b/tests/raytrace/test.T
@@ -2,8 +2,7 @@ setTestOpts(compose(only_compiler_types(['ghc']),
 		    compose(omit_ways(['ghci']),
 			    skip_if_fast)))
 
-hpc = config.top + '/../utils/hpc/install-inplace/bin/hpc'
-hpc_prefix = 'perl ../hpcrun.pl --clear --exeext=' + config.exeext + ' --hpc=' + hpc;
+hpc_prefix = 'perl ../hpcrun.pl --clear --exeext=' + config.exeext + ' --hpc=' + config.hpc;
 
 test('hpc_raytrace', \
 	[ skip_if_fast, cmd_prefix(hpc_prefix), reqlib('parsec') ], \
@@ -15,20 +14,22 @@ runCmd("cd " + getTestDir() + " && tar xf tixs.tar")
 hpcsample = 'hpc_sample'
 
 test('hpc_report_multi_001', normal, run_command, \
-	[hpc + ' report ' + hpcsample + ' --include=Geometry --per-module'])
+	[config.hpc + ' report ' + hpcsample + ' --include=Geometry --per-module'])
 test('hpc_report_multi_002', normal, run_command, \
-	[hpc + ' report ' + hpcsample + ' --exclude=Geometry --per-module'])
+	[config.hpc + ' report ' + hpcsample + ' --exclude=Geometry --per-module'])
 test('hpc_report_multi_003', normal, run_command, \
-	[hpc + ' report ' + hpcsample + ' --include=Geometry --per-module --decl-list']) 
+	[config.hpc + ' report ' + hpcsample + ' --include=Geometry --per-module --decl-list'])
 
 test('hpc_markup_multi_001', normal, run_command, \
-	[hpc + ' markup ' + hpcsample + ' --include=Geometry'])
+	[config.hpc + ' markup ' + hpcsample + ' --include=Geometry'])
 test('hpc_markup_multi_002', normal, run_command, \
-	[hpc + ' markup ' + hpcsample + ' --exclude=Geometry'])
+	[config.hpc + ' markup ' + hpcsample + ' --exclude=Geometry'])
 test('hpc_markup_multi_003', normal, run_command, \
-	[hpc + ' markup ' + hpcsample + ' --fun-entry-count']) 
+	[config.hpc + ' markup ' + hpcsample + ' --fun-entry-count'])
 
-test('hpc_show_multi_001', normal, run_command, [hpc + ' show ' + hpcsample + ''])
-test('hpc_show_multi_002', normal, run_command, [hpc + ' show ' + hpcsample + ' --include=Geometry'])
+test('hpc_show_multi_001', normal, run_command,
+     [config.hpc + ' show ' + hpcsample + ''])
+test('hpc_show_multi_002', normal, run_command,
+     [config.hpc + ' show ' + hpcsample + ' --include=Geometry'])
 
 clean_o_hi()
diff --git a/tests/simple/Makefile b/tests/simple/Makefile
index 4a6ea34..474197b 100644
--- a/tests/simple/Makefile
+++ b/tests/simple/Makefile
@@ -6,9 +6,6 @@ TOP=../../../../testsuite
 include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
-HPCDIR=$(TOP)/../utils/hpc
-HPC   = $(HPCDIR)/hpc-std
-
 build-tix-tar::
 	rm -Rf .hpc hpc001.o a.out
 	$(TOP)/../compiler/ghc-inplace -fhpc hpc001.hs
diff --git a/tests/simple/test.T b/tests/simple/test.T
index c996b6f..e4fe9dc 100644
--- a/tests/simple/test.T
+++ b/tests/simple/test.T
@@ -2,10 +2,7 @@ setTestOpts(compose(only_compiler_types(['ghc']),
 		    compose(omit_ways(['ghci']),
 			    skip_if_fast)))
 
-# Set up the hpc common variable(s).
-hpc = config.top + '/../utils/hpc/install-inplace/bin/hpc'
-
-hpc_prefix = 'perl ../hpcrun.pl --clear --exeext=' + config.exeext + ' --hpc=' + hpc;
+hpc_prefix = 'perl ../hpcrun.pl --clear --exeext=' + config.exeext + ' --hpc=' + config.hpc;
 
 test('hpc001', cmd_prefix(hpc_prefix), compile_and_run, ['-fhpc'])
 
@@ -16,56 +13,56 @@ runCmd("cd " + getTestDir() + " && tar xf tixs.tar")
 
 hpcsample = 'hpc_sample'
 
-test('hpc_help', normal, run_command, [hpc + ' help'])
-test('hpc_help_help', normal, run_command, [hpc + ' help help'])
+test('hpc_help', normal, run_command, [config.hpc + ' help'])
+test('hpc_help_help', normal, run_command, [config.hpc + ' help help'])
 
-test('hpc_help_report', normal, run_command, [hpc + ' help report'])
+test('hpc_help_report', normal, run_command, [config.hpc + ' help report'])
 test('hpc_report_001', normal, run_command, \
-	[hpc + ' report ' + hpcsample + '.tix --xml-output']) 
+	[config.hpc + ' report ' + hpcsample + '.tix --xml-output']) 
 test('hpc_report_002', normal, run_command, \
-	[hpc + ' report ' + hpcsample + '.tix --xml-output --per-module']) 
+	[config.hpc + ' report ' + hpcsample + '.tix --xml-output --per-module']) 
 test('hpc_report_003', normal, run_command, \
-	[hpc + ' report ' + hpcsample + '.tix --per-module --decl-list']) 
-test('hpc_report_error_001', exit_code(1), run_command, [hpc + ' report']) # no .tix file
-test('hpc_report_error_002', exit_code(1), run_command, [hpc + ' report hpc001.hs']) # bad .tix file
+	[config.hpc + ' report ' + hpcsample + '.tix --per-module --decl-list']) 
+test('hpc_report_error_001', exit_code(1), run_command, [config.hpc + ' report']) # no .tix file
+test('hpc_report_error_002', exit_code(1), run_command, [config.hpc + ' report hpc001.hs']) # bad .tix file
 
-test('hpc_help_markup', normal, run_command, [hpc + ' help markup'])
-test('hpc_markup_error_001', exit_code(1), run_command, [hpc + ' markup']) # no .tix file
-test('hpc_markup_error_002', exit_code(1), run_command, [hpc + ' markup hpc001.hs']) # bad .tix file
+test('hpc_help_markup', normal, run_command, [config.hpc + ' help markup'])
+test('hpc_markup_error_001', exit_code(1), run_command, [config.hpc + ' markup']) # no .tix file
+test('hpc_markup_error_002', exit_code(1), run_command, [config.hpc + ' markup hpc001.hs']) # bad .tix file
 test('hpc_markup_001', normal, run_command, \
-	['(' + hpc + ' markup ' + hpcsample + '.tix --highlight-covered ; cat Main.hs.html )']) 
+	['(' + config.hpc + ' markup ' + hpcsample + '.tix --highlight-covered ; cat Main.hs.html )']) 
 test('hpc_markup_002', normal, run_command, \
-	['(' + hpc + ' markup ' + hpcsample + '.tix --fun-entry-count ; cat Main.hs.html )']) 
+	['(' + config.hpc + ' markup ' + hpcsample + '.tix --fun-entry-count ; cat Main.hs.html )']) 
 
-test('hpc_help_show', normal, run_command, [hpc + ' help show'])
-test('hpc_show', normal, run_command, [hpc + ' show ' + hpcsample + '.tix'])
-test('hpc_show_error_001', exit_code(1), run_command, [hpc + ' show']) # no .tix file
-test('hpc_show_error_002', exit_code(1), run_command, [hpc + ' show hpc001.hs']) # bad .tix file
+test('hpc_help_show', normal, run_command, [config.hpc + ' help show'])
+test('hpc_show', normal, run_command, [config.hpc + ' show ' + hpcsample + '.tix'])
+test('hpc_show_error_001', exit_code(1), run_command, [config.hpc + ' show']) # no .tix file
+test('hpc_show_error_002', exit_code(1), run_command, [config.hpc + ' show hpc001.hs']) # bad .tix file
 
-test('hpc_help_version', normal, run_command, [hpc + ' help version'])
-test('hpc_version', normal, run_command, [hpc + ' version'])
+test('hpc_help_version', normal, run_command, [config.hpc + ' help version'])
+test('hpc_version', normal, run_command, [config.hpc + ' version'])
 
-test('hpc_help_draft', normal, run_command, [hpc + ' help draft'])
-test('hpc_draft', normal, run_command, [hpc + ' draft ' + hpcsample + '.tix'])
+test('hpc_help_draft', normal, run_command, [config.hpc + ' help draft'])
+test('hpc_draft', normal, run_command, [config.hpc + ' draft ' + hpcsample + '.tix'])
 
-test('hpc_help_overlay', normal, run_command, [hpc + ' help overlay'])
+test('hpc_help_overlay', normal, run_command, [config.hpc + ' help overlay'])
 test('hpc_overlay', normal, run_command, 
-			[     hpc + ' overlay sample_overlay.ovr > sample_overlay.tix' +
+			[     config.hpc + ' overlay sample_overlay.ovr > sample_overlay.tix' +
 			';  cat sample_overlay.tix ' +
-			';' + hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix > total.tix' + 
-			';' + hpc + ' report total.tix' +
+			';' + config.hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix > total.tix' + 
+			';' + config.hpc + ' report total.tix' +
 			'']);
 test('hpc_overlay2', normal, run_command, 
-			[     hpc + ' overlay sample_overlay.ovr --output=sample_overlay.tix' +
+			[     config.hpc + ' overlay sample_overlay.ovr --output=sample_overlay.tix' +
 			';  cat sample_overlay.tix ' +
-			';' + hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix --output=total.tix' + 
-			';' + hpc + ' report total.tix' +
+			';' + config.hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix --output=total.tix' + 
+			';' + config.hpc + ' report total.tix' +
 			'']);
 test('hpc_hand_overlay', normal, run_command, 
-			[     hpc + ' overlay hand_overlay.ovr --output=sample_overlay.tix' +
+			[     config.hpc + ' overlay hand_overlay.ovr --output=sample_overlay.tix' +
 			';  cat sample_overlay.tix ' +
-			';' + hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix --output=total.tix' + 
-			';' + hpc + ' report total.tix' +
+			';' + config.hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix --output=total.tix' + 
+			';' + config.hpc + ' report total.tix' +
 			'']);
 
-test('hpc_bad_001', exit_code(1), run_command, [hpc + ' bad arguments'])
+test('hpc_bad_001', exit_code(1), run_command, [config.hpc + ' bad arguments'])
-- 
GitLab