dyninst/dyninst-install-testsuite.patch
Josh Stone ddf1ba5375 Update to release 8.1.1.
- Drop the backported dyninst-test2_4-kill-init.patch.
- Drop the now-upstreamed dyninst-unused_vars.patch.
- Update other patches for context.
- Patch the installed symlinks to be relative, not $(DEST) filled.
2013-03-15 14:36:26 -07:00

239 lines
8.6 KiB
Diff

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