Blame SOURCES/dyninst-install-testsuite.patch

afd09e
commit 701eb936767886bfd7b8858e8e2151173f9dc6bd
afd09e
Author: Josh Stone <jistone@redhat.com>
afd09e
Date:   Tue Feb 26 09:34:52 2013 -0800
afd09e
afd09e
    Hack the testsuite into shape for installation
afd09e
    
afd09e
    * testsuite/make.module.tmpl: Forgo rpath, and install all targets.
afd09e
    * testsuite/src/runTests-utils.C (setupVars): Don't complain about the
afd09e
      scripts dir, as it's not actually needed anyway.
afd09e
    * testsuite/src/test_driver.C (getRTLibDir): Hack out the builddir path,
afd09e
      and just use ../ (aka %{libdir}/dyninst/testsuite/../)
afd09e
afd09e
diff --git a/testsuite/make.module.tmpl b/testsuite/make.module.tmpl
afd09e
index 1d3ce2c..1c76d8f 100644
afd09e
--- a/testsuite/make.module.tmpl
afd09e
+++ b/testsuite/make.module.tmpl
afd09e
@@ -227,7 +227,7 @@ proccontrol_COMPONENT_LIB = $(LIBPROCCONTROLCOMP)
afd09e
 SPACE :=
afd09e
 SPACE +=
afd09e
 #COMPONENT_LDFLAGS += $(subst $(SPACE),,-Wl,--enable-new-dtags$(ALL_COMP_DIRS:%=,-rpath,%))
afd09e
-COMPONENT_LDFLAGS += $(subst $(SPACE),,-Wl$(ALL_COMP_DIRS:%=,-rpath,%))
afd09e
+#COMPONENT_LDFLAGS += $(subst $(SPACE),,-Wl$(ALL_COMP_DIRS:%=,-rpath,%))
afd09e
 
afd09e
 all: default
afd09e
 
afd09e
@@ -246,8 +246,19 @@ full: test-full
afd09e
 ###  A list of all the targets we're building, for install purposes
afd09e
 #######################################################################
afd09e
 
afd09e
-ALL_TARGETS_DEST		= $(addprefix $(TEST_DEST)/,$(ALL_TARGETS))
afd09e
-LIBTESTSUITE_DEST               = $(addprefix $(TEST_DEST)/,$(LIBTESTSUITE))
afd09e
+TEST_DEST ?= $(LIBRARY_DEST)/testsuite
afd09e
+
afd09e
+ALL_TARGETS	 = $(LIBTESTLAUNCH) $(LIBTESTSUITE) $(TESTLIBS)
afd09e
+ALL_TARGETS	+= $(MUTATORS) $(MUTATEES_MINIMUM)
afd09e
+ALL_TARGETS	+= $(DRIVERS) $(OUTPUT_DRIVERS) $(COMPONENTS)
afd09e
+
afd09e
+FULL_TARGETS	 = $(LIBTESTLAUNCH) $(LIBTESTSUITE) $(TESTLIBS)
afd09e
+FULL_TARGETS	+= $(MUTATORS) $(MUTATEES)
afd09e
+FULL_TARGETS	+= $(DRIVERS) $(OUTPUT_DRIVERS) $(COMPONENTS)
afd09e
+
afd09e
+ALL_TARGETS_DEST	= $(addprefix $(TEST_DEST)/,$(ALL_TARGETS))
afd09e
+FULL_TARGETS_DEST	= $(addprefix $(TEST_DEST)/,$(FULL_TARGETS))
afd09e
+LIBTESTSUITE_DEST	= $(addprefix $(TEST_DEST)/,$(LIBTESTSUITE))
afd09e
 
afd09e
 #######################################################################
afd09e
 ###  Some pattern rules
afd09e
@@ -274,13 +285,11 @@ include make.mutators.gen
afd09e
 
afd09e
 include make.solo_mutatee.gen
afd09e
 
afd09e
-mutatees:
afd09e
-
afd09e
-mutators:
afd09e
-
afd09e
-components:
afd09e
-
afd09e
-testlibs:
afd09e
+MUTATEES =
afd09e
+MUTATEES_MINIMUM =
afd09e
+MUTATORS =
afd09e
+COMPONENTS =
afd09e
+TESTLIBS =
afd09e
 
afd09e
 #######################################################################
afd09e
 ###  Filter results, if needed
afd09e
@@ -296,13 +305,13 @@ include $(TO_CORE)/make.components
afd09e
 
afd09e
 ifneq ($(wildcard ../src/dyninst), )
afd09e
 ifneq ($(findstring dyninstAPI,$(fullSystem)),)
afd09e
-mutatees: $(filter-out $(BUILD_FILTER), $(dyninst_SOLO_MUTATEES))
afd09e
-mutatees_minimum: $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(dyninst_SOLO_MUTATEES)))
afd09e
-mutators: $(dyninst_MUTATORS_SO)
afd09e
-components: $(LIBDYNINSTCOMP)
afd09e
-testlibs: $(DYNINST_TESTLIBS) $(DYNINST_STATIC_TESTLIBS)
afd09e
+MUTATEES += $(filter-out $(BUILD_FILTER), $(dyninst_SOLO_MUTATEES))
afd09e
+MUTATEES_MINIMUM += $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(dyninst_SOLO_MUTATEES)))
afd09e
+MUTATORS += $(dyninst_MUTATORS_SO)
afd09e
+COMPONENTS += $(LIBDYNINSTCOMP)
afd09e
+TESTLIBS += $(DYNINST_TESTLIBS) $(DYNINST_STATIC_TESTLIBS)
afd09e
 ifndef SKIP_BUILD_RTLIB_32
afd09e
-testlibs: $(DYNINST_TESTLIBS_ABI) $(DYNINST_STATIC_TESTLIBS_ABI)
afd09e
+TESTLIBS += $(DYNINST_TESTLIBS_ABI) $(DYNINST_STATIC_TESTLIBS_ABI)
afd09e
 dyninst_targs = $(DYNINST_TESTLIBS_ABI) $(DYNINST_STATIC_TESTLIBS_ABI)
afd09e
 endif
afd09e
 dyninst_targs += $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(dyninst_SOLO_MUTATEES)))
afd09e
@@ -312,11 +321,11 @@ endif
afd09e
 
afd09e
 ifneq ($(wildcard ../src/symtab), )
afd09e
 ifneq ($(findstring symtabAPI,$(fullSystem)),)
afd09e
-mutatees: $(filter-out $(BUILD_FILTER), $(symtab_SOLO_MUTATEES))
afd09e
-mutatees_minimum: $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(symtab_SOLO_MUTATEES)))
afd09e
-mutators: $(symtab_MUTATORS_SO)
afd09e
-components: $(LIBSYMTABCOMP)
afd09e
-testlibs: $(DYNINST_TESTLIBS) $(DYNINST_STATIC_TESTLIBS)
afd09e
+MUTATEES += $(filter-out $(BUILD_FILTER), $(symtab_SOLO_MUTATEES))
afd09e
+MUTATEES_MINIMUM += $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(symtab_SOLO_MUTATEES)))
afd09e
+MUTATORS += $(symtab_MUTATORS_SO)
afd09e
+COMPONENTS += $(LIBSYMTABCOMP)
afd09e
+TESTLIBS += $(DYNINST_TESTLIBS) $(DYNINST_STATIC_TESTLIBS)
afd09e
 symtab_targs = $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(symtab_SOLO_MUTATEES)))
afd09e
 symtab_targs = $(symtab_MUTATORS_SO) $(LIBSYMTABCOMP)
afd09e
 endif
afd09e
@@ -324,12 +333,12 @@ endif
afd09e
 
afd09e
 ifneq ($(wildcard ../src/instruction), )
afd09e
 ifneq ($(findstring instructionAPI,$(fullSystem)),)
afd09e
-mutatees: $(filter-out $(BUILD_FILTER), $(instruction_SOLO_MUTATEES))
afd09e
-mutatees_minimum: $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(instruction_SOLO_MUTATEES)))
afd09e
-mutators: $(instruction_MUTATORS_SO)
afd09e
+MUTATEES += $(filter-out $(BUILD_FILTER), $(instruction_SOLO_MUTATEES))
afd09e
+MUTATEES_MINIMUM += $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(instruction_SOLO_MUTATEES)))
afd09e
+MUTATORS += $(instruction_MUTATORS_SO)
afd09e
 ifneq ($(instruction_MUTATORS_SO), )
afd09e
-components: $(LIBINSTRUCTIONCOMP)
afd09e
-testlibs:
afd09e
+COMPONENTS += $(LIBINSTRUCTIONCOMP)
afd09e
+TESTLIBS +=
afd09e
 instruction_targs = $(LIBINSTRUCTIONCOMP)
afd09e
 endif
afd09e
 instruction_targs += $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(instruction_SOLO_MUTATEES)))
afd09e
@@ -339,12 +348,12 @@ endif
afd09e
 
afd09e
 ifneq ($(wildcard ../src/proccontrol), )
afd09e
 ifneq ($(findstring proccontrol,$(fullSystem)),)
afd09e
-mutatees: $(filter-out $(BUILD_FILTER), $(proccontrol_SOLO_MUTATEES)) 
afd09e
-mutatees_minimum: $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(proccontrol_SOLO_MUTATEES)))
afd09e
-mutators: $(proccontrol_MUTATORS_SO)
afd09e
+MUTATEES += $(filter-out $(BUILD_FILTER), $(proccontrol_SOLO_MUTATEES)) 
afd09e
+MUTATEES_MINIMUM += $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(proccontrol_SOLO_MUTATEES)))
afd09e
+MUTATORS += $(proccontrol_MUTATORS_SO)
afd09e
 ifneq ($(proccontrol_MUTATORS_SO), )
afd09e
-components: $(LIBPROCCONTROLCOMP)
afd09e
-testlibs: $(PROCCONTROL_TESTLIBS) $(PROCCONTROL_TESTLIBS_ABI) $(DYNINST_TESTLIBS) $(DYNINST_TESTLIBS_ABI)
afd09e
+COMPONENTS += $(LIBPROCCONTROLCOMP)
afd09e
+TESTLIBS += $(PROCCONTROL_TESTLIBS) $(PROCCONTROL_TESTLIBS_ABI) $(DYNINST_TESTLIBS) $(DYNINST_TESTLIBS_ABI)
afd09e
 proccontrol_targs = $(LIBPROCCONTROLCOMP) $(PROCCONTROL_TESTLIBS) $(PROCCONTROL_TESTLIBS_ABI) $(DYNINST_TESTLIBS) $(DYNINST_TESTLIBS_ABI)
afd09e
 endif
afd09e
 proccontrol_targs += $(filter-out $(BUILD_FILTER), $(filter-out $(MINIMUM_BUILD_FILTER), $(proccontrol_SOLO_MUTATEES)))
afd09e
@@ -352,6 +361,16 @@ proccontrol_targs += $(proccontrol_MUTATORS_SO)
afd09e
 endif
afd09e
 endif
afd09e
 
afd09e
+mutatees: $(MUTATEES)
afd09e
+
afd09e
+mutatees_minimum: $(MUTATEES_MINIMUM)
afd09e
+
afd09e
+mutators: $(MUTATORS)
afd09e
+
afd09e
+components: $(COMPONENTS)
afd09e
+
afd09e
+testlibs: $(TESTLIBS)
afd09e
+
afd09e
 common_infra: drivers output_drivers
afd09e
 
afd09e
 dyninstAPI: common_infra $(dyninst_targs) $(symtab_targs) $(instruction_targs) $(proccontrol_targs)
afd09e
@@ -362,7 +381,13 @@ instructionAPI: common_infra $(instruction_targs)
afd09e
 
afd09e
 proccontrol: common_infra $(proccontrol_targs)
afd09e
 
afd09e
-install: default
afd09e
+install: $(TEST_DEST)
afd09e
+
afd09e
+install-full: $(TEST_DEST)
afd09e
+
afd09e
+$(TEST_DEST)/%: %
afd09e
+	@echo Installing $@
afd09e
+	$(HIDE_COMP)$(INSTALL) -t $(TEST_DEST) $<
afd09e
 
afd09e
 symlink: all
afd09e
 
afd09e
@@ -412,7 +437,8 @@ endif
afd09e
 
afd09e
 testlibs: $(LIBTESTSUITE)
afd09e
 
afd09e
-drivers: test_driver runTests testdriver_wrapper
afd09e
+DRIVERS = test_driver runTests testdriver_wrapper
afd09e
+drivers: $(DRIVERS)
afd09e
 
afd09e
 .PHONY: clean install distclean mutators mutatees testlibs gnu_mutatees native_mutatees echo all
afd09e
 
afd09e
@@ -566,7 +592,8 @@ endif
afd09e
 
afd09e
 # Install directory
afd09e
 $(TEST_DEST): 
afd09e
-	mkdir $(TEST_DEST)
afd09e
+	@echo Installing $@
afd09e
+	$(HIDE_COMP)$(INSTALL) -d $(TEST_DEST)
afd09e
 
afd09e
 #######################################################################
afd09e
 ###  Generic Mutator build rule:
afd09e
@@ -857,3 +884,6 @@ endif
afd09e
 endif
afd09e
 endif
afd09e
 endif
afd09e
+
afd09e
+install: $(ALL_TARGETS_DEST)
afd09e
+install-full: $(FULL_TARGETS_DEST)
afd09e
diff --git a/testsuite/src/runTests-utils.C b/testsuite/src/runTests-utils.C
afd09e
index 0f54874..02bd505 100644
afd09e
--- a/testsuite/src/runTests-utils.C
afd09e
+++ b/testsuite/src/runTests-utils.C
afd09e
@@ -403,12 +403,14 @@ void setupVars(bool useLog, string &logfile)
afd09e
    }
afd09e
 
afd09e
    pdscrdir = base_dir + "/dyninst/scripts";
afd09e
+#if 0
afd09e
    if ( ! isDir(pdscrdir) )
afd09e
    {
afd09e
       cerr << pdscrdir << " does not exist.  Paradyn scripts dir required." 
afd09e
          << endl;
afd09e
       exit(1);
afd09e
    }
afd09e
+#endif
afd09e
 
afd09e
    // Determine Test log dir
afd09e
    char *pdtst = getenv("PDTST");
afd09e
diff --git a/testsuite/src/test_driver.C b/testsuite/src/test_driver.C
afd09e
index 0fc3117..31def33 100644
afd09e
--- a/testsuite/src/test_driver.C
afd09e
+++ b/testsuite/src/test_driver.C
afd09e
@@ -805,6 +805,8 @@ void updateSearchPaths(const char *filename) {
afd09e
 }
afd09e
 
afd09e
 std::string getRTLibDir() {
afd09e
+   return "../";
afd09e
+#if 0
afd09e
    char *platform = getenv("PLATFORM");
afd09e
    char cwd[1024];
afd09e
    if (!platform) {
afd09e
@@ -822,6 +824,7 @@ std::string getRTLibDir() {
afd09e
    std::string rtlib = "../../dyninstAPI_RT/";
afd09e
    rtlib += platform;
afd09e
    return rtlib;
afd09e
+#endif
afd09e
 }
afd09e
 
afd09e
 #if !defined(os_windows_test)