From 021c03633afc0b399d4b6ebfafb3fbf1f7756e4b Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Fri, 28 Oct 2022 15:26:57 -0400 Subject: [PATCH] Delete test for CDT 2.x functionality Rather than update this test, simply delete this test of ancient functionality Part of #117 --- .../oldTypeProjects/1.2/Benchmarks/makefile | 70 - .../oldTypeProjects/1.2/Benchmarks/objects.mk | 8 - .../oldTypeProjects/1.2/Benchmarks/sources.mk | 27 - .../oldTypeProjects/1.2/Benchmarks/subdir.mk | 31 - .../resources/oldTypeProjects/1.2/test12.zip | Bin 1844 -> 0 bytes .../oldTypeProjects/2.0/Benchmarks/makefile | 70 - .../oldTypeProjects/2.0/Benchmarks/objects.mk | 8 - .../oldTypeProjects/2.0/Benchmarks/sources.mk | 27 - .../oldTypeProjects/2.0/Benchmarks/subdir.mk | 31 - .../resources/oldTypeProjects/2.0/test20.zip | Bin 1964 -> 0 bytes .../2.1/Benchmarks/Functions/subdir.mk | 31 - .../oldTypeProjects/2.1/Benchmarks/makefile | 56 - .../oldTypeProjects/2.1/Benchmarks/objects.mk | 8 - .../oldTypeProjects/2.1/Benchmarks/sources.mk | 18 - .../oldTypeProjects/2.1/Benchmarks/subdir.mk | 31 - .../resources/oldTypeProjects/2.1/test21.zip | Bin 2046 -> 0 bytes .../2.1CPP/Benchmarks/Functions/subdir.mk | 31 - .../2.1CPP/Benchmarks/makefile | 71 - .../2.1CPP/Benchmarks/objects.mk | 8 - .../2.1CPP/Benchmarks/sources.mk | 28 - .../2.1CPP/Benchmarks/subdir.mk | 31 - .../oldTypeProjects/2.1CPP/Test21CXX.zip | Bin 2051 -> 0 bytes .../linkedFolder/Benchmarks/makefile | 55 - .../linkedFolder/Benchmarks/objects.mk | 8 - .../linkedFolder/Benchmarks/sources.mk | 15 - .../linkedFolder/Benchmarks/subdir.mk | 36 - .../test21Projects/linkedFolder/f1.c | 8 - .../test21Projects/linkedFolder/f2.c | 8 - .../test21Projects/linkedFolder/test_ar.h | 2 - .../linkedLib/Benchmarks/makefile | 55 - .../linkedLib/Benchmarks/objects.mk | 8 - .../linkedLib/Benchmarks/sources.mk | 15 - .../linkedLib/Benchmarks/subdir.mk | 45 - .../resources/test21Projects/linkedLib/f1.c | 8 - .../resources/test21Projects/linkedLib/f2.c | 8 - .../test21Projects/linkedLib/linkedLib.zip | Bin 1462 -> 0 bytes .../test21Projects/linkedLib/test_ar.h | 2 - .../multiResConfig/Benchmarks/makefile | 70 - .../multiResConfig/Benchmarks/objects.mk | 8 - .../Benchmarks/source1/subdir.mk | 33 - .../Benchmarks/source2/source21/subdir.mk | 33 - .../Benchmarks/source2/subdir.mk | 33 - .../multiResConfig/Benchmarks/sources.mk | 26 - .../multiResConfig/Benchmarks/subdir.mk | 33 - .../multiResConfig/testResCfg.zip | Bin 3182 -> 0 bytes .../singleFileExe/Benchmarks/makefile | 55 - .../singleFileExe/Benchmarks/objects.mk | 8 - .../singleFileExe/Benchmarks/sources.mk | 15 - .../singleFileExe/Benchmarks/subdir.mk | 33 - .../singleFileExe/testSingleExe.zip | Bin 1593 -> 0 bytes .../twoFileSO/Benchmarks/makefile | 67 - .../twoFileSO/Benchmarks/objects.mk | 8 - .../twoFileSO/Benchmarks/sources.mk | 23 - .../twoFileSO/Benchmarks/subdir.mk | 36 - .../test21Projects/twoFileSO/testDoubleSO.zip | Bin 1848 -> 0 bytes .../core/tests/ManagedBuildCore20Tests.java | 1950 ----------------- .../tests/ManagedProject21MakefileTests.java | 332 --- .../core/tests/ManagedProjectUpdateTests.java | 269 --- 58 files changed, 3890 deletions(-) delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/makefile delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/objects.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/sources.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/test12.zip delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/makefile delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/objects.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/sources.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/test20.zip delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/Benchmarks/Functions/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/Benchmarks/makefile delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/Benchmarks/objects.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/Benchmarks/sources.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/Benchmarks/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/test21.zip delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/Functions/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/makefile delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/objects.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/sources.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Test21CXX.zip delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/Benchmarks/makefile delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/Benchmarks/objects.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/Benchmarks/sources.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/Benchmarks/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/f1.c delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/f2.c delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/test_ar.h delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/makefile delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/objects.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/sources.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/f1.c delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/f2.c delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/linkedLib.zip delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/test_ar.h delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/makefile delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/objects.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source1/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source2/source21/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source2/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/sources.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/testResCfg.zip delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/Benchmarks/makefile delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/Benchmarks/objects.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/Benchmarks/sources.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/Benchmarks/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/testSingleExe.zip delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/makefile delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/objects.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/sources.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/subdir.mk delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/testDoubleSO.zip delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCore20Tests.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/makefile deleted file mode 100644 index 52846ad0ca0..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/makefile +++ /dev/null @@ -1,70 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include subdir.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C++_DEPS)),) --include $(C++_DEPS) -endif -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -endif - --include ../makefile.defs - -OPTIONAL_TOOL_DEPS := \ -$(wildcard ../makefile.defs) \ -$(wildcard ../makefile.init) \ -$(wildcard ../makefile.targets) \ - - -BUILD_ARTIFACT_NAME := test12 -BUILD_ARTIFACT_EXTENSION := exe -BUILD_ARTIFACT_PREFIX := -BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),) - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: main-build - -# Main-build Target -main-build: test12.exe - -# Tool invocations -test12.exe: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) - @echo 'Building target: $@' - @echo 'Invoking: Cygwin C++ Linker' - g++ -o "test12.exe" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) test12.exe - -@echo ' ' - -.PHONY: all clean dependents main-build - --include ../makefile.targets diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/objects.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/objects.mk deleted file mode 100644 index 742c2da043f..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/sources.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/sources.mk deleted file mode 100644 index c15c16c0447..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/sources.mk +++ /dev/null @@ -1,27 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -ASM_SRCS := -C++_SRCS := -CC_SRCS := -CPP_SRCS := -CXX_SRCS := -C_SRCS := -C_UPPER_SRCS := -OBJ_SRCS := -O_SRCS := -S_UPPER_SRCS := -C++_DEPS := -CC_DEPS := -CPP_DEPS := -CXX_DEPS := -C_DEPS := -C_UPPER_DEPS := -EXECUTABLES := -OBJS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/subdir.mk deleted file mode 100644 index 1b71e62830e..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/subdir.mk +++ /dev/null @@ -1,31 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../test.cpp - -CPP_DEPS += \ -./test.d - -OBJS += \ -./test.o - - -# Each subdirectory must supply rules for building sources it contributes -%.o: ../%.cpp subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: Cygwin C++ Compiler' - g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean--2e- - -clean--2e-: - -$(RM) ./test.d ./test.o - -.PHONY: clean--2e- - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/test12.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/test12.zip deleted file mode 100644 index 5dfa0f3900ffdf27647a45f16ab3dafb3b0e8c41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1844 zcmWIWW@Zs#U|`^2__NpDkjJ>|)fGkthHdN&44e#A40_2aB}t{3IVr&|sSJC7%7E$; zxSZsYQxY--5)%>(5*irf71B~zjU!zfT`sH=mVD#CcI$Gv+hQ{MebIdrI~yB27dAAq z>gXQ)Fh6h}qY7KlY6caN137{n7RoL$96l=@j(oVmX_T+pEYMZi1yy|k*leV zYn_;*ABxF@af;?Hv5vR8kgF}IdMaJ)+iZId*%J~cFMX^inbPNO%N98QYzUWTvegE-P_|zZF9y4z(+wuZh&P*HaAgExy0J?J!SWn{RLK{i@SD@;GiUD_qSKz5RW>#0+(9$NK-=9g|Xw zyf!~Hus*TtPd)$q>&xwx?5uwuJo@2z+ke$h;w73Pi}xtp|8i`f*Ee&C?N?9yKf3R2 z>izls#cOZdZ8hn2zi-GfDf~dBwd(yjS&Y-wXS=^s4nRqCkH5V#TMtZH-oS*%4NY_f zMfq8&$t44q>}n?*EHJ&>c2Q{qA zx!lB|9k@E3qc6e7MnGpu%ROekS2y@g{TFK;yc4(0$l+pf*XEiTM}6j)o?A5klXAf| zF2NTa<>3=v=NNoU`84t7clUia{(pZiCc2l~^=-J$l7{0T( z|JRZ|VYmI=GxZlMQ_pUTnwV?5;9PUAsBGSJ8|eP1ij!K980mO6L$R-BmP>=5ts zZs*IZ2R3_)Z1aEf`fupo@4}xS&RG;czwXcU|Dd4f0u_x6di&fBwU&Kzk^!p+ zsl_FF$pr=UP01&Kg{NamwKJ#y&CDxN$W6@5)6lHu<>D+#Eh#O^Q!udR<*Mc73h-uR z663~I{tJRU#lXm*z_6_m#6qeKSirSGXb3B$utqlrHA^F#QwmIyAamd;l7LC5Ng3Is r!Z5&_l?~)`79dmr7Ek|xiWwLHgz>z8 diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/makefile deleted file mode 100644 index 815689a4bf6..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/makefile +++ /dev/null @@ -1,70 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include subdir.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C++_DEPS)),) --include $(C++_DEPS) -endif -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -endif - --include ../makefile.defs - -OPTIONAL_TOOL_DEPS := \ -$(wildcard ../makefile.defs) \ -$(wildcard ../makefile.init) \ -$(wildcard ../makefile.targets) \ - - -BUILD_ARTIFACT_NAME := test20 -BUILD_ARTIFACT_EXTENSION := exe -BUILD_ARTIFACT_PREFIX := -BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),) - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: main-build - -# Main-build Target -main-build: test20.exe - -# Tool invocations -test20.exe: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) - @echo 'Building target: $@' - @echo 'Invoking: Cygwin C++ Linker' - g++ -o "test20.exe" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) test20.exe - -@echo ' ' - -.PHONY: all clean dependents main-build - --include ../makefile.targets diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/objects.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/objects.mk deleted file mode 100644 index 742c2da043f..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/sources.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/sources.mk deleted file mode 100644 index c15c16c0447..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/sources.mk +++ /dev/null @@ -1,27 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -ASM_SRCS := -C++_SRCS := -CC_SRCS := -CPP_SRCS := -CXX_SRCS := -C_SRCS := -C_UPPER_SRCS := -OBJ_SRCS := -O_SRCS := -S_UPPER_SRCS := -C++_DEPS := -CC_DEPS := -CPP_DEPS := -CXX_DEPS := -C_DEPS := -C_UPPER_DEPS := -EXECUTABLES := -OBJS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/subdir.mk deleted file mode 100644 index be29dcd74c4..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/subdir.mk +++ /dev/null @@ -1,31 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../Test1.cpp - -CPP_DEPS += \ -./Test1.d - -OBJS += \ -./Test1.o - - -# Each subdirectory must supply rules for building sources it contributes -%.o: ../%.cpp subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: Cygwin C++ Compiler' - g++ -O2 -g1 -pedantic -pedantic-errors -Wall -Werror -c -fmessage-length=0 -v -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean--2e- - -clean--2e-: - -$(RM) ./Test1.d ./Test1.o - -.PHONY: clean--2e- - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/test20.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/test20.zip deleted file mode 100644 index 609156097a4b6f2548962488f3eb10e72034e875..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1964 zcmZ{ldo+Ia%+mpZDP#0&mO;2Hn`C;*fs zXPjO*9Z!P-fXO-lPz2Tk7`k7SZ*)+oAK6V2fVE&EtfV5xz=3wkT-=1aXLuKO!%5p= z3y%aSf%Q{1ro`jUQ|5l(JKFTU-}TI?t;yVs=TT?>=~WS(@T}PnIrEQxCaaz`uD;NS zAJ0-wVp_U;HN)kLGLVOgT`^PeQ&naIS&>V^u5D?H=as9N5ooSd729 zIJVNCqY}gLe1Php{s9r@MC)?x-@x;R7>ER_V-QN~gW**%mxe)H)6uDTR{K3A3xC2Q zh0BX9_Io--C5_N7?@Zuk%Nf6qQF>yw&80&9Lo#Zd5N{DFGW>>SHTsO6t#;)?l2HIB zey<8&)#LYq`(=)FKTl1+S9tn{lK$+a+ViUK)-b9C zFYD?i=FGR=z4>G+hvlzzyt)DxcV_y)_;rkD#B~Q6@ox2>>A^uk2Cn<L5FG7xZzi$BlJ9Ti>cAdg-@sjrfjJVp&cZtrp;k7UA3?Tqe3$|1Fzh*`p3lC<{ zqn5ilZxmrA)u(P|Tyh{i#%iR@@Md+4`??AYwcLsWqdkb`XPNmIyl{MR6q6+PvCd8h zJ9LiBda*c(kBu@BYvKn0a=%YwMY3){A|IVmmfpbAku!~tkBh}=pKgn$a4ikuhAK9{ zA5e)nVK=H?#GqOab{LG=Kzo#wl6(=tly_bb1Yh+-zhimQ!kS*HWq6x?VP}GAP%*8@ z63!m3X?`Ah|F@9^KosWnOyv>|2G&CT3u-(~tWm(bLZexsMY7YX2_tKKIax z@-4KBuiMTc!;d&aNCOR!AddXU*nG;>r&-O5!;|{go^_eT?!(*mzNE*@Hhaw>J_r34 z4ElP{#7`n{At-@CD@cQuO?ehfSgO^OFV-=ipfpn69DZx=Ay#&}tBGqS1(wRAhh>vx%4QYiechY*g7w;*{Tr))vB;`<)AKOo=WqLl z#y9H5-;lqZs#>$uK9+4=;8SU%PPKVMDqy6%NX7_)-0JqMQLtM-_pNO; zGGAlMJ3Xs0;n2lI1-g1gZu5zaz31v;_d*%LN`uqmw-;h?SENjGs>llE;59u zW?hhqn941hblX$8l$u<+$a6+3o?gAq>w8{jf1LOCyU*|aJ3p+aEK~&mfLXxH7@_rN zmO(NV0szYp03Z*j0;u4v(L`EU#8zK|JRs}mUF|9<-xw$$*zlS0jmh!xXoeOYOQy zmGz{Ygf0IPeDjJlWw&=;#jKy}U7!GEmhKCCb(}!-qw26AnDT@g&rjN(#$?EX*I(L# zY{cezbki>#0xu}3#)t*zMv~+a_b&M*_1R5??*HubDznLW*T&jHMOniO+X>+Tgb6NW z{9gB}9&sYk2cw8gkk3!x!SDBncYmN-Y%P1%ZeC48uBBsRxt5g&n+6Vccs$#YoBi!8 zrv<6vq7=d_XhpEqsCBw`1l)mE%%gYI&SD<_ea9xpqR;>yg`Aiw$R)rK@orQ*!o}6q z3%Ph|$pzX#qEEwzt;D7#$USZM9n zfs71sR8XiMqft3v!k^ofzk5Br)#UtP#dD6BPI9!%#~a7H_>AG&(OY|VnYWOLUxx>y z`W+rD+g9TceP8Z<(tr*6q^8%sAS2X^%^R)?1;SZ|?A>)E-cRc6jfCNeY^8|#TJKGS zF)3J~3zBB?QS-KlopIfu&&F~gYG;!m+}^z+it>Hl<~T}R*#sQ>)7ALvdDi{M6==#b z08jw>3jg6MHHs2W3XYz%^{jWatE8m1W~8sdGp!Vp2Ajupv%2AZ4d}Gf87s7%G5uYv zhC^kgL7a!DCwicVa&g>YH}UJPkf9ofzW)0{NTo+`J!%~OT1LS_m7~w_zeIj)US;Q$ z?XG9qUSXx&qCIBT$S1)&uj`M`sg3bS^1}BHddBiakG1LY;&b>6s5o&^R{0UiKHmI? zTFyoz^NJtFW+Hr3;te3@#tPvr8%eYQ5vME5Vv|iW3wB{Nz*tmaW?Omh#2ml0Z|+rI zIM)fTBEQgw5pLxfdF`vI?C{6(r0nI+X#R`cP9Z&at6V$M1M}eMD}7iE{)3$rafY;z zMdA?W(42iv0s4oB#!$RH0X=W}Z3V{;;54o=5zOALH7^d7x6b_)r~??N_Q|y*A^0hH z0){$E66o|a7lKJjN}A@LG?&QRdWtI_A8oUD>rsDMRHc{9c6(Z>W%Spn+q2R%N&$Df zy)v)Xm2lsWQNB0D?t7`i}4w_>;^&H=)5oU(w<#Q3lo~+@fR9 z)A$?ikOirJZxq z$Q_oGmR$~Fpp}UXv^1Ark)8k}#Sr>g7U0X4U?FF`EWs>B1y3^Cz+5FIWi&RK;fzsh ztlR3L)}~8U3+X&tGnEKcQyRONhG?0kfU7qY3 zg(0TJbJSAt=PzOfjd$eJO+74drHP@-VZ9=#0vj?L=Hnb-0nQ-;}lt@CtN4akzNItZ9raR~q> QCkb8-yiS7auzK>>e~QEwrvLx| diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/Functions/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/Functions/subdir.mk deleted file mode 100644 index ac441926eb3..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/Functions/subdir.mk +++ /dev/null @@ -1,31 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../Functions/Func1.cpp - -CPP_DEPS += \ -./Functions/Func1.d - -OBJS += \ -./Functions/Func1.o - - -# Each subdirectory must supply rules for building sources it contributes -Functions/%.o: ../Functions/%.cpp Functions/subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean-Functions - -clean-Functions: - -$(RM) ./Functions/Func1.d ./Functions/Func1.o - -.PHONY: clean-Functions - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/makefile deleted file mode 100644 index 72baa7f19f5..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/makefile +++ /dev/null @@ -1,71 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include Functions/subdir.mk --include subdir.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C++_DEPS)),) --include $(C++_DEPS) -endif -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -endif - --include ../makefile.defs - -OPTIONAL_TOOL_DEPS := \ -$(wildcard ../makefile.defs) \ -$(wildcard ../makefile.init) \ -$(wildcard ../makefile.targets) \ - - -BUILD_ARTIFACT_NAME := Test21CXX -BUILD_ARTIFACT_EXTENSION := -BUILD_ARTIFACT_PREFIX := -BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),) - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: main-build - -# Main-build Target -main-build: Test21CXX - -# Tool invocations -Test21CXX: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) - @echo 'Building target: $@' - @echo 'Invoking: GCC C++ Linker' - g++ -o "Test21CXX" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) Test21CXX - -@echo ' ' - -.PHONY: all clean dependents main-build - --include ../makefile.targets diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/objects.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/objects.mk deleted file mode 100644 index 742c2da043f..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/sources.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/sources.mk deleted file mode 100644 index dbbe731afad..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/sources.mk +++ /dev/null @@ -1,28 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -ASM_SRCS := -C++_SRCS := -CC_SRCS := -CPP_SRCS := -CXX_SRCS := -C_SRCS := -C_UPPER_SRCS := -OBJ_SRCS := -O_SRCS := -S_UPPER_SRCS := -C++_DEPS := -CC_DEPS := -CPP_DEPS := -CXX_DEPS := -C_DEPS := -C_UPPER_DEPS := -EXECUTABLES := -OBJS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -Functions \ -. \ - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/subdir.mk deleted file mode 100644 index 1e71ee90931..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/subdir.mk +++ /dev/null @@ -1,31 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -../main.c - -C_DEPS += \ -./main.d - -OBJS += \ -./main.o - - -# Each subdirectory must supply rules for building sources it contributes -%.o: ../%.c subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean--2e- - -clean--2e-: - -$(RM) ./main.d ./main.o - -.PHONY: clean--2e- - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Test21CXX.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Test21CXX.zip deleted file mode 100644 index 6c9cac6395d2e82f5a1ff34e57f16944225294c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2051 zcmZ{lc{tR09LIkc)-|pM*_=gZm_FW|Qej|(bPiuTaHuy@B3{Qlt=v-@>zJhz1+AO(QnE!RdDnCmHjAEY|v3(G4)!tcTq_WG32(JOS^1g zXWembhU&wX#fyTWWukYLCxn*gT9mKN$5xBR@!T7Ecjo(nT?@qXRX9g`)OLf;wsB{kQpZgo(cO*;#64HqQCJ zi~${q>$|PCfFiuqd*Ca4fyV6rFp*D&2{R~MDFIx+meDdv#Zr+?A-S^=O|pyB&e3P7 zaVx$xD~+p1RwXfCbkqZN3}hms)i?m)0jQ+FXB`7B_T24!T|mXIkK?S4&2 z5!2=DPr}4y#kyOF<3-Od@t0%zjP5dC+RbJp7bV4wFL*O;A-`8&W_IO7{=<+Tos=5p z%pP)~SH&8*NB6)}Scw`_MWfIw{u&xQnhZ-xrT4`(KdleFYn%s4CEX0rjwM(+loA)J z7(kJigbx(jXLrFc@=(K4D>_eocQlFneQPE1=lP475woWJCWV@fIZ`>4(9pFxhFKBx z!9ZnF0@GbshkvLWlKqe{;P6S;>r6JaDe5-ieydDPUzrPYign4k6mBmCx0kHidrST` zQN=^wafH-w7#P@iX!e#81qRPJ-ic+>HxsQ(!o4!gmJ z9G+CJ_3&IXEi2ic)yY@A!THIhGmB3TH@%f@Zg!q(v-z4dd*i?2q-2hR#{d*enwOpQ z_L#rj_bKU}ew+$0!VBM?i^y8ZI#o&C%(9u9Jg?Uh8iybnl0l`KUH+LW=0WTqUGXzV~im)}C~;cQw{x@%ACIe2HjR zk_C(=Bg4T;JC4eArczIr)yL@#mZBOxj&LWhe^7T5lrWAT#m&glA6g!U2)4Y*&y$6Y zG??J>=mrJOI$>j)a^1?GKFpMktq8EA;RnM2fF!2??Tv@eU;JP+$3pz@!JhtpK^hwl zKE_8HJ9M_6g~ zF(6thDDjGLnyxC$M_dI~CoV{dxlZoO=ppM9_~jdjR|SBbEu)k_wc3E~@L=(PEq!sG zehB>kcCnzq&D7iM7+cK%O|3-~C7c#UL(h%SJM^h8uC@_1sYVx$xu(YwCDQCl$}yeo zEqoa&=IXXog2y55nKuyrEKVr*3AB?sI0px(B-f8_6DT+j0D!w0cof5a+IF{aZ{97~ zFklDc`y*gG;|i!MoAJd|kg|Cg?4*3J_jbw(7f9KT*u3Dj5I@pj69E7sz#~H#H?Ttr za1OQ<-~OBLb=W?K?GDH`IY8Q`7+WK4=F6t-T '$(@:%.o=%.d)' && \ - gcc -MM -MG -P -w -O0 -g3 -Wall -c -fmessage-length=0 "$<" >> '$(@:%.o=%.d)' - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean--2e- - -clean--2e-: - -$(RM) ./f1.d ./f1.o ./f2.d ./f2.o - -.PHONY: clean--2e- - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/f1.c b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/f1.c deleted file mode 100644 index 5e77893b8a6..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/f1.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include "test_ar.h" - -void f1_ar() -{ - printf ( "Hello from f1_ar.\n" ) ; - return ; -} diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/f2.c b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/f2.c deleted file mode 100644 index 56e2c730d4d..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/f2.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include "test_ar.h" - -void f2_ar() -{ - printf ( "Hello from f2_ar.\n" ) ; - return ; -} diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/test_ar.h b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/test_ar.h deleted file mode 100644 index 55e38f0d5ac..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/test_ar.h +++ /dev/null @@ -1,2 +0,0 @@ -void f1_ar() ; -void f2_ar() ; diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/makefile deleted file mode 100644 index 393dcbbf012..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/makefile +++ /dev/null @@ -1,55 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include subdir.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -endif - --include ../makefile.defs - -OPTIONAL_TOOL_DEPS := \ -$(wildcard ../makefile.defs) \ -$(wildcard ../makefile.init) \ -$(wildcard ../makefile.targets) \ - - -BUILD_ARTIFACT_NAME := linkedLib -BUILD_ARTIFACT_EXTENSION := a -BUILD_ARTIFACT_PREFIX := lib -BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),) - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: main-build - -# Main-build Target -main-build: liblinkedLib.a - -# Tool invocations -liblinkedLib.a: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) - @echo 'Building target: $@' - @echo 'Invoking: archiver.gnu' - ar -r "liblinkedLib.a" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) liblinkedLib.a - -@echo ' ' - -.PHONY: all clean dependents main-build - --include ../makefile.targets diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/objects.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/objects.mk deleted file mode 100644 index 742c2da043f..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/sources.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/sources.mk deleted file mode 100644 index b9165764518..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/sources.mk +++ /dev/null @@ -1,15 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -C_SRCS := -O_SRCS := -S_SRCS := -S_UPPER_SRCS := -C_DEPS := -OBJS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/subdir.mk deleted file mode 100644 index b5d3a08e215..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/subdir.mk +++ /dev/null @@ -1,45 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -C:/Documents\ and\ Settings/ltreggia/CDTMBSTest/f1.c \ -C:/Documents\ and\ Settings/ltreggia/CDTMBSTest/f2.c - -OBJS += \ -./f1.o \ -./f2.o - -C_DEPS += \ -./f1.d \ -./f2.d - - -# Each subdirectory must supply rules for building sources it contributes -f1.o: C:/Documents\ and\ Settings/agvozdev/CDTMBSTest/f1.c subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: compiler.gnu.c' - gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "$@" "$<" && \ - echo -n '$(@:%.o=%.d)' $(dir $@) > '$(@:%.o=%.d)' && \ - gcc -MM -MG -P -w -O0 -g3 -Wall -c -fmessage-length=0 "$<" >> '$(@:%.o=%.d)' - @echo 'Finished building: $<' - @echo ' ' - -f2.o: C:/Documents\ and\ Settings/agvozdev/CDTMBSTest/f2.c subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: compiler.gnu.c' - gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "$@" "$<" && \ - echo -n '$(@:%.o=%.d)' $(dir $@) > '$(@:%.o=%.d)' && \ - gcc -MM -MG -P -w -O0 -g3 -Wall -c -fmessage-length=0 "$<" >> '$(@:%.o=%.d)' - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean--2e- - -clean--2e-: - -$(RM) ./f1.d ./f1.o ./f2.d ./f2.o - -.PHONY: clean--2e- - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/f1.c b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/f1.c deleted file mode 100644 index 5e77893b8a6..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/f1.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include "test_ar.h" - -void f1_ar() -{ - printf ( "Hello from f1_ar.\n" ) ; - return ; -} diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/f2.c b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/f2.c deleted file mode 100644 index 56e2c730d4d..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/f2.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include "test_ar.h" - -void f2_ar() -{ - printf ( "Hello from f2_ar.\n" ) ; - return ; -} diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/linkedLib.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/linkedLib.zip deleted file mode 100644 index f33607388fb3597b816a572dcaf55d02aa88ff80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1462 zcmWIWW@Zs#U|`^2c(r?xQ3TKC`=(3`3?*C)44e$240_2aB}t{3IVqtboD9qzAIh9S zIJAO=;cVp3>bKM4^Jg1~9KEmp)>>iz^^HFtORSCDaxrh#6~C*~-rhCj`^sfz|i~Cu&%U|DgX8($*dA6nh^(Oq}nG$rj^N*LF z;(6UQRhKt~I-mAY)Y-CVV{25q#5BKFPZxo?%QP4plcvsSRDZ2-LnQvsy1Ta=O&w1k z*&1~+DR)M${SwvcXKz*e@AavPpDtx|ZsAzSsn+iye)>?Of$|jDKz5ch5j&Ia)V*Ex zdX8uw;@;mHVgIOrW|zUZ~ob+-fAW$Jp{Hgt1z zxIzaRH;W@GJ(uSivUZ;le%t;rbZ546=yMmSU2aM8Dr@_izbMQ8nw+{%koaQGWiO^=nzDUn)#oXkwIjm!(q+|a9A^~gbF+y| zT)BIa@X>1$2NaciE^{b%asKOmGArlb$z8vv|L6YC5P*{4{E8A@@G&wlEC41tZfJrl zD9X=DO)kNj8qbUF)LJ!7?{RL)A5 zS8Fsorupst{rSS$mshOz%IChK(W|)o+xi*o8e2jlT5|SA`Q$~Glvf(|I!sxWm!P!7 z@<;xf`%~8*d}aF5U*K4m&*5Y^l?miv^#FnJ+1EK^!_t!xzDyJs)^09uUj6Z14Wn8rW%A)Tqp^V?+(hZ{PFY+y-Xl+raST0EH#K zfUKS9n0Ht~!1emdDb^A9#An5d-^MiYt}kleNv2CT}`z&}WG+SFPHQAT3i>>G1z33A{I&B=24?miBR4tf~vDh&8 z{IdU2|8}_~>UY-Wx#>O^dGc+->+?IA0=yZS#F=pwYP`S@VqgFU5yOE-5DTe@V}%rP zp%o0kRElZ_YC1(WqY#*KL1w@M8;>cdF@$W&US^;v*o|Oi138l!2+soP%Pb%s0Q5*^ AT>t<8 diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/test_ar.h b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/test_ar.h deleted file mode 100644 index 55e38f0d5ac..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/test_ar.h +++ /dev/null @@ -1,2 +0,0 @@ -void f1_ar() ; -void f2_ar() ; diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/makefile deleted file mode 100644 index 0eb1f4f0353..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/makefile +++ /dev/null @@ -1,70 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include source2/source21/subdir.mk --include source2/subdir.mk --include source1/subdir.mk --include subdir.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -endif - --include ../makefile.defs - -OPTIONAL_TOOL_DEPS := \ -$(wildcard ../makefile.defs) \ -$(wildcard ../makefile.init) \ -$(wildcard ../makefile.targets) \ - - -BUILD_ARTIFACT_NAME := testResCfg -BUILD_ARTIFACT_EXTENSION := -BUILD_ARTIFACT_PREFIX := -BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),) - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: main-build - -# Main-build Target -main-build: testResCfg - -# Tool invocations -testResCfg: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) - @echo 'Building target: $@' - @echo 'Invoking: linker.gnu.cpp' - g++ --strip-all -o "testResCfg" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) testResCfg - -@echo ' ' - -.PHONY: all clean dependents main-build - --include ../makefile.targets diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/objects.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/objects.mk deleted file mode 100644 index 742c2da043f..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source1/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source1/subdir.mk deleted file mode 100644 index 30d32f56b98..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source1/subdir.mk +++ /dev/null @@ -1,33 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../source1/Class1.cpp - -CPP_DEPS += \ -./source1/Class1.d - -OBJS += \ -./source1/Class1.o - - -# Each subdirectory must supply rules for building sources it contributes -source1/%.o: ../source1/%.cpp source1/subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: compiler.gnu.cpp' - g++ -I../headers -O0 -g3 -Wall -c -fmessage-length=0 -o "$@" "$<" && \ - echo -n '$(@:%.o=%.d)' $(dir $@) > '$(@:%.o=%.d)' && \ - g++ -MM -MG -P -w -I../headers -O0 -g3 -Wall -c -fmessage-length=0 "$<" >> '$(@:%.o=%.d)' - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean-source1 - -clean-source1: - -$(RM) ./source1/Class1.d ./source1/Class1.o - -.PHONY: clean-source1 - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source2/source21/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source2/source21/subdir.mk deleted file mode 100644 index 430a3131c58..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source2/source21/subdir.mk +++ /dev/null @@ -1,33 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../source2/source21/Class21.cpp - -CPP_DEPS += \ -./source2/source21/Class21.d - -OBJS += \ -./source2/source21/Class21.o - - -# Each subdirectory must supply rules for building sources it contributes -source2/source21/Class21.o: ../source2/source21/Class21.cpp source2/source21/subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: compiler.gnu.cpp' - g++ -DRESSPEC -I../headers -O0 -g3 -Wall -c -o "$@" "$<" && \ - echo -n '$(@:%.o=%.d)' $(dir $@) > '$(@:%.o=%.d)' && \ - g++ -MM -MG -P -w -DRESSPEC -I../headers -O0 -g3 -Wall -c "$<" >> '$(@:%.o=%.d)' - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean-source2-2f-source21 - -clean-source2-2f-source21: - -$(RM) ./source2/source21/Class21.d ./source2/source21/Class21.o - -.PHONY: clean-source2-2f-source21 - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source2/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source2/subdir.mk deleted file mode 100644 index 81937df1541..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/source2/subdir.mk +++ /dev/null @@ -1,33 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../source2/Class2.cpp - -CPP_DEPS += \ -./source2/Class2.d - -OBJS += \ -./source2/Class2.o - - -# Each subdirectory must supply rules for building sources it contributes -source2/%.o: ../source2/%.cpp source2/subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: compiler.gnu.cpp' - g++ -I../headers -O0 -g3 -Wall -c -fmessage-length=0 -o "$@" "$<" && \ - echo -n '$(@:%.o=%.d)' $(dir $@) > '$(@:%.o=%.d)' && \ - g++ -MM -MG -P -w -I../headers -O0 -g3 -Wall -c -fmessage-length=0 "$<" >> '$(@:%.o=%.d)' - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean-source2 - -clean-source2: - -$(RM) ./source2/Class2.d ./source2/Class2.o - -.PHONY: clean-source2 - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/sources.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/sources.mk deleted file mode 100644 index 047eb222b70..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/sources.mk +++ /dev/null @@ -1,26 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -CC_SRCS := -CPP_SRCS := -CXX_SRCS := -C_SRCS := -C_UPPER_SRCS := -O_SRCS := -S_SRCS := -S_UPPER_SRCS := -CC_DEPS := -CPP_DEPS := -CXX_DEPS := -C_DEPS := -C_UPPER_DEPS := -OBJS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ -source1 \ -source2 \ -source2/source21 \ - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/subdir.mk deleted file mode 100644 index 06b849c326e..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/subdir.mk +++ /dev/null @@ -1,33 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../main.cpp - -CPP_DEPS += \ -./main.d - -OBJS += \ -./main.o - - -# Each subdirectory must supply rules for building sources it contributes -%.o: ../%.cpp subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: compiler.gnu.cpp' - g++ -I../headers -O0 -g3 -Wall -c -fmessage-length=0 -o "$@" "$<" && \ - echo -n '$(@:%.o=%.d)' $(dir $@) > '$(@:%.o=%.d)' && \ - g++ -MM -MG -P -w -I../headers -O0 -g3 -Wall -c -fmessage-length=0 "$<" >> '$(@:%.o=%.d)' - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean--2e- - -clean--2e-: - -$(RM) ./main.d ./main.o - -.PHONY: clean--2e- - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/testResCfg.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/testResCfg.zip deleted file mode 100644 index 8d05bfc970f2b09e0b467cd74ce70671b8ba297d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3182 zcmaJ^c|4Ts7a!Tz#MsN0DGVlKtoITjG>oxJ7{-u&7k(v-NcMdR7iH{AWvLNK3)!Ph z*+Pb7DMIS1`%YIGQ@?xO&-wHFobUOb<#}E-l9mn(VgkN>p*{*`H+!|*X+aJ534XrLrVb~%@QFXp z?B~Mj=f~J7hlcbMRW&vy^QO}~LtWG(Du={HxKRSvMU&%H`qJe$!&Vn1B@P!JJ+GpX zOAr`sQt2s9fCmWdmBYz#$HFW=Fp6(AqUt~WS;!M(*7TwpAQ`b*{c|A%rsA0035()q zPNwA-j%5&>=@Y$7iX-eFomDv-6E;sDR%qDdbUxp^^BmE>ofF!vNlM2iDaVah5Q9ow z60bK)-smbY45+F^qSFm6EihP4UIFVu+19rqQChT}9A1-~Rm|7D)gVZ_5s0jlUdYHQ zmxtY=#DbCVjG=Eb(fVP*9Z30P%Af{Ik3S}{)lkMG`*!5J+um*6H#`$$x=Wocqt_X{ z{SbXutCJ$LOeZXGs(+?p?0=K0qc@P8Y9cheG`?BxM=KI_$c;73 zBm4Drx0+hxYE<6aM){YjAKN=#zCx?r#R)C+iye0;Uhd^vZ4Lv~M)++w4$~xrj^Fs2 ze5G+-*(>d^mj%1Ih4kGqDSV|g_%mWeZV?joYIIU*R@}C5AS8pti8XA@dyo0WA)P+RwAzFF+ttGfQ%tqrx_oKXv- zZyXO|`51bGCp;7dU2%0f9S1I+Z3=Nd`bux+v%kD14wmXaIh=HDOLL(m$1~~a;MByK z)y=i=zr$(JNJb{gF+}egQ2wfe#@sX@(Apjlh;@5Fef@phot*+3)7nw@kFdoo>$hlU zezAG|z>zS2{G#-rX}ikRlpL<-YMFUPVAOrb8PG9NPl|@MwXjDxu>IFzkxZ~20az^OlU|%G@%Ul2$A`<_Tf!P z8|e`;rOv~`KosMOH|hDrl9NYMKojUtH^|awtUs|Pp(2is^Jx}sHR0_<3ForE>UGmL zlu-#=Hxw)LYOhd7G~9%2#D^F0c43NE!H__`$Xm72jR9-8F81IuI9kNp<5nmmqG2(6 zJu?*A!*UXd4@I%P1Z{ag_6QgiMI^;wEH6I{J(oRtr&nafIiJ)u4PqPJ`r>d7eeGL; z(iRqAuTOS>st?r z{88cbgi|^!E{4QEo+wO~=oWH5QJOV?P8mEq~m$^ zMlAV6nY5dWhAV?$FMqo}BDVh5!c=BFyOy^^ujS` zX_rV91r1DDl?viXSid@>aQ6IW9Vg}Jv90iD3t{)psbd2{q@f zuz(gpfRi=xa&+^SbMp0t#A~rch=S=~Fpp1~a?OQYk{H`^EO;wVH8>f|`IP%^)R&$`GyT&FnuShdSM=>kp2xkx$OUR#&$J=;MEv2K<*a;waPj;18LV z;N^p=MCl*2uXVSt#SfL__u`=Ta;Vs%m{P?QyR4Jurk8WBqAyBVd$7YbRTW_n1tTpC zt7C1J28{1JHA(`zso8@j^`HQ)6M%C89^ez?@8m51Lt&r?%=&wg{Zd8-7HI!|0~tA` zr#)yuvKhQ@b+u?i%psVSBFswmhT(x`@b^%Z2ks7KeyNx7*HG|(L&3@IMjdMCze7Y9Qs}A+MJmTcq1rz|<(p zwXhpS!?3fWs8N(tNM0E`mJ6V$7YH?)a!_`o9T=(5z}!-!DSMwhOgr`kK>s>g)OgB< z-i>zw1lVp~ig}^NQ?@3#?RRXD0{^=qpgxJRd&sT4V|u_3!Vf0DoCGLB52y?Ru>hYt MaKSE-e '$(@:%.o=%.d)' && \ - gcc -MM -MG -P -w -O0 -g3 -Wall -c -fmessage-length=0 "$<" >> '$(@:%.o=%.d)' - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean--2e- - -clean--2e-: - -$(RM) ./main.d ./main.o - -.PHONY: clean--2e- - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/testSingleExe.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/testSingleExe.zip deleted file mode 100644 index f62e0141268f38b38e1b3b334d819bcd3d9d6a74..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1593 zcmWIWW@Zs#-~d8{%6#L+H4*0nm>3vVaWgP*GB7acC8v}mm1gFoyqy-CKifc}^}YIA zdxdwee=z4PHtpWFWwzSd;H_o5%MT>3NtmD*{QdoRA*Qoo+cmfBydB$gzEEzyxSvJr z9kHF?y>DA-pS`2b@q3*rKub%bIK=-a~zWU3( z(X(9En`tV^Br95QSDr7~=GEvDnLA5R`sch&zT3hIKc`yUoWOtPz^zMhTG7sriuZ5P zyi_6dc&W@jdNP>~|IB>xoMe-%Iqx zh7_E>t=?$+s<~RNr-dg&qiUbymajiHYqo@%PQCcjMTKKW&k_zL^VCq^$1as=dB>jr zSkEo!XfZMHMC$qNlWp`5dzSFYb1m+04!?My)!fi#!iyx+szZFzN+yS<6gjpT?G0{R zet0%-|NC#Z<6SNHTCQ!|)?mhI(A=(&v_<{Ls?UX2ciw(kUum_f;6$2B?YGH_Aw>rl zI3M17aZg6G+%oG2E-iv$28tVP(z^Q|)*QIK>|{hotIF~0OM#X5zAN(8PnXy=Pjwt{=2QSz@l6!;vYMJ6z7cxN`HIZrSgj54XRx5AbH^Ku&A{D9KP_ zwX(l3BLl-%U{VC8L~t@JD9X=DO)l9w>7d_X1D>|`9($ap{*HQZBys60w|1?IK?f}s zPnaQe&1&jw-@CUbZ_%FYApQ7&=C}9v=L=h2Ua?v`pZSVbuj1}6`ZL%ywuD5qy{X(e zBWCl9XMb{}8dro|KIG!D`Fniie(mVytJ0U`6?&GZoG_XCZ{5-Ds{5av@SdXMc2#)z15;_Faog zhD|*J=NQ!=DB0IB6nEwN##ZJrys_65A3 zEP17nMfB>ETp*cYkj$byHDaANZ|GZ&o*IVB1z~jyHqH;IY~!iY%1pXk z!^!f0@Aiq75quMuH9XtbvD(L!CAKTI+Vt=B57$+tsx{sem}c2cSGdo=^Unf(P=FwN z8#O@Yt$$l;2n+}#AZ7#N+{Da0z2wtpv;$B0o;h>*1dEYS_od0DB9n}Tx<$5ZX_#Z= z+nN=pcW%*@NtYJcusUbQt&57&V*pu#Y*c_ZBa;XN?xGZE6B2+ItmxX1BNCMK5uhEI z89>^g@rSMv*~6fCMu5xAh*(G0h3o@RU?9K~7Ff^(c(a0~SQuCsZUGf|vVv3r0HwB! AJpcdz diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/makefile deleted file mode 100644 index 1b7921c3ca3..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/makefile +++ /dev/null @@ -1,67 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include subdir.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -endif - --include ../makefile.defs - -OPTIONAL_TOOL_DEPS := \ -$(wildcard ../makefile.defs) \ -$(wildcard ../makefile.init) \ -$(wildcard ../makefile.targets) \ - - -BUILD_ARTIFACT_NAME := testDoubleSO -BUILD_ARTIFACT_EXTENSION := so -BUILD_ARTIFACT_PREFIX := lib -BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),) - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: main-build - -# Main-build Target -main-build: libtestDoubleSO.so - -# Tool invocations -libtestDoubleSO.so: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) - @echo 'Building target: $@' - @echo 'Invoking: linker.gnu.cpp' - g++ -shared -o "libtestDoubleSO.so" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) libtestDoubleSO.so - -@echo ' ' - -.PHONY: all clean dependents main-build - --include ../makefile.targets diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/objects.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/objects.mk deleted file mode 100644 index 742c2da043f..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/sources.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/sources.mk deleted file mode 100644 index 59afb7f9948..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/sources.mk +++ /dev/null @@ -1,23 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -CC_SRCS := -CPP_SRCS := -CXX_SRCS := -C_SRCS := -C_UPPER_SRCS := -O_SRCS := -S_SRCS := -S_UPPER_SRCS := -CC_DEPS := -CPP_DEPS := -CXX_DEPS := -C_DEPS := -C_UPPER_DEPS := -OBJS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/subdir.mk deleted file mode 100644 index 8d11a6a5406..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/subdir.mk +++ /dev/null @@ -1,36 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -../so1.c \ -../so2.c - -C_DEPS += \ -./so1.d \ -./so2.d - -OBJS += \ -./so1.o \ -./so2.o - - -# Each subdirectory must supply rules for building sources it contributes -%.o: ../%.c subdir.mk - @echo 'Building file: $<' - @echo 'Invoking: compiler.gnu.cpp' - g++ -DXXX -O0 -g3 -Wall -c -o "$@" "$<" && \ - echo -n '$(@:%.o=%.d)' $(dir $@) > '$(@:%.o=%.d)' && \ - g++ -MM -MG -P -w -DXXX -O0 -g3 -Wall -c "$<" >> '$(@:%.o=%.d)' - @echo 'Finished building: $<' - @echo ' ' - - -clean: clean--2e- - -clean--2e-: - -$(RM) ./so1.d ./so1.o ./so2.d ./so2.o - -.PHONY: clean--2e- - diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/testDoubleSO.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/testDoubleSO.zip deleted file mode 100644 index b498b49d03cd0588867a8ebede535f7306495ff9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1848 zcmZ{ldpOg39LImlZHUk+xx`M$nVtWaC zyq~4F-ASX*Ky5WH>gB!oLWb<8$C=Nox|r7Jo(2ocy(_-FPKiwTWyLPE)5e*?)ZVqLoIgqFG<#4$V?G7LKq-febXbWGCT^9#cex(bN6mOqsfBpN zaJBCVy>>ABLxr7 zTzPuRnR9_*4 z*esXP`ZUyYlTjn(x34v+`a7q`M`*u#duES4x}HcFD?ZrFHx0(j=(Il#l%J?7vvA?c zKAmdW6^8s#ziOKaz=jP4b;Tc<3Zib;@GqJtbHRbFByk!H=-8h=)n zI>0A)=E#GU4@lDX|J71j>H_gRoBrm+Y|H6z+fl1U|8xEKjVD3UFgc`xb70bmP5OSS z)-qF+UI>Uz*Yi!HN_cvv<^HY`LBDLub&bZxbOQVBkq*#8SJUkDa$ehOqS0n%sRG-C zZaA)Ov9*UZJUjb_8bkK)!~*?)1{OBNWymGG<=gJZV-N z<3z$dDj9`+a#F<`PC}MKy`-tgKFZ46gJmE0;NF#EESUdsvb=kmC{6`f*08k*z zhy3?!gj2|&Cy0^hX^psN$cK+ zbuXB==*@l{$lr{3Ra}N4%Xh<)pigEivt(clk0Y1E>V2F^gve-`QIhSgQj-5K_blhh zb{A>5jeWp!2&cmGw36DPXIk8@!F_R#0>2U0 z1vqY+M+2kAyDtcXT}P3n+^%8=%ht%+L+CC53y91gL>!OBtmno2csEy~k16`!yZ#ZZ2q^+n9$=N2g4O?WOHIRZCcuW1+=wlb^QAAQgi7>S~LM>CvqP zMQOU`9X+<6@*9%$8!1;!r5FOj(sK_x&QX0q^;qSFh|E)y4G)S|D|70*vJ6L5mM6w~ zY`)5hsEFTvJ(YoWfnb-AhGNX4Qlz-S78xRrfE@zSNOO8kJFu#;9{NamS#J|O3K^q{z z|IY=Xoml;t55vH d#4o*G!uci<;=*I4q(x3r!nIMD|E=Fn{{qzq=0^Yk diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCore20Tests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCore20Tests.java deleted file mode 100644 index b92fdb2db5c..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCore20Tests.java +++ /dev/null @@ -1,1950 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.managedbuilder.core.tests; - -import java.io.IOException; -import java.util.Arrays; -import java.util.Map; -import java.util.Properties; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.IScannerInfoChangeListener; -import org.eclipse.cdt.core.parser.IScannerInfoProvider; -import org.eclipse.cdt.core.testplugin.ResourceHelper; -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.IManagedProject; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.IProjectType; -import org.eclipse.cdt.managedbuilder.core.ITargetPlatform; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.cdt.managedbuilder.core.IToolChain; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; -import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature; -import org.eclipse.cdt.managedbuilder.internal.core.Option; -import org.eclipse.cdt.managedbuilder.testplugin.BuildSystemTestHelper; -import org.eclipse.cdt.managedbuilder.testplugin.ManagedBuildTestHelper; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceDescription; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/* - * These tests exercise CDT 2.0 manifest file functionality - */ -public class ManagedBuildCore20Tests extends TestCase { - private static final boolean boolVal = true; - private static final String testConfigId = "test.config.override"; - private static final String testConfigName = "Tester"; - private static final String enumVal = "Another Enum"; - private static final String[] listVal = { "_DEBUG", "/usr/include", "libglade.a" }; - private static final String newExt = "wen"; - private static final String projectName = "ManagedBuildTest"; - private static final String projectName2 = "ManagedBuildTest2"; - private static final String projectRename = "ManagedBuildRedux"; - private static final String rootExt = "toor"; - private static final String stringVal = "-c -Wall"; - private static final String anotherStringVal = "thevalue"; - private static final String subExt = "bus"; - - public ManagedBuildCore20Tests(String name) { - super(name); - } - - public static Test suite() { - TestSuite suite = new TestSuite(ManagedBuildCore20Tests.class.getName()); - - // Note that some of the tests are dependent on others so run the suite as a whole - suite.addTest(new ManagedBuildCore20Tests("testExtensions")); - suite.addTest(new ManagedBuildCore20Tests("testProjectCreation")); - suite.addTest(new ManagedBuildCore20Tests("testConfigurations")); - suite.addTest(new ManagedBuildCore20Tests("testConfigurationReset")); - suite.addTest(new ManagedBuildCore20Tests("testConfigBuildArtifact")); - suite.addTest(new ManagedBuildCore20Tests("testMakeCommandManipulation")); - suite.addTest(new ManagedBuildCore20Tests("testScannerInfoInterface")); - suite.addTest(new ManagedBuildCore20Tests("testProjectRename")); - suite.addTest(new ManagedBuildCore20Tests("testErrorParsers")); - suite.addTest(new ManagedBuildCore20Tests("cleanup")); - - return suite; - } - - /** - * Convert path to OS specific representation - */ - private String toOSLocation(String path) { - java.io.File file = new java.io.File(path); - try { - path = file.getCanonicalPath(); - } catch (IOException e) { - } - - return path; - } - - /** - * Convert path to OS specific representation - */ - private String toOSString(String path) { - return new Path(path).toOSString(); - } - - /** - * Navigates through the build info as defined in the extensions - * defined in this plugin - */ - public void testExtensions() throws Exception { - IProjectType testRoot = null; - IProjectType testSub = null; - IProjectType testSubSub = null; - IProjectType testForwardChild = null; - IProjectType testForwardParent = null; - IProjectType testForwardGrandchild = null; - int numTypes = 0; - - // Note secret null parameter which means just extensions - IProjectType[] projTypes = ManagedBuildManager.getDefinedProjectTypes(); - - for (int i = 0; i < projTypes.length; ++i) { - IProjectType type = projTypes[i]; - - if (type.getName().equals("Test Root")) { - testRoot = type; - checkRootProjectType(testRoot); - } else if (type.getName().equals("Test Sub")) { - testSub = type; - checkSubProjectType(testSub); - } else if (type.getName().equals("Test Sub Sub")) { - testSubSub = type; - checkSubSubProjectType(testSubSub); - } else if (type.getName().equals("Forward Child")) { - testForwardChild = type; - } else if (type.getName().equals("Forward Parent")) { - testForwardParent = type; - } else if (type.getName().equals("Forward Grandchild")) { - testForwardGrandchild = type; - } else if (type.getId().startsWith("test.provider.Test_")) { - numTypes++; - checkProviderProjectType(type); - } - } - // check that the forward references are properly resolved. - assertNotNull(testForwardChild); - assertNotNull(testForwardParent); - assertNotNull(testForwardGrandchild); - checkForwardProjectTypes(testForwardParent, testForwardChild, testForwardGrandchild); - - // check that the proper number of projectTypes were dynamically provided - assertEquals(3, numTypes); - - // All these project types are defines in the plugin files, so none - // of them should be null at this point - assertNotNull(testRoot); - assertNotNull(testSub); - assertNotNull(testSubSub); - } - - /** - * This test exercises the interface the IConfiguration exposes to manipulate - * its make command. - */ - public void testMakeCommandManipulation() { - String oldMakeCmd = "make"; - String newMakeCmd = "Ant"; - - // Open the test project - IProject project = null; - try { - project = createProject(projectName); - IProjectDescription description = project.getDescription(); - // Make sure it has a managed nature - if (description != null) { - assertTrue(description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)); - } - } catch (CoreException e) { - fail("Failed to open project in 'testMakeCommandManipulation': " + e.getLocalizedMessage()); - } - assertNotNull(project); - - // Now get the default configuration - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - assertNotNull(info); - IManagedProject managedProj = info.getManagedProject(); - assertNotNull(managedProj); - IConfiguration defaultConfig = info.getDefaultConfiguration(); - assertNotNull(defaultConfig); - - // Does it have a default build command - assertFalse(defaultConfig.hasOverriddenBuildCommand()); - assertEquals(oldMakeCmd, defaultConfig.getBuildCommand()); - - // Change it - defaultConfig.setBuildCommand(newMakeCmd); - assertEquals(newMakeCmd, defaultConfig.getBuildCommand()); - assertTrue(defaultConfig.hasOverriddenBuildCommand()); - - // Reset it - defaultConfig.setBuildCommand(null); - assertFalse(defaultConfig.hasOverriddenBuildCommand()); - assertEquals(oldMakeCmd, defaultConfig.getBuildCommand()); - - ManagedBuildManager.saveBuildInfo(project, false); - } - - /** - * The purpose of this test is to exercise the build path info interface. - * To get to that point, a new project/config has to be created in the test - * project and the default configuration changed. - */ - public void testScannerInfoInterface() { - // Open the test project - IProject project = null; - try { - project = createProject(projectName); - IProjectDescription description = project.getDescription(); - // Make sure it has a managed nature - if (description != null) { - assertTrue(description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)); - } - } catch (CoreException e) { - fail("Failed to open project in 'testScannerInfoInterface': " + e.getLocalizedMessage()); - } - - //These are the expected path settings - IPath buildCWD = project.getLocation().append("Sub Config"); - final String[] expectedPaths; - if (new Path("C:\\home\\tester/include").isAbsolute()) { - // Windows - expectedPaths = new String[] { toOSLocation("/usr/include"), toOSLocation("/opt/gnome/include"), - toOSLocation("C:\\home\\tester/include"), - // relative paths from MBS will make 3 entries - project.getLocation().append("includes").toOSString(), buildCWD.append("includes").toOSString(), - toOSString("includes"), "/usr/gnu/include", // Not converted to OS string due to being flagged as ICSettingEntry.RESOLVED - }; - } else { - // Unix - expectedPaths = new String[] { toOSLocation("/usr/include"), toOSLocation("/opt/gnome/include"), - // on unix "C:\\home\\tester/include" is relative path - // looks like nonsense but it this way due to MBS converting entry to keep "Sub Config/C:\\home\\tester/include" in its storage - project.getLocation().append("Sub Config/C:\\home\\tester/include").toOSString(), - buildCWD.append("Sub Config/C:\\home\\tester/include").toOSString(), - toOSString("Sub Config/C:\\home\\tester/include"), - // relative paths from MBS will make 3 entries - project.getLocation().append("includes").toOSString(), buildCWD.append("includes").toOSString(), - toOSString("includes"), "/usr/gnu/include", // Not converted to OS string due to being flagged as ICSettingEntry.RESOLVED - }; - } - - // Create a new managed project based on the sub project type - IProjectType projType = ManagedBuildManager.getExtensionProjectType("test.sub"); - assertNotNull(projType); - - // Create the managed-project for our project - IManagedProject newProject = null; - try { - newProject = ManagedBuildManager.createManagedProject(project, projType); - } catch (BuildException e) { - fail("Failed creating new project: " + e.getLocalizedMessage()); - } - assertNotNull(newProject); - ManagedBuildManager.setNewProjectVersion(project); - - // Copy over the configs - IConfiguration[] baseConfigs = projType.getConfigurations(); - for (int i = 0; i < baseConfigs.length; ++i) { - newProject.createConfiguration(baseConfigs[i], baseConfigs[i].getId() + "." + i); - } - - // Change the default configuration to the sub config - IConfiguration[] configs = newProject.getConfigurations(); - assertEquals(4, configs.length); - IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project); - buildInfo.setDefaultConfiguration(newProject.getConfiguration(configs[0].getId())); - buildInfo.setValid(true); - // Save, close, reopen - ManagedBuildManager.saveBuildInfo(project, true); - ManagedBuildManager.removeBuildInfo(project); - try { - ResourceHelper.joinIndexerBeforeCleanup(getName()); - project.close(null); - } catch (CoreException e) { - fail("Failed on project close: " + e.getLocalizedMessage()); - } - try { - project.open(null); - } catch (CoreException e) { - fail("Failed on project open: " + e.getLocalizedMessage()); - } - buildInfo = ManagedBuildManager.getBuildInfo(project); - - // Use the plugin mechanism to discover the supplier of the path information - IExtensionPoint extensionPoint = Platform.getExtensionRegistry() - .getExtensionPoint(CCorePlugin.PLUGIN_ID + ".ScannerInfoProvider"); - if (extensionPoint == null) { - fail("Failed to retrieve the extension point ScannerInfoProvider."); - } - - // Find the first IScannerInfoProvider that supplies build info for the project - IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(project); - assertNotNull(provider); - - // Now subscribe (note that the method will be called after a change - provider.subscribe(project, new IScannerInfoChangeListener() { - @Override - public void changeNotification(IResource project, IScannerInfo info) { - // Test the symbols: expect "BUILTIN" from the manifest, and "DEBUG" and "GNOME=ME" - // from the overidden settings - Map definedSymbols = info.getDefinedSymbols(); - assertTrue(definedSymbols.containsKey("BUILTIN")); - assertTrue(definedSymbols.containsKey("DEBUG")); - assertTrue(definedSymbols.containsKey("GNOME")); - assertTrue(definedSymbols.containsValue("ME")); - assertEquals(definedSymbols.get("BUILTIN"), ""); - assertEquals(definedSymbols.get("DEBUG"), ""); - assertEquals(definedSymbols.get("GNOME"), "ME"); - // Test the includes path - String[] actualPaths = info.getIncludePaths(); - BuildSystemTestHelper.checkDiff(expectedPaths, actualPaths); - } - }); - - // Check the build information before we change it - IScannerInfo currentSettings = provider.getScannerInformation(project); - - Map currentSymbols = currentSettings.getDefinedSymbols(); - // It should simply contain the built-in - assertTrue(currentSymbols.containsKey("BUILTIN")); - assertEquals(currentSymbols.get("BUILTIN"), ""); - - String[] currentPaths = currentSettings.getIncludePaths(); - BuildSystemTestHelper.checkDiff(expectedPaths, currentPaths); - - // Add some defined symbols programmatically - String[] expectedSymbols = { "DEBUG", "GNOME = ME " }; - IConfiguration defaultConfig = buildInfo.getDefaultConfiguration(); - ITool[] tools = defaultConfig.getTools(); - ITool subTool = null; - for (int i = 0; i < tools.length; i++) { - ITool tool = tools[i]; - if ("tool.sub".equalsIgnoreCase(tool.getSuperClass().getId())) { - subTool = tool; - break; - } - } - assertNotNull(subTool); - IOption symbolOpt = null; - IOption[] opts = subTool.getOptions(); - for (int i = 0; i < opts.length; i++) { - IOption option = opts[i]; - try { - if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) { - symbolOpt = option; - break; - } - } catch (BuildException e) { - fail("Failed getting option value-type: " + e.getLocalizedMessage()); - } - } - assertNotNull(symbolOpt); - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - assertFalse(info.isDirty()); - ManagedBuildManager.setOption(defaultConfig, subTool, symbolOpt, expectedSymbols); - assertTrue(info.isDirty()); - info.setDirty(false); - assertFalse(info.isDirty()); - } - - /** - * Create a new configuration based on one defined in the plugin file. - * Overrides all of the configuration settings. Saves, closes, and reopens - * the project. Then calls a method to check the overridden options. - * - * Tests creating a new configuration. - * Tests setting options. - * Tests persisting overridden options between project sessions. - * - */ - public void testConfigurations() throws CoreException, BuildException { - final String rootName = "Root Config"; - final String overrideName = "Root Override Config"; - final String completeOverrideName = "Complete Override Config"; - final String toolCmd = "doIt"; - final String newCmd = "never"; - - // Open the test project - IProject project = createProject(projectName); - IProjectDescription description = project.getDescription(); - // Make sure it has a managed nature - if (description != null) { - assertTrue(description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)); - } - - // Make sure there is a ManagedProject with 3 configs - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - IManagedProject managedProj = info.getManagedProject(); - IConfiguration[] definedConfigs = managedProj.getConfigurations(); - assertEquals(3, definedConfigs.length); - IConfiguration baseConfig = definedConfigs[0]; - assertEquals(definedConfigs[0].getName(), rootName); - assertEquals(definedConfigs[1].getName(), overrideName); - assertEquals(definedConfigs[2].getName(), completeOverrideName); - - // Create a new configuration and test the rename function - IConfiguration newConfig = managedProj.createConfigurationClone(baseConfig, testConfigId); - assertEquals(4, managedProj.getConfigurations().length); - newConfig.setName(testConfigName); - assertEquals(newConfig.getId(), testConfigId); - assertEquals(newConfig.getName(), testConfigName); - - // There is only one tool - ITool[] definedTools = newConfig.getTools(); - assertEquals(1, definedTools.length); - ITool rootTool = definedTools[0]; - - // Test changing its command - assertEquals(rootTool.getToolCommand(), toolCmd); - newConfig.setToolCommand(rootTool, newCmd); - assertEquals(rootTool.getToolCommand(), newCmd); - - // Override options in the new configuration - IOptionCategory topCategory = rootTool.getTopOptionCategory(); - assertEquals("Root Tool", topCategory.getName()); - Object[][] options = topCategory.getOptions(newConfig); - int i; - for (i = 0; i < options.length; i++) - if (options[i][0] == null) - break; - assertEquals(2, i); - ITool tool = (ITool) options[0][0]; - IOption option = (IOption) options[0][1]; - ManagedBuildManager.setOption(newConfig, tool, option, listVal); - option = (IOption) options[1][1]; - ManagedBuildManager.setOption(newConfig, tool, option, boolVal); - - IOptionCategory[] categories = topCategory.getChildCategories(); - assertEquals(1, categories.length); - options = categories[0].getOptions(newConfig); - for (i = 0; i < options.length; i++) - if (options[i][0] == null) - break; - assertEquals(4, i); - tool = (ITool) options[0][0]; - option = (IOption) options[0][1]; - ManagedBuildManager.setOption(newConfig, tool, option, stringVal); - option = (IOption) options[1][1]; - ManagedBuildManager.setOption(newConfig, tool, option, anotherStringVal); - option = (IOption) options[2][1]; - ManagedBuildManager.setOption(newConfig, tool, option, enumVal); - option = (IOption) options[3][1]; - ManagedBuildManager.setOption(newConfig, tool, option, "False"); - - // Save, close, reopen and test again - ManagedBuildManager.saveBuildInfo(project, false); - ManagedBuildManager.removeBuildInfo(project); - ResourceHelper.joinIndexerBeforeCleanup(getName()); - project.close(null); - project.open(null); - - // Test the values in the new configuration - checkOptionReferences(project); - - // Now delete the new configuration and test the managed project - info = ManagedBuildManager.getBuildInfo(project); - managedProj = info.getManagedProject(); - definedConfigs = managedProj.getConfigurations(); - assertEquals(4, definedConfigs.length); - managedProj.removeConfiguration(testConfigId); - definedConfigs = managedProj.getConfigurations(); - assertEquals(3, definedConfigs.length); - assertEquals(definedConfigs[0].getName(), rootName); - assertEquals(definedConfigs[1].getName(), overrideName); - ManagedBuildManager.saveBuildInfo(project, false); - } - - public void testConfigurationReset() { - // Open the test project - IProject project = null; - try { - project = createProject(projectName); - IProjectDescription description = project.getDescription(); - // Make sure it has a managed nature - if (description != null) { - assertTrue(description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)); - } - } catch (CoreException e) { - fail("Failed to open project: " + e.getLocalizedMessage()); - } - - // Get the default configuration - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - assertNotNull(info); - IManagedProject managedProj = info.getManagedProject(); - assertNotNull(managedProj); - IConfiguration defaultConfig = info.getDefaultConfiguration(); - assertNotNull(defaultConfig); - - // See if it still contains the overridden values (see testProjectCreation()) - try { - checkRootManagedProject(managedProj, "z"); - } catch (BuildException e1) { - fail("Overridden root managed project check failed: " + e1.getLocalizedMessage()); - } - - // Reset the config and retest - ManagedBuildManager.resetConfiguration(project, defaultConfig); - ManagedBuildManager.saveBuildInfo(project, false); - try { - checkRootManagedProject(managedProj, "x"); - } catch (BuildException e2) { - fail("Reset root managed project check failed: " + e2.getLocalizedMessage()); - } - } - - /** - * @throws BuildException - */ - public void testProjectCreation() throws BuildException { - // Create new project - IProject project = null; - try { - project = createProject(projectName); - // Now associate the builder with the project - ManagedBuildTestHelper.addManagedBuildNature(project); - IProjectDescription description = project.getDescription(); - // Make sure it has a managed nature - if (description != null) { - assertTrue(description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)); - } - - } catch (CoreException e) { - fail("Test failed on project creation: " + e.getLocalizedMessage()); - } - - // Find the base project type definition - IProjectType projType = ManagedBuildManager.getExtensionProjectType("test.root"); - assertNotNull(projType); - - // Create the managed-project for our project that builds a dummy executable - IManagedProject newProject = ManagedBuildManager.createManagedProject(project, projType); - assertEquals(newProject.getName(), projType.getName()); - assertFalse(newProject.equals(projType)); - ManagedBuildManager.setNewProjectVersion(project); - - // Copy over the configs - IConfiguration defaultConfig = null; - IConfiguration[] configs = projType.getConfigurations(); - for (int i = 0; i < configs.length; ++i) { - // Make the first configuration the default - if (i == 0) { - defaultConfig = newProject.createConfiguration(configs[i], projType.getId() + "." + i); - } else { - newProject.createConfiguration(configs[i], projType.getId() + "." + i); - } - } - ManagedBuildManager.setDefaultConfiguration(project, defaultConfig); - - String buildArtifactName = projectName; - defaultConfig.setArtifactName(buildArtifactName); - defaultConfig.setArtifactExtension(newExt); - - ManagedBuildManager.getBuildInfo(project).setValid(true); - - // Initialize the path entry container - IStatus initResult = ManagedBuildManager.initBuildInfoContainer(project); - if (initResult.getCode() != IStatus.OK) { - fail("Initializing build information failed for: " + project.getName() + " because: " - + initResult.getMessage()); - } - - // Now test the results out - checkRootManagedProject(newProject, "x"); - - // Override the "String Option in Category" option value - configs = newProject.getConfigurations(); - ITool[] tools = configs[0].getTools(); - IOptionCategory topCategory = tools[0].getTopOptionCategory(); - IOptionCategory[] categories = topCategory.getChildCategories(); - Object[][] options = categories[0].getOptions(configs[0]); - ITool tool = (ITool) options[0][0]; - IOption option = (IOption) options[0][1]; - configs[0].setOption(tool, option, "z"); - options = categories[0].getOptions((IConfiguration) null); - tool = (ITool) options[0][0]; - option = (IOption) options[0][1]; - assertEquals("x", option.getStringValue()); - options = categories[0].getOptions(configs[0]); - tool = (ITool) options[0][0]; - option = (IOption) options[0][1]; - assertEquals("z", option.getStringValue()); - - // Save, close, reopen and test again - ManagedBuildManager.saveBuildInfo(project, true); - ManagedBuildManager.removeBuildInfo(project); - try { - ResourceHelper.joinIndexerBeforeCleanup(getName()); - project.close(null); - } catch (CoreException e) { - fail("Failed on project close: " + e.getLocalizedMessage()); - } - try { - project.open(null); - } catch (CoreException e) { - fail("Failed on project open: " + e.getLocalizedMessage()); - } - - // Test that the default config was remembered - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - assertEquals(defaultConfig.getId(), info.getDefaultConfiguration().getId()); - - // Check the rest of the default information - checkRootManagedProject(newProject, "z"); - - // Now test the information the makefile builder needs - checkBuildTestSettings(info); - ManagedBuildManager.removeBuildInfo(project); - } - - /** - * Tests that bugzilla 44159 has been addressed. After a project was renamed, the - * build information mistakenly referred to the old project as its owner. This - * caused a number of searches on the information to fail. In this bug, it was the - * list of tools that could not be determined. In other cases, the information - * retrieval caused NPEs because the old owner no longer existed. - */ - public void testProjectRename() { - // Open the test project - IProject project = null; - try { - project = createProject(projectName); - IProjectDescription description = project.getDescription(); - // Make sure it has a managed nature - if (description != null) { - assertTrue(description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)); - } - } catch (CoreException e) { - fail("Failed to open project: " + e.getLocalizedMessage()); - } - - // Rename the project - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - IResource newResource = workspaceRoot.findMember(projectRename); - if (newResource != null) { - try { - newResource.delete(IResource.KEEP_HISTORY, new NullProgressMonitor()); - } catch (CoreException e) { - fail("Failed to delete old project " + projectRename + ": " + e.getLocalizedMessage()); - } - } - IProjectDescription description = null; - try { - description = project.getDescription(); - } catch (CoreException e) { - fail("Failed to find project descriptor for " + projectName + ": " + e.getLocalizedMessage()); - } - description.setName(projectRename); - try { - project.move(description, IResource.FORCE | IResource.SHALLOW, new NullProgressMonitor()); - } catch (CoreException e) { - fail("Failed to rename project: " + e.getLocalizedMessage()); - } - try { - project = createProject(projectRename); - description = project.getDescription(); - // Make sure it has a managed nature - if (description != null) { - assertTrue(description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)); - } - } catch (CoreException e) { - fail("Failed to open renamed project: " + e.getLocalizedMessage()); - } - - // By now the project should have 3 configs - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - IManagedProject managedProj = info.getManagedProject(); - IConfiguration[] definedConfigs = managedProj.getConfigurations(); - assertEquals(4, definedConfigs.length); - IConfiguration baseConfig = definedConfigs[1]; - - // There is only one tool - ITool[] definedTools = baseConfig.getTools(); - assertEquals(1, definedTools.length); - ITool rootTool = definedTools[0]; - - // Get the options (2) in top category and (4) in its child - IOptionCategory topCategory = rootTool.getTopOptionCategory(); - assertEquals("Root Tool", topCategory.getName()); - Object[][] options = topCategory.getOptions(baseConfig); - int i; - for (i = 0; i < options.length; i++) - if (options[i][0] == null) - break; - assertEquals(2, i); - IOptionCategory[] categories = topCategory.getChildCategories(); - assertEquals(1, categories.length); - options = categories[0].getOptions(baseConfig); - for (i = 0; i < options.length; i++) - if (options[i][0] == null) - break; - assertEquals(4, i); - - // Set the name back - newResource = workspaceRoot.findMember(projectName); - if (newResource != null) { - try { - newResource.delete(IResource.KEEP_HISTORY, new NullProgressMonitor()); - } catch (CoreException e) { - fail("Failed to delete old project " + projectName + ": " + e.getLocalizedMessage()); - } - } - try { - description = project.getDescription(); - } catch (CoreException e) { - fail("Failed to find project descriptor for " + projectRename + ": " + e.getLocalizedMessage()); - } - description.setName(projectName); - try { - project.move(description, IResource.FORCE | IResource.SHALLOW, new NullProgressMonitor()); - } catch (CoreException e) { - fail("Failed to re-rename project: " + e.getLocalizedMessage()); - } - try { - project = createProject(projectName); - description = project.getDescription(); - // Make sure it has a managed nature - if (description != null) { - assertTrue(description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)); - } - } catch (CoreException e) { - fail("Failed to open re-renamed project: " + e.getLocalizedMessage()); - } - - // Do it all again - info = ManagedBuildManager.getBuildInfo(project); - managedProj = info.getManagedProject(); - definedConfigs = managedProj.getConfigurations(); - assertEquals(4, definedConfigs.length); - baseConfig = definedConfigs[1]; - definedTools = baseConfig.getTools(); - assertEquals(1, definedTools.length); - rootTool = definedTools[0]; - topCategory = rootTool.getTopOptionCategory(); - assertEquals("Root Tool", topCategory.getName()); - options = topCategory.getOptions(baseConfig); - for (i = 0; i < options.length; i++) - if (options[i][0] == null) - break; - assertEquals(2, i); - categories = topCategory.getChildCategories(); - assertEquals(1, categories.length); - options = categories[0].getOptions(baseConfig); - for (i = 0; i < options.length; i++) - if (options[i][0] == null) - break; - assertEquals(4, i); - } - - /** - * Tests the tool settings through the interface the makefile generator - * uses. - * - * @param project - */ - private void checkBuildTestSettings(IManagedBuildInfo info) { - String ext1 = "foo"; - String ext2 = "bar"; - String badExt = "cpp"; - String expectedOutput = "toor"; - String expectedCmd = "doIt"; - - assertNotNull(info); - assertEquals(info.getBuildArtifactName(), projectName); - - // There should be a default configuration defined for the project - IManagedProject managedProj = info.getManagedProject(); - assertNotNull(managedProj); - IConfiguration buildConfig = info.getDefaultConfiguration(); - assertNotNull(buildConfig); - - // Check that tool handles resources with extensions foo and bar by building a baz - assertEquals(info.getOutputExtension(ext1), expectedOutput); - assertEquals(info.getOutputExtension(ext2), expectedOutput); - - // Check that it ignores others based on filename extensions - assertNull(info.getOutputExtension(badExt)); - - // Now see what the tool command line invocation is for foo and bar - assertEquals(info.getToolForSource(ext1), expectedCmd); - assertEquals(info.getToolForSource(ext2), expectedCmd); - // Make sure that there is no tool to build files of type foo and bar - assertNull(info.getToolForConfiguration(ext1)); - assertNull(info.getToolForConfiguration(ext2)); - - // There is no tool that builds toor - assertNull(info.getToolForSource(expectedOutput)); - // but there is one that produces it - assertEquals(info.getToolForConfiguration(expectedOutput), expectedCmd); - - // Now check the build flags - assertEquals(info.getFlagsForSource(ext1), "-La -Lb z -e1 -nob"); - assertEquals(info.getFlagsForSource(ext1), info.getFlagsForSource(ext2)); - - } - - /** - * Tests that overridden options are properly read into build model. - * Test that option values that are not overridden remain the same. - * - * @param project The project to get build model information for. - * @throws BuildException - */ - private void checkOptionReferences(IProject project) throws BuildException { - // Get the configs - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - IManagedProject managedProj = info.getManagedProject(); - IConfiguration[] definedConfigs = managedProj.getConfigurations(); - assertEquals(4, definedConfigs.length); - IConfiguration newConfig = managedProj.getConfiguration(testConfigId); - assertNotNull(newConfig); - - // Now get the tool options and make sure the values are correct - ITool[] definedTools = newConfig.getTools(); - assertEquals(1, definedTools.length); - ITool rootTool = definedTools[0]; - - // Check that the options in the new config contain overridden values - IOption[] rootOptions = rootTool.getOptions(); - assertEquals(6, rootOptions.length); - // First is the new list - assertEquals("List Option in Top", rootOptions[0].getName()); - assertEquals(IOption.STRING_LIST, rootOptions[0].getValueType()); - String[] list = rootOptions[0].getStringListValue(); - assertEquals(3, list.length); - assertTrue(Arrays.equals(listVal, list)); - assertEquals(rootOptions[0].getCommand(), "-L"); - // Next option is a boolean in top - assertEquals("Boolean Option in Top", rootOptions[1].getName()); - assertEquals(IOption.BOOLEAN, rootOptions[1].getValueType()); - assertEquals(boolVal, rootOptions[1].getBooleanValue()); - assertEquals("-b", rootOptions[1].getCommand()); - // Next option is a string in category - assertEquals("String Option in Category", rootOptions[2].getName()); - assertEquals(IOption.STRING, rootOptions[2].getValueType()); - assertEquals(stringVal, rootOptions[2].getStringValue()); - // Next option is a another string in category - assertEquals("Another String Option in Category", rootOptions[3].getName()); - assertEquals(IOption.STRING, rootOptions[3].getValueType()); - assertEquals(anotherStringVal, rootOptions[3].getStringValue()); - assertEquals("-str", rootOptions[3].getCommand()); - // Next option is an enumerated in category - assertEquals("Enumerated Option in Category", rootOptions[4].getName()); - assertEquals(IOption.ENUMERATED, rootOptions[4].getValueType()); - String selEnum = rootOptions[4].getSelectedEnum(); - assertEquals(enumVal, selEnum); - String[] enums = rootOptions[4].getApplicableValues(); - assertEquals(2, enums.length); - assertEquals("Default Enum", enums[0]); - assertEquals("Another Enum", enums[1]); - assertEquals("-e1", rootOptions[4].getEnumCommand(enums[0])); - assertEquals("-e2", rootOptions[4].getEnumCommand(enums[1])); - assertEquals("-e2", rootOptions[4].getEnumCommand(selEnum)); - // Final option is a boolean in Category - assertEquals("Boolean Option in Category", rootOptions[5].getName()); - assertEquals(IOption.BOOLEAN, rootOptions[5].getValueType()); - assertEquals(false, rootOptions[5].getBooleanValue()); - assertEquals("-nob", rootOptions[5].getCommandFalse()); - } - - /* - * Do a full sanity check on the root project type. - */ - private void checkRootProjectType(IProjectType type) throws BuildException { - // Project stuff - String expectedCleanCmd = "del /myworld"; - String expectedParserId = "org.eclipse.cdt.core.PE64"; - String[] expectedOSList = { "win32" }; - String[] expectedArchList = { "all" }; - assertTrue(type.isTestProjectType()); - IConfiguration[] configs = type.getConfigurations(); - if (configs[0].getArtifactName().equals("ManagedBuildTest")) { - assertEquals(configs[0].getArtifactExtension(), newExt); - } else { - assertEquals(configs[0].getArtifactExtension(), rootExt); - } - assertEquals(expectedCleanCmd, configs[0].getCleanCommand()); - assertEquals("make", configs[0].getBuildCommand()); - IToolChain toolChain = configs[0].getToolChain(); - ITargetPlatform targetPlatform = toolChain.getTargetPlatform(); - String[] binaryParsers = targetPlatform.getBinaryParserList(); - assertEquals(binaryParsers.length, 1); - assertEquals(binaryParsers[0], expectedParserId); - assertTrue(Arrays.equals(expectedOSList, toolChain.getOSList())); - assertTrue(Arrays.equals(expectedArchList, toolChain.getArchList())); - // This configuration defines no errors parsers. - assertNull(configs[0].getErrorParserIds()); - assertTrue(Arrays.equals(configs[0].getErrorParserList(), CCorePlugin.getDefault().getAllErrorParsersIDs())); - - // Tools - ITool[] tools = toolChain.getTools(); - // Root Tool - ITool rootTool = tools[0]; - assertEquals("Root Tool", rootTool.getName()); - // 6 Options are defined in the root tool - IOption[] options = rootTool.getOptions(); - assertEquals(6, options.length); - // First option is a 3-element list with 1 built-in - assertEquals("List Option in Top", options[0].getName()); - assertEquals(IOption.STRING_LIST, options[0].getValueType()); - String[] valueList = options[0].getStringListValue(); - assertEquals(2, valueList.length); - assertEquals("a", valueList[0]); - assertEquals("b", valueList[1]); - String[] builtInList = options[0].getBuiltIns(); - assertEquals(1, builtInList.length); - assertEquals("c", builtInList[0]); - assertEquals(options[0].getCommand(), "-L"); - // Next option is a boolean in top - assertEquals("Boolean Option in Top", options[1].getName()); - assertEquals(IOption.BOOLEAN, options[1].getValueType()); - assertEquals(false, options[1].getBooleanValue()); - assertEquals("-b", options[1].getCommand()); - // Next option is a string category - assertEquals("String Option in Category", options[2].getName()); - assertEquals(IOption.STRING, options[2].getValueType()); - assertEquals("x", options[2].getStringValue()); - // Next option is another string category - assertEquals("Another String Option in Category", options[3].getName()); - assertEquals(IOption.STRING, options[3].getValueType()); - assertEquals("", options[3].getStringValue()); - assertEquals("-str", options[3].getCommand()); - // Next option is an enumerated - assertEquals("Enumerated Option in Category", options[4].getName()); - assertEquals(IOption.ENUMERATED, options[4].getValueType()); - // Post-2.0 enums store the ID, not the string value - assertEquals("default.enum.option", options[4].getSelectedEnum()); - assertEquals("-e1", options[4].getEnumCommand("default.enum.option")); - // Need this methof to populate the UI selection widget - valueList = options[4].getApplicableValues(); - assertEquals(2, valueList.length); - assertEquals("Default Enum", valueList[0]); - assertEquals("Another Enum", valueList[1]); - // Test compatability with 1.2 scheme of getting the command from the name - assertEquals("-e1", options[4].getEnumCommand(valueList[0])); - assertEquals("-e2", options[4].getEnumCommand(valueList[1])); - // Final option is another boolean - assertEquals("Boolean Option in Category", options[5].getName()); - assertEquals(IOption.BOOLEAN, options[5].getValueType()); - assertEquals(false, options[5].getBooleanValue()); - assertEquals("", options[5].getCommand()); - assertEquals("-nob", options[5].getCommandFalse()); - - // Option Categories - IOptionCategory topCategory = rootTool.getTopOptionCategory(); - assertEquals("Root Tool", topCategory.getName()); - Object[][] catoptions = topCategory.getOptions(configs[0]); - int i; - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(2, i); - assertEquals("List Option in Top", ((IOption) catoptions[0][1]).getName()); - assertEquals("Boolean Option in Top", ((IOption) catoptions[1][1]).getName()); - IOptionCategory[] categories = topCategory.getChildCategories(); - assertEquals(1, categories.length); - assertEquals("Category", categories[0].getName()); - catoptions = categories[0].getOptions(configs[0]); - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(4, i); - assertEquals("String Option in Category", ((IOption) catoptions[0][1]).getName()); - assertEquals("Another String Option in Category", ((IOption) catoptions[1][1]).getName()); - assertEquals("Enumerated Option in Category", ((IOption) catoptions[2][1]).getName()); - assertEquals("Boolean Option in Category", ((IOption) catoptions[3][1]).getName()); - - // There should be 3 defined configs - configs = type.getConfigurations(); - assertEquals(3, configs.length); - - // Root Config - IConfiguration rootConfig = configs[0]; - assertEquals("Root Config", rootConfig.getName()); - - // Tool elements - tools = rootConfig.getTools(); - assertEquals(1, tools.length); - assertEquals("Root Tool", tools[0].getName()); - assertEquals("-r", tools[0].getOutputFlag()); - assertTrue(tools[0].buildsFileType("foo")); - assertTrue(tools[0].buildsFileType("bar")); - assertTrue(tools[0].producesFileType("toor")); - assertEquals("doIt", tools[0].getToolCommand()); - assertEquals("", tools[0].getOutputPrefix()); - // The root tool defines one valid header file extension - assertTrue(rootTool.isHeaderFile("baz")); - assertTrue(tools[0].isHeaderFile("baz")); - assertEquals(ITool.FILTER_C, rootTool.getNatureFilter()); - - // Partially Overriden Configuration - assertEquals("Root Override Config", configs[1].getName()); - tools = configs[1].getTools(); - assertEquals(1, tools.length); - assertEquals("Root Tool", tools[0].getName()); - topCategory = tools[0].getTopOptionCategory(); - catoptions = topCategory.getOptions(configs[1]); - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(2, i); - assertEquals("List Option in Top", ((IOption) catoptions[0][1]).getName()); - valueList = ((IOption) catoptions[0][1]).getStringListValue(); - assertEquals("a", valueList[0]); - assertEquals("b", valueList[1]); - assertEquals("Boolean Option in Top", ((IOption) catoptions[1][1]).getName()); - assertEquals(true, ((IOption) catoptions[1][1]).getBooleanValue()); - assertEquals("-b", ((IOption) catoptions[1][1]).getCommand()); - categories = topCategory.getChildCategories(); - catoptions = categories[0].getOptions(configs[1]); - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(4, i); - assertEquals("String Option in Category", ((IOption) catoptions[0][1]).getName()); - assertEquals("y", ((IOption) catoptions[0][1]).getStringValue()); - assertEquals("Another String Option in Category", ((IOption) catoptions[1][1]).getName()); - assertEquals("", ((IOption) catoptions[1][1]).getStringValue()); - assertEquals("Enumerated Option in Category", ((IOption) catoptions[2][1]).getName()); - valueList = ((IOption) catoptions[2][1]).getApplicableValues(); - assertEquals(2, valueList.length); - assertEquals("Default Enum", valueList[0]); - assertEquals("Another Enum", valueList[1]); - assertEquals("-e1", ((IOption) catoptions[2][1]).getEnumCommand(valueList[0])); - assertEquals("-e2", ((IOption) catoptions[2][1]).getEnumCommand(valueList[1])); - assertEquals(1, tools.length); - assertEquals("Boolean Option in Category", ((IOption) catoptions[3][1]).getName()); - assertEquals(false, ((IOption) catoptions[3][1]).getBooleanValue()); - assertEquals("", ((IOption) catoptions[3][1]).getCommand()); - assertEquals("-nob", ((IOption) catoptions[3][1]).getCommandFalse()); - assertEquals(1, tools.length); - ITool tool = tools[0]; - assertNotNull(tool); - assertEquals("Root Tool", tool.getName()); - assertEquals("-r", tool.getOutputFlag()); - assertTrue(tool.buildsFileType("foo")); - assertTrue(tool.buildsFileType("bar")); - assertTrue(tool.producesFileType("toor")); - assertTrue(tool.isHeaderFile("baz")); - assertEquals("doIt", tool.getToolCommand()); - assertEquals("-La -Lb -b y -e1 -nob", tool.getToolFlags()); - - // Completely Overridden configuration - assertEquals("Complete Override Config", configs[2].getName()); - tools = configs[2].getTools(); - assertEquals(1, tools.length); - assertEquals("Root Tool", tools[0].getName()); - topCategory = tools[0].getTopOptionCategory(); - catoptions = topCategory.getOptions(configs[2]); - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(2, i); - // Check that there's an string list with totally new values - assertEquals("List Option in Top", ((IOption) catoptions[0][1]).getName()); - assertEquals(IOption.STRING_LIST, ((IOption) catoptions[0][1]).getValueType()); - valueList = ((IOption) catoptions[0][1]).getStringListValue(); - assertTrue(valueList.length == 3); - assertEquals("d", valueList[0]); - assertEquals("e", valueList[1]); - assertEquals("f", valueList[2]); - assertEquals("-L", ((IOption) catoptions[0][1]).getCommand()); - // and a true boolean (commands should not have changed) - assertEquals("Boolean Option in Top", ((IOption) catoptions[1][1]).getName()); - assertEquals(IOption.BOOLEAN, ((IOption) catoptions[1][1]).getValueType()); - assertEquals(true, ((IOption) catoptions[1][1]).getBooleanValue()); - assertEquals("-b", ((IOption) catoptions[1][1]).getCommand()); - // Check that there's an overridden enumeration and string - categories = topCategory.getChildCategories(); - catoptions = categories[0].getOptions(configs[2]); - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(4, i); - assertEquals("String Option in Category", ((IOption) catoptions[0][1]).getName()); - assertEquals(IOption.STRING, ((IOption) catoptions[0][1]).getValueType()); - assertEquals("overridden", ((IOption) catoptions[0][1]).getStringValue()); - assertEquals("Another String Option in Category", ((IOption) catoptions[1][1]).getName()); - assertEquals(IOption.STRING, ((IOption) catoptions[1][1]).getValueType()); - assertEquals("alsooverridden", ((IOption) catoptions[1][1]).getStringValue()); - assertEquals("Enumerated Option in Category", ((IOption) catoptions[2][1]).getName()); - assertEquals(IOption.ENUMERATED, ((IOption) catoptions[2][1]).getValueType()); - assertEquals("another.enum.option", ((IOption) catoptions[2][1]).getSelectedEnum()); - assertEquals("Boolean Option in Category", ((IOption) catoptions[3][1]).getName()); - assertEquals(IOption.BOOLEAN, ((IOption) catoptions[3][1]).getValueType()); - assertEquals(true, ((IOption) catoptions[3][1]).getBooleanValue()); - tool = tools[0]; - assertEquals("-Ld -Le -Lf -b overridden -stralsooverridden -e2", tool.getToolFlags()); - - // Make sure that the build manager returns the default makefile generator (not null) - assertNotNull(ManagedBuildManager.getBuildfileGenerator(configs[0])); - } - - /* - * Do a full sanity check on the root managed project. - */ - private void checkRootManagedProject(IManagedProject managedProj, String testValue) throws BuildException { - String expectedCleanCmd = "del /myworld"; - String expectedParserId = "org.eclipse.cdt.core.PE64"; - String[] expectedOSList = { "win32" }; - String[] expectedArchList = { "all" }; - assertTrue(managedProj.getProjectType().isTestProjectType()); - IConfiguration[] configs = managedProj.getConfigurations(); - if (configs[0].getArtifactName().equals("ManagedBuildTest")) { - assertEquals(configs[0].getArtifactExtension(), newExt); - } else { - assertEquals(configs[0].getArtifactExtension(), rootExt); - } - assertEquals(expectedCleanCmd, configs[0].getCleanCommand()); - assertEquals("make", configs[0].getBuildCommand()); - IToolChain toolChain = configs[0].getToolChain(); - ITargetPlatform targetPlatform = toolChain.getTargetPlatform(); - String[] binaryParsers = targetPlatform.getBinaryParserList(); - assertEquals(binaryParsers.length, 1); - assertEquals(binaryParsers[0], expectedParserId); - assertTrue(Arrays.equals(expectedOSList, toolChain.getOSList())); - assertTrue(Arrays.equals(expectedArchList, toolChain.getArchList())); - // This configuration defines no errors parsers. - assertNull(configs[0].getErrorParserIds()); - assertTrue(Arrays.equals(configs[0].getErrorParserList(), CCorePlugin.getDefault().getAllErrorParsersIDs())); - - // Tools - ITool[] tools = configs[0].getTools(); - // Root Tool - ITool rootTool = tools[0]; - assertEquals("Root Tool", rootTool.getName()); - // 6 Options are defined in the root tool - IOption[] options = rootTool.getOptions(); - assertEquals(6, options.length); - // First option is a 3-element list with 1 built-in - assertEquals("List Option in Top", options[0].getName()); - assertEquals(IOption.STRING_LIST, options[0].getValueType()); - String[] valueList = options[0].getStringListValue(); - assertEquals(2, valueList.length); - assertEquals("a", valueList[0]); - assertEquals("b", valueList[1]); - String[] builtInList = options[0].getBuiltIns(); - assertEquals(1, builtInList.length); - assertEquals("c", builtInList[0]); - assertEquals(options[0].getCommand(), "-L"); - // Next option is a boolean in top - assertEquals("Boolean Option in Top", options[1].getName()); - assertEquals(IOption.BOOLEAN, options[1].getValueType()); - assertEquals(false, options[1].getBooleanValue()); - assertEquals("-b", options[1].getCommand()); - // Next option is a string category - assertEquals("String Option in Category", options[2].getName()); - assertEquals(IOption.STRING, options[2].getValueType()); - assertEquals(testValue, options[2].getStringValue()); - // Next option is another string category - assertEquals("Another String Option in Category", options[3].getName()); - assertEquals(IOption.STRING, options[3].getValueType()); - assertEquals("", options[3].getStringValue()); - assertEquals("-str", options[3].getCommand()); - // Next option is an enumerated - assertEquals("Enumerated Option in Category", options[4].getName()); - assertEquals(IOption.ENUMERATED, options[4].getValueType()); - // Post-2.0 enums store the ID, not the string value - assertEquals("default.enum.option", options[4].getSelectedEnum()); - assertEquals("-e1", options[4].getEnumCommand("default.enum.option")); - // Need this methof to populate the UI selection widget - valueList = options[4].getApplicableValues(); - assertEquals(2, valueList.length); - assertEquals("Default Enum", valueList[0]); - assertEquals("Another Enum", valueList[1]); - // Test compatability with 1.2 scheme of getting the command from the name - assertEquals("-e1", options[4].getEnumCommand(valueList[0])); - assertEquals("-e2", options[4].getEnumCommand(valueList[1])); - // Final option is another boolean - assertEquals("Boolean Option in Category", options[5].getName()); - assertEquals(IOption.BOOLEAN, options[5].getValueType()); - assertEquals(false, options[5].getBooleanValue()); - assertEquals("", options[5].getCommand()); - assertEquals("-nob", options[5].getCommandFalse()); - - // Option Categories - IOptionCategory topCategory = rootTool.getTopOptionCategory(); - assertEquals("Root Tool", topCategory.getName()); - Object[][] catoptions = topCategory.getOptions(configs[0]); - int i; - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(2, i); - IOption catOption = (IOption) catoptions[0][1]; - assertEquals("List Option in Top", catOption.getName()); - catOption = (IOption) catoptions[1][1]; - assertEquals("Boolean Option in Top", catOption.getName()); - IOptionCategory[] categories = topCategory.getChildCategories(); - assertEquals(1, categories.length); - assertEquals("Category", categories[0].getName()); - catoptions = categories[0].getOptions(configs[0]); - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(4, i); - catOption = (IOption) catoptions[0][1]; - assertEquals("String Option in Category", catOption.getName()); - catOption = (IOption) catoptions[1][1]; - assertEquals("Another String Option in Category", catOption.getName()); - catOption = (IOption) catoptions[2][1]; - assertEquals("Enumerated Option in Category", catOption.getName()); - catOption = (IOption) catoptions[3][1]; - assertEquals("Boolean Option in Category", catOption.getName()); - - // There should be 3 defined configs - assertEquals(3, configs.length); - - // Root Config - IConfiguration rootConfig = configs[0]; - assertEquals("Root Config", rootConfig.getName()); - - // Tool elements - tools = rootConfig.getTools(); - assertEquals(1, tools.length); - assertEquals("Root Tool", tools[0].getName()); - assertEquals("-r", tools[0].getOutputFlag()); - assertTrue(tools[0].buildsFileType("foo")); - assertTrue(tools[0].buildsFileType("bar")); - assertTrue(tools[0].producesFileType("toor")); - assertEquals("doIt", tools[0].getToolCommand()); - assertEquals("", tools[0].getOutputPrefix()); - // The root tool defines one valid header file extension - assertTrue(rootTool.isHeaderFile("baz")); - assertTrue(tools[0].isHeaderFile("baz")); - assertEquals(ITool.FILTER_C, rootTool.getNatureFilter()); - - // Partially Overriden Configuration - assertEquals("Root Override Config", configs[1].getName()); - tools = configs[1].getTools(); - assertEquals(1, tools.length); - assertEquals("Root Tool", tools[0].getName()); - topCategory = tools[0].getTopOptionCategory(); - catoptions = topCategory.getOptions(configs[1]); - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(2, i); - catOption = (IOption) catoptions[0][1]; - assertEquals("List Option in Top", catOption.getName()); - valueList = catOption.getStringListValue(); - assertEquals("a", valueList[0]); - assertEquals("b", valueList[1]); - catOption = (IOption) catoptions[1][1]; - assertEquals("Boolean Option in Top", catOption.getName()); - assertEquals(true, catOption.getBooleanValue()); - assertEquals("-b", catOption.getCommand()); - categories = topCategory.getChildCategories(); - catoptions = categories[0].getOptions(configs[1]); - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(4, i); - catOption = (IOption) catoptions[0][1]; - assertEquals("String Option in Category", catOption.getName()); - assertEquals("y", catOption.getStringValue()); - catOption = (IOption) catoptions[1][1]; - assertEquals("Another String Option in Category", catOption.getName()); - assertEquals("", catOption.getStringValue()); - catOption = (IOption) catoptions[2][1]; - assertEquals("Enumerated Option in Category", catOption.getName()); - valueList = catOption.getApplicableValues(); - assertEquals(2, valueList.length); - assertEquals("Default Enum", valueList[0]); - assertEquals("Another Enum", valueList[1]); - catOption = (IOption) catoptions[2][1]; - assertEquals("-e1", catOption.getEnumCommand(valueList[0])); - assertEquals("-e2", catOption.getEnumCommand(valueList[1])); - assertEquals(1, tools.length); - catOption = (IOption) catoptions[3][1]; - assertEquals("Boolean Option in Category", catOption.getName()); - assertEquals(false, catOption.getBooleanValue()); - assertEquals("", catOption.getCommand()); - assertEquals("-nob", catOption.getCommandFalse()); - assertEquals(1, tools.length); - ITool tool = tools[0]; - assertNotNull(tool); - assertEquals("Root Tool", tool.getName()); - assertEquals("-r", tool.getOutputFlag()); - assertTrue(tool.buildsFileType("foo")); - assertTrue(tool.buildsFileType("bar")); - assertTrue(tool.producesFileType("toor")); - assertTrue(tool.isHeaderFile("baz")); - assertEquals("doIt", tool.getToolCommand()); - assertEquals("-La -Lb -b y -e1 -nob", tool.getToolFlags()); - - // Completely Overridden configuration - assertEquals("Complete Override Config", configs[2].getName()); - tools = configs[2].getTools(); - assertEquals(1, tools.length); - assertEquals("Root Tool", tools[0].getName()); - topCategory = tools[0].getTopOptionCategory(); - catoptions = topCategory.getOptions(configs[2]); - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(2, i); - // Check that there's an string list with totally new values - catOption = (IOption) catoptions[0][1]; - assertEquals("List Option in Top", catOption.getName()); - assertEquals(IOption.STRING_LIST, catOption.getValueType()); - valueList = catOption.getStringListValue(); - assertTrue(valueList.length == 3); - assertEquals("d", valueList[0]); - assertEquals("e", valueList[1]); - assertEquals("f", valueList[2]); - assertEquals("-L", catOption.getCommand()); - // and a true boolean (commands should not have changed) - catOption = (IOption) catoptions[1][1]; - assertEquals("Boolean Option in Top", catOption.getName()); - assertEquals(IOption.BOOLEAN, catOption.getValueType()); - assertEquals(true, catOption.getBooleanValue()); - assertEquals("-b", catOption.getCommand()); - // Check that there's an overridden enumeration and string - categories = topCategory.getChildCategories(); - catoptions = categories[0].getOptions(configs[2]); - for (i = 0; i < catoptions.length; i++) - if (catoptions[i][0] == null) - break; - assertEquals(4, i); - catOption = (IOption) catoptions[0][1]; - assertEquals("String Option in Category", catOption.getName()); - assertEquals(IOption.STRING, catOption.getValueType()); - assertEquals("overridden", catOption.getStringValue()); - catOption = (IOption) catoptions[1][1]; - assertEquals("Another String Option in Category", catOption.getName()); - assertEquals(IOption.STRING, catOption.getValueType()); - assertEquals("alsooverridden", catOption.getStringValue()); - catOption = (IOption) catoptions[2][1]; - assertEquals("Enumerated Option in Category", catOption.getName()); - assertEquals(IOption.ENUMERATED, catOption.getValueType()); - assertEquals("another.enum.option", catOption.getSelectedEnum()); - catOption = (IOption) catoptions[3][1]; - assertEquals("Boolean Option in Category", catOption.getName()); - assertEquals(IOption.BOOLEAN, catOption.getValueType()); - assertEquals(true, catOption.getBooleanValue()); - tool = tools[0]; - assertEquals("-Ld -Le -Lf -b overridden -stralsooverridden -e2", tool.getToolFlags()); - - // Make sure that the build manager returns the default makefile generator (not null) - assertNotNull(ManagedBuildManager.getBuildfileGenerator(configs[0])); - } - - /* - * The Sub Sub project type has a reference to a tool that is defined - * independently from the project type itself. This is a common pattern - * for tools that are shared between many project types. - * - * The tool itself is defined as having two option categories, with - * one option in each category. To test that the reference is properly - * inheritted, the project type overrides the default value of the boolean - * option. - * - * The test confirms that the basic settings are inheritted through the - * reference, and that the overridden value is used instead of the - * default. It also tests that the command can be overidden through a - * tool reference. - * - * Finally, the string option in the configuration is overridden and the - * test confirms that it contains both the overridden boolean that the - * project type provides, and the overridden string that it provides. - * - * @param testSubSub - */ - private void checkSubSubProjectType(IProjectType projType) { - final String indyToolName = "Target Independent Tool"; - final String indyToolCommand = "RC.EXE"; - final String indyToolInputExt = "rc"; - final String indyToolOutputExt = "free"; - final String indyToolOutFlag = "/fo"; - final String indyToolHeader = "h"; - final String indyToolHeaderNot = "j"; - final String indyCatOne = "Free"; - final String indyCatTwo = "Chained"; - final String freeOptName = "String in Free"; - final String chainedOptName = "Boolean in Chained"; - final String freeOptValue = "Live free or die"; - final String newCmd = "Let the Wookie win"; - final String stringOverride = "The future language of slaves"; - - IConfiguration[] configs = projType.getConfigurations(); - // Check the inherited clean command - assertEquals("rm -yourworld", configs[0].getCleanCommand()); - // Check that the make command is overridden from parent - assertEquals("nmake", configs[0].getBuildCommand()); - // Make sure we get the proper binary parser - IToolChain toolChain = configs[0].getToolChain(); - ITargetPlatform targetPlatform = toolChain.getTargetPlatform(); - assertEquals("org.eclipse.cdt.core.ELF", targetPlatform.getBinaryParserList()[0]); - // Make sure the os list is inherited - String[] expectedOSList = { "win32", "linux", "solaris" }; - assertTrue(Arrays.equals(expectedOSList, toolChain.getOSList())); - // Make sure the arch list is inherited - String[] expectedArchList = { "x86", "ppc" }; - assertTrue(Arrays.equals(expectedArchList, toolChain.getArchList())); - - // Get the 5 configurations (3 from test, 1 from test sub and 1 from this) - assertEquals(5, configs.length); - - // Check the tools. We should have 3 (1 from each parent and the one referenced). - ITool[] tools = configs[0].getTools(); - assertEquals(3, tools.length); - ITool toolRef = tools[0]; - - // Make sure we get all the tool settings - assertEquals(toolRef.getName(), indyToolName); - assertEquals(toolRef.getToolCommand(), indyToolCommand); - assertTrue(toolRef.buildsFileType(indyToolInputExt)); - assertEquals(toolRef.getOutputExtension(indyToolInputExt), indyToolOutputExt); - assertEquals(toolRef.getOutputFlag(), indyToolOutFlag); - assertTrue(toolRef.isHeaderFile(indyToolHeader)); - assertFalse(toolRef.isHeaderFile(indyToolHeaderNot)); - assertEquals(toolRef.getNatureFilter(), ITool.FILTER_BOTH); - // Check out the referenced tool and make sure we get all option categories - IOptionCategory topCategory = toolRef.getTopOptionCategory(); - IOptionCategory[] categories = topCategory.getChildCategories(); - assertEquals(1, categories.length); - assertEquals(categories[0].getName(), indyCatOne); - IOptionCategory[] subCategories = categories[0].getChildCategories(); - // Is the chained category a subcategory - assertEquals(1, subCategories.length); - assertEquals(subCategories[0].getName(), indyCatTwo); - // Make sure the option in the top category is correct - Object[][] optsInCat = categories[0].getOptions(configs[0]); - int i; - for (i = 0; i < optsInCat.length; i++) - if (optsInCat[i][0] == null) - break; - assertEquals(1, i); - IOption optCat = (IOption) optsInCat[0][1]; - assertEquals(freeOptName, optCat.getName()); - try { - // We get the option categories and options from the tool itself, but the - // tool reference will have a set of 0 to n option references that contain - // overridden settings. In this case, the string is inheritted and should - // not be reference - assertEquals(IOption.STRING, optCat.getValueType()); - IOption stringOpt = toolRef.getOptionById(optCat.getId()); - assertTrue(stringOpt instanceof Option); - assertEquals(freeOptValue, stringOpt.getStringValue()); - } catch (BuildException e1) { - fail("Failed getting string value in subsub :" + e1.getLocalizedMessage()); - } - - // Do the same for the options in the child cat - Object[][] optsInSubCat = subCategories[0].getOptions(configs[0]); - for (i = 0; i < optsInSubCat.length; i++) - if (optsInSubCat[i][0] == null) - break; - assertEquals(1, i); - IOption booleanRef = toolRef.getOptionById(((IOption) optsInSubCat[0][1]).getId()); - assertEquals(chainedOptName, booleanRef.getName()); - try { - assertEquals(IOption.BOOLEAN, booleanRef.getValueType()); - assertTrue(booleanRef.getBooleanValue()); - } catch (BuildException e) { - fail("Failure getting boolean value in subsub: " + e.getLocalizedMessage()); - } - - // Test that the tool command can be changed through the reference - toolRef.setToolCommand(newCmd); - assertEquals(toolRef.getToolCommand(), newCmd); - - // Muck about with the options in the local config - IConfiguration subSubConfig = projType.getConfiguration("sub.sub.config"); - assertNotNull(subSubConfig); - ITool[] configTools = subSubConfig.getTools(); - // This tool ref is inherited from parent, so it does not belong to the config - ITool configToolRef = configTools[0]; - assertNotNull(configToolRef); - optCat = (IOption) optsInCat[0][1]; - IOption configStringOpt = configToolRef.getOptionById(optCat.getId()); - assertNotNull(configStringOpt); - // Override the string option - try { - subSubConfig.setOption(configToolRef, configStringOpt, stringOverride); - } catch (BuildException e) { - fail("Failure setting string value in subsubconfiguration: " + e.getLocalizedMessage()); - } - // Now the config should have a tool ref to the independent tool - configTools = subSubConfig.getTools(); - configToolRef = configTools[0]; - assertNotNull(configToolRef); - - // Test that the string option is overridden in the configuration - optsInCat = categories[0].getOptions(configs[0]); - for (i = 0; i < optsInCat.length; i++) - if (optsInCat[i][0] == null) - break; - assertEquals(1, i); - optCat = (IOption) optsInCat[0][1]; - assertEquals(freeOptName, optCat.getName()); - configStringOpt = configToolRef.getOptionById(optCat.getId()); - try { - assertEquals(stringOverride, configStringOpt.getStringValue()); - } catch (BuildException e) { - fail("Failure getting string value in subsubconfiguration: " + e.getLocalizedMessage()); - } - // The tool should also contain the boolean option set to true - IOption optSubCat = (IOption) optsInSubCat[0][1]; - IOption configBoolOpt = configToolRef.getOptionById(optSubCat.getId()); - assertNotNull(configBoolOpt); - try { - assertTrue(configBoolOpt.getBooleanValue()); - } catch (BuildException e) { - fail("Failure getting boolean value in subsubconfiguration: " + e.getLocalizedMessage()); - } - - // Override it in config and retest - try { - subSubConfig.setOption(configToolRef, configBoolOpt, false); - } catch (BuildException e) { - fail("Failure setting boolean value in subsubconfiguration: " + e.getLocalizedMessage()); - } - optsInSubCat = subCategories[0].getOptions(configs[0]); - for (i = 0; i < optsInSubCat.length; i++) - if (optsInSubCat[i][0] == null) - break; - assertEquals(1, i); - configBoolOpt = configToolRef.getOptionById(((IOption) optsInSubCat[0][1]).getId()); - assertEquals(chainedOptName, booleanRef.getName()); - try { - assertFalse(configBoolOpt.getBooleanValue()); - } catch (BuildException e) { - fail("Failure getting boolean value in subsubconfiguration: " + e.getLocalizedMessage()); - } - } - - /* - * Do a sanity check on the values in the sub-project type. Most of the - * sanity on the how build model entries are read is performed in - * the root project type check, so these tests just verify that the the sub - * project type properly inherits from its parent. For the new options - * in the sub project type, the test does a sanity check just to be complete. - */ - private void checkSubProjectType(IProjectType projType) throws BuildException { - final String expectedFlags = "-I/usr/include -I/opt/gnome/include -IC:\\home\\tester/include -I\"../includes\" x y z"; - - IConfiguration[] configs = projType.getConfigurations(); - // Check the overridden clean command - assertEquals("rm -yourworld", configs[0].getCleanCommand()); - // Make sure the projType inherits the make command - assertEquals("make", configs[0].getBuildCommand()); - // Make sure the binary parser is hard-coded and available - IToolChain toolChain = configs[0].getToolChain(); - ITargetPlatform targetPlatform = toolChain.getTargetPlatform(); - assertEquals("org.eclipse.cdt.core.PE64", targetPlatform.getBinaryParserList()[0]); - String[] expectedOSList = { "win32", "linux", "solaris" }; - assertTrue(Arrays.equals(expectedOSList, toolChain.getOSList())); - // Make sure the list is overridden - String[] expectedArchList = { "x86", "ppc" }; - assertTrue(Arrays.equals(expectedArchList, toolChain.getArchList())); - - // Make sure this is a test projType - assertTrue(projType.isTestProjectType()); - // Make sure the build artifact extension is there - assertEquals(configs[0].getArtifactExtension(), subExt); - - // Get the tools for this projType - ITool[] tools = configs[0].getTools(); - // Do we inherit properly from parent - ITool rootTool = tools[0]; - assertEquals("Root Tool", rootTool.getName()); - // Now get the tool defined for this projType - ITool subTool = tools[1]; - assertEquals("Sub Tool", subTool.getName()); - // Confirm that it has four options - IOption[] subOpts = subTool.getOptions(); - assertEquals(5, subOpts.length); - assertEquals("", subTool.getOutputFlag()); - assertTrue(subTool.buildsFileType("yarf")); - assertTrue(subTool.producesFileType("bus")); - assertEquals("", subTool.getToolCommand()); - assertEquals("lib", subTool.getOutputPrefix()); - assertTrue(subTool.isHeaderFile("arf")); - assertTrue(subTool.isHeaderFile("barf")); - assertEquals(ITool.FILTER_BOTH, subTool.getNatureFilter()); - - // Do a sanity check on the options - assertEquals("Include Paths", subOpts[0].getName()); - assertEquals(IOption.INCLUDE_PATH, subOpts[0].getValueType()); - String[] incPath = subOpts[0].getIncludePaths(); - assertEquals(2, incPath.length); - assertEquals("/usr/include", incPath[0]); - assertEquals("/opt/gnome/include", incPath[1]); - String[] builtInPaths = subOpts[0].getBuiltIns(); - assertEquals(1, builtInPaths.length); - assertEquals("/usr/gnu/include", builtInPaths[0]); - assertEquals("-I", subOpts[0].getCommand()); - assertEquals(IOption.BROWSE_DIR, subOpts[0].getBrowseType()); - - // There are no user-defined preprocessor symbols - assertEquals("Defined Symbols", subOpts[1].getName()); - assertEquals(IOption.PREPROCESSOR_SYMBOLS, subOpts[1].getValueType()); - String[] defdSymbols = subOpts[1].getDefinedSymbols(); - assertEquals(0, defdSymbols.length); - assertEquals("-D", subOpts[1].getCommand()); - // But there is a builtin - String[] builtInSymbols = subOpts[1].getBuiltIns(); - assertEquals(1, builtInSymbols.length); - assertEquals("BUILTIN", builtInSymbols[0]); - // Broswe type should be none - assertEquals(IOption.BROWSE_NONE, subOpts[1].getBrowseType()); - - assertEquals("More Includes", subOpts[2].getName()); - assertEquals(IOption.INCLUDE_PATH, subOpts[2].getValueType()); - String[] moreIncPath = subOpts[2].getIncludePaths(); - assertEquals(2, moreIncPath.length); - assertEquals("C:\\home\\tester/include", moreIncPath[0]); - assertEquals("-I", subOpts[2].getCommand()); - assertEquals(IOption.BROWSE_DIR, subOpts[2].getBrowseType()); - - // Check the user object option - assertEquals("User Objects", subOpts[3].getName()); - assertEquals(IOption.OBJECTS, subOpts[3].getValueType()); - String[] objs = subOpts[3].getUserObjects(); - assertEquals(2, objs.length); - assertEquals("obj1.o", objs[0]); - assertEquals("obj2.o", objs[1]); - assertEquals(IOption.BROWSE_FILE, subOpts[3].getBrowseType()); - assertEquals("", subOpts[3].getCommand()); - - // There should be a string list with no command - assertEquals("No Command StringList", subOpts[4].getName()); - assertEquals(IOption.STRING_LIST, subOpts[4].getValueType()); - - // Make sure the tool flags look right - assertEquals(subTool.getToolFlags(), expectedFlags); - - // Get the configs for this projType; it should inherit all the configs defined for the parent - assertEquals(4, configs.length); - assertEquals("Sub Config", configs[0].getName()); - assertEquals("Root Config", configs[1].getName()); - assertEquals("Root Override Config", configs[2].getName()); - assertEquals("Complete Override Config", configs[3].getName()); - } - - private void checkForwardProjectTypes(IProjectType parent, IProjectType child, IProjectType grandchild) { - // check that the projType parent reference has been resolved. - assertEquals(parent, child.getSuperClass()); - assertEquals(child, grandchild.getSuperClass()); - - // get the parent tool - IConfiguration[] parentConfigs = parent.getConfigurations(); - ITool[] parentTools = parentConfigs[0].getTools(); - assertEquals(1, parentTools.length); - ITool parentTool = parentTools[0]; - assertNotNull(parentTool); - - // check option categories - IOption option = parentTool.getOptionById("test.forward.option"); - assertNotNull(option); - IOptionCategory[] firstLevel = parentTool.getTopOptionCategory().getChildCategories(); - assertEquals(1, firstLevel.length); - IOptionCategory[] secondLevel = firstLevel[0].getChildCategories(); - assertEquals(1, secondLevel.length); - assertEquals(0, secondLevel[0].getChildCategories().length); - Object[][] optList = secondLevel[0].getOptions(parentConfigs[0]); - int i; - for (i = 0; i < optList.length; i++) - if (optList[i][0] == null) - break; - assertEquals(1, i); - assertEquals(option, optList[0][1]); - - // get the tool reference from the child - IConfiguration[] childConfigs = child.getConfigurations(); - ITool[] childTools = childConfigs[0].getTools(); - assertEquals(1, childTools.length); - ITool childToolRef = childTools[0]; - assertEquals(parentTool.getSuperClass(), childToolRef.getSuperClass()); - - // get and check the option reference - IOption optRef = childToolRef.getOptionById("test.forward.option"); - assertEquals(option, optRef); - - // get the tool reference from the grandchild - IConfiguration[] grandConfigs = grandchild.getConfigurations(); - ITool[] grandTools = grandConfigs[0].getTools(); - assertEquals(1, grandTools.length); - ITool grandToolRef = grandTools[0]; - assertEquals(parentTool.getSuperClass(), grandToolRef.getSuperClass()); - - } - - public void checkProviderProjectType(IProjectType projType) throws Exception { - Properties props = new Properties(); - props.load(getClass().getResourceAsStream("test_commands")); - - // check that this projType is in the file - String command = props.getProperty(projType.getId()); - assertNotNull(command); - - IProjectType parent = projType.getSuperClass(); - assertNotNull(parent); - assertEquals("test.forward.parent.target", parent.getId()); - - IConfiguration[] configs = projType.getConfigurations(); - ITool toolRef = configs[0].getFilteredTools()[0]; - assertEquals(command, toolRef.getToolCommand()); - } - - /** - * Remove all the project information associated with the project used during test. - */ - public void cleanup() throws CoreException, IOException { - ResourceHelper.cleanUp(getName()); - removeProject(projectName); - removeProject(projectName2); - } - - /* (non-Javadoc) - * Create a new project named name or return the project in - * the workspace of the same name if it exists. - * - * @param name The name of the project to create or retrieve. - * @return - * @throws CoreException - */ - private IProject createProject(String name) throws CoreException { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - final IProject newProjectHandle = root.getProject(name); - IProject project = null; - - if (!newProjectHandle.exists()) { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IWorkspaceDescription workspaceDesc = workspace.getDescription(); - workspaceDesc.setAutoBuilding(false); - workspace.setDescription(workspaceDesc); - IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName()); - //description.setLocation(root.getLocation()); - project = CCorePlugin.getDefault().createCProject(description, newProjectHandle, new NullProgressMonitor(), - /*MakeCorePlugin.MAKE_PROJECT_ID*/ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID); - - // Now associate the builder with the project - ManagedBuildTestHelper.addManagedBuildNature(project); - } else { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - @Override - public void run(IProgressMonitor monitor) throws CoreException { - newProjectHandle.refreshLocal(IResource.DEPTH_INFINITE, monitor); - } - }; - NullProgressMonitor monitor = new NullProgressMonitor(); - workspace.run(runnable, root, IWorkspace.AVOID_UPDATE, monitor); - project = newProjectHandle; - } - - // Open the project if we have to - if (!project.isOpen()) { - project.open(new NullProgressMonitor()); - } - - return project; - } - - /** - * Remove the IProject with the name specified in the argument from the - * receiver's workspace. - * - * @param name - */ - private void removeProject(String name) { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IProject project = root.getProject(name); - if (project.exists()) { - try { - Thread.sleep(1000); - } catch (InterruptedException e1) { - } finally { - try { - System.gc(); - System.runFinalization(); - project.delete(true, true, null); - } catch (CoreException e2) { - assertTrue(false); - } - } - } - } - - /** - * @throws BuildException - */ - public void testErrorParsers() throws BuildException { - // Create new project - IProject project = null; - try { - project = createProject(projectName2); - // Now associate the builder with the project - ManagedBuildTestHelper.addManagedBuildNature(project); - IProjectDescription description = project.getDescription(); - // Make sure it has a managed nature - if (description != null) { - assertTrue(description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)); - } - } catch (CoreException e) { - fail("Test failed on error parser project creation: " + e.getLocalizedMessage()); - } - - // Find the base project Type definition - IProjectType projType = ManagedBuildManager.getProjectType("test.error.parsers"); - assertNotNull(projType); - - // Create the target for our project that builds a dummy executable - IManagedProject newProj = ManagedBuildManager.createManagedProject(project, projType); - assertEquals(newProj.getName(), projType.getName()); - ManagedBuildManager.setNewProjectVersion(project); - - ManagedBuildManager.getBuildInfo(project).setValid(true); - // Initialize the path entry container - IStatus initResult = ManagedBuildManager.initBuildInfoContainer(project); - if (initResult.getCode() != IStatus.OK) { - fail("Initializing build information failed for: " + project.getName() + " because: " - + initResult.getMessage()); - } - - // Copy over the configs - IConfiguration[] baseConfigs = projType.getConfigurations(); - for (int i = 0; i < baseConfigs.length; ++i) { - newProj.createConfiguration(baseConfigs[i], baseConfigs[i].getId() + "." + i); - } - - // Test this out - checkErrorParsersProject(newProj); - - // Save, close, reopen and test again - ManagedBuildManager.saveBuildInfo(project, true); - ManagedBuildManager.removeBuildInfo(project); - try { - ResourceHelper.joinIndexerBeforeCleanup(getName()); - project.close(null); - } catch (CoreException e) { - fail("Failed on error parser project close: " + e.getLocalizedMessage()); - } - try { - project.open(null); - } catch (CoreException e) { - fail("Failed on error parser project open: " + e.getLocalizedMessage()); - } - - // Test that the default config was remembered - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - - // Check the rest of the default information - checkErrorParsersProject(info.getManagedProject()); - ManagedBuildManager.removeBuildInfo(project); - } - - /* - * Do a sanity check on the error parsers target. - */ - private void checkErrorParsersProject(IManagedProject proj) throws BuildException { - // Target stuff - String expectedBinParserId = "org.eclipse.cdt.core.PE64"; - IConfiguration[] configs = proj.getConfigurations(); - IToolChain toolChain = configs[0].getToolChain(); - ITargetPlatform targetPlatform = toolChain.getTargetPlatform(); - assertEquals(expectedBinParserId, targetPlatform.getBinaryParserList()[0]); - // This target defines errors parsers. Check that the error parsers - // have been assigned. - assertEquals( - "org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GmakeErrorParser", - configs[0].getErrorParserIds()); - - // Tool - ITool[] tools = configs[0].getTools(); - ITool rootTool = tools[0]; - assertEquals(1, tools.length); - assertEquals("EP Tool", tools[0].getName()); - assertEquals("-o", tools[0].getOutputFlag()); - assertTrue(tools[0].buildsFileType("y")); - assertTrue(tools[0].buildsFileType("x")); - assertTrue(tools[0].producesFileType("xy")); - assertEquals("EP", tools[0].getToolCommand()); - assertEquals(ITool.FILTER_C, rootTool.getNatureFilter()); - - // There should be one defined configs - assertEquals(1, configs.length); - } - - /** - * Test that the build artifact of a ITarget can be modified - * programmatically. - */ - public void testConfigBuildArtifact() throws CoreException { - // Open the test project - IProject project = createProject(projectName); - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - assertNotNull(info); - IManagedProject managedProj = info.getManagedProject(); - assertNotNull(managedProj); - IConfiguration defaultConfig = info.getDefaultConfiguration(); - assertNotNull(defaultConfig); - - // Set the build artifact of the configuration - String ext = defaultConfig.getArtifactExtension(); - String name = project.getName() + "." + ext; - defaultConfig.setArtifactName(name); - - // Save, close, reopen and test again - ManagedBuildManager.saveBuildInfo(project, false); - ManagedBuildManager.removeBuildInfo(project); - ResourceHelper.joinIndexerBeforeCleanup(getName()); - project.close(null); - project.open(null); - - // Check the artifact name - info = ManagedBuildManager.getBuildInfo(project); - assertNotNull(info); - managedProj = info.getManagedProject(); - assertNotNull(managedProj); - defaultConfig = info.getDefaultConfiguration(); - assertNotNull(defaultConfig); - assertEquals(name, defaultConfig.getArtifactName()); - } - - public void testThatAlwaysFails() { - assertTrue(false); - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java deleted file mode 100644 index 178634e3f03..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java +++ /dev/null @@ -1,332 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2011 Intel Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Intel Corporation - Initial API and implementation - *******************************************************************************/ - -/********************************************************************** - * These tests are for a 2.1 style tool integration. That is, the - * tool integration does not use any 3.0 elements or attributes, - * including InputType, OutputType, etc. - **********************************************************************/ - -package org.eclipse.cdt.managedbuilder.core.tests; - -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.nio.file.Files; -import java.util.ArrayList; - -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.projectconverter.UpdateManagedProjectManager; -import org.eclipse.cdt.managedbuilder.testplugin.CTestPlugin; -import org.eclipse.cdt.managedbuilder.testplugin.ManagedBuildTestHelper; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IPathVariableManager; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.ui.dialogs.IOverwriteQuery; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -public class ManagedProject21MakefileTests extends TestCase { - private IPath resourcesLocation = new Path( - CTestPlugin.getFileInPlugin(new Path("resources/test21Projects/")).getAbsolutePath()); - public static final String MBS_TEMP_DIR = "MBSTemp"; - - boolean pathVariableCreated = false; - - public ManagedProject21MakefileTests(String name) { - super(name); - } - - public static Test suite() { - TestSuite suite = new TestSuite(ManagedProject21MakefileTests.class.getName()); - - suite.addTest(new ManagedProject21MakefileTests("testSingleFileExe")); - suite.addTest(new ManagedProject21MakefileTests("testTwoFileSO")); - suite.addTest(new ManagedProject21MakefileTests("testMultiResConfig")); - suite.addTest(new ManagedProject21MakefileTests("testLinkedLib")); - // TODO: testLinkedFolder fails intermittently saying that it cannot find - // the makefiles to compare. This appears to be a test set issue, - // rather than an MBS functionality issue - suite.addTest(new ManagedProject21MakefileTests("testLinkedFolder")); - - return suite; - } - - @Override - protected void tearDown() throws Exception { - removePathVariables(); - super.tearDown(); - } - - private IProject[] createProject(String projName, IPath location, String projectTypeId, boolean containsZip) { - Path path = new Path("resources/test21Projects/" + projName); - File testDir = CTestPlugin.getFileInPlugin(path); - if (testDir == null) { - fail("Test project directory " + path + " is missing."); - return null; - } - - ArrayList projectList = null; - if (containsZip) { - File projectZips[] = testDir.listFiles(new FileFilter() { - @Override - public boolean accept(File pathname) { - if (pathname.isDirectory()) - return false; - return true; - } - }); - - projectList = new ArrayList<>(projectZips.length); - for (int i = 0; i < projectZips.length; i++) { - try { - String projectName = projectZips[i].getName(); - if (!projectName.endsWith(".zip")) - continue; - - projectName = projectName.substring(0, projectName.length() - ".zip".length()); - if (projectName.length() == 0) - continue; - IProject project = ManagedBuildTestHelper.createProject(projectName, projectZips[i], location, - projectTypeId); - if (project != null) - projectList.add(project); - } catch (Exception e) { - } - } - if (projectList.size() == 0) { - fail("No projects found in test project directory " + testDir.getName() - + ". The .zip file may be missing or corrupt."); - return null; - } - } else { - try { - IProject project = ManagedBuildTestHelper.createProject(projName, null, location, projectTypeId); - if (project != null) - projectList = new ArrayList<>(1); - projectList.add(project); - } catch (Exception e) { - } - } - - return projectList.toArray(new IProject[projectList.size()]); - } - - private IProject[] createProjects(String projName, IPath location, String projectTypeId, boolean containsZip) { - - // In case the projects need to be updated... - IOverwriteQuery queryALL = new IOverwriteQuery() { - @Override - public String queryOverwrite(String file) { - return ALL; - } - }; - - UpdateManagedProjectManager.setBackupFileOverwriteQuery(queryALL); - UpdateManagedProjectManager.setUpdateProjectQuery(queryALL); - - IProject projects[] = createProject(projName, location, projectTypeId, containsZip); - return projects; - } - - private boolean buildProjects(String benchmarkDir, IProject projects[], IPath[] files) { - if (projects == null || projects.length == 0) - return false; - - boolean succeeded = true; - try { - for (int i = 0; i < projects.length; i++) { - IProject curProject = projects[i]; - - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(curProject); - - //check whether the managed build info is converted - boolean isCompatible = UpdateManagedProjectManager.isCompatibleProject(info); - assertTrue(isCompatible); - - if (isCompatible) { - // Build the project in order to generate the maekfiles - try { - curProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null); - } catch (CoreException e) { - fail(e.getStatus().getMessage()); - } catch (OperationCanceledException e) { - fail("the project \"" + curProject.getName() + "\" build was cancelled, exception message: " - + e.getMessage()); - } - - //compare the generated makefiles to their benchmarks - if (files != null && files.length > 0) { - if (i == 0) { - String configName = info.getDefaultConfiguration().getName(); - IPath buildDir = Path.fromOSString(configName); - // succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildDir, files); - IPath benchmarkLocationBase = resourcesLocation.append(benchmarkDir); - IPath buildLocation = curProject.getLocation().append(buildDir); - succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildLocation, files, - benchmarkLocationBase); - } - } - } - } - } finally { - for (int i = 0; i < projects.length; i++) - ManagedBuildTestHelper.removeProject(projects[i].getName()); - } - return succeeded; - } - - private void createPathVariable(IPath tmpDir) { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - workspace = ResourcesPlugin.getWorkspace(); - IPathVariableManager pathMan = workspace.getPathVariableManager(); - String name = MBS_TEMP_DIR; - try { - if (pathMan.validateName(name).isOK() && pathMan.validateValue(tmpDir).isOK()) { - pathMan.setValue(name, tmpDir); - assertTrue(pathMan.isDefined(name)); - } else { - fail("could not create the path variable " + name); - } - } catch (Exception e) { - fail("could not create the path variable " + name); - } - } - - private void removePathVariables() throws CoreException { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - workspace = ResourcesPlugin.getWorkspace(); - IPathVariableManager pathMan = workspace.getPathVariableManager(); - pathMan.setValue(MBS_TEMP_DIR, null); - } - - private void createFileLink(IProject project, IPath tmpDir, String linkName, String fileName) { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - String name = MBS_TEMP_DIR; - if (!pathVariableCreated) { - createPathVariable(tmpDir); - pathVariableCreated = true; - } - - try { - // Now we can create a linked resource relative to the defined path variable: - IFile linkF1 = project.getFile(linkName); - IPath location = new Path("MBSTemp/" + fileName); - if (workspace.validateLinkLocation(linkF1, location).isOK()) { - linkF1.createLink(location, IResource.NONE, null); - } else { - fail("could not create the link to " + name); - } - } catch (Exception e) { - fail("could not create the link to " + name + ": " + e); - } - } - - /* (non-Javadoc) - * tests 2.1 style tool integration for a single file executable - */ - public void testSingleFileExe() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk") }; - IProject[] projects = createProjects("singleFileExe", null, null, true); - buildProjects("singleFileExe", projects, makefiles); - } - - /* (non-Javadoc) - * tests 2.1 style tool integration for a two file SO - */ - public void testTwoFileSO() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk") }; - IProject[] projects = createProjects("twoFileSO", null, null, true); - buildProjects("twoFileSO", projects, makefiles); - } - - /* (non-Javadoc) - * tests 2.1 style tool integration for multiple source files & a resource configuration - */ - public void testMultiResConfig() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk"), Path.fromOSString("source1/subdir.mk"), - Path.fromOSString("source2/subdir.mk"), Path.fromOSString("source2/source21/subdir.mk") }; - IProject[] projects = createProjects("multiResConfig", null, null, true); - buildProjects("multiResConfig", projects, makefiles); - } - - /* (non-Javadoc) - * tests 2.1 style tool integration for linked files - */ - public void testLinkedLib() throws IOException { - boolean succeeded = false; - IPath[] makefiles = { Path.fromOSString("makefile"), - //Path.fromOSString("subdir.mk") // Can't compare this yet since it contains absolute paths! - Path.fromOSString("sources.mk") }; - IPath[] linkedFiles = { Path.fromOSString("f1.c"), Path.fromOSString("f2.c"), Path.fromOSString("test_ar.h") }; - File srcDirFile = CTestPlugin.getFileInPlugin(new Path("resources/test21Projects/linkedLib/")); - IPath srcDir = Path.fromOSString(srcDirFile.toString()); - IPath tmpRootDir = Path.fromOSString(Files.createTempDirectory("testLinkedLib").toAbsolutePath().toString()); - IPath tmpSubDir = Path.fromOSString("CDTMBSTest"); - IPath tmpDir = ManagedBuildTestHelper.copyFilesToTempDir(srcDir, tmpRootDir, tmpSubDir, linkedFiles); - try { - IProject[] projects = createProjects("linkedLib", null, "cdt.managedbuild.target.testgnu21.lib", true); - // There should be only one project. Add our linked files to it. - IProject project = projects[0]; - createFileLink(project, tmpDir, "f1.c", "f1.c"); - createFileLink(project, tmpDir, "f2link.c", "f2.c"); - createFileLink(project, tmpDir, "test_ar.h", "test_ar.h"); - // Build the project - succeeded = buildProjects("linkedLib", projects, makefiles); - } finally { - if (succeeded) - ManagedBuildTestHelper.deleteTempDir(tmpRootDir, tmpSubDir, linkedFiles); - } - } - - /* (non-Javadoc) - * tests 2.1 style tool integration for a linked folder - */ - public void testLinkedFolder() throws IOException { - boolean succeeded = false; - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("subdir.mk"), - Path.fromOSString("sources.mk") }; - IPath[] linkedFiles = { Path.fromOSString("f1.c"), Path.fromOSString("f2.c"), Path.fromOSString("test_ar.h"), - Path.fromOSString("Benchmarks/makefile"), Path.fromOSString("Benchmarks/subdir.mk"), - Path.fromOSString("Benchmarks/sources.mk") }; - File srcDirFile = CTestPlugin.getFileInPlugin(new Path("resources/test21Projects/linkedFolder/")); - IPath srcDir = Path.fromOSString(srcDirFile.toString()); - IPath tmpSubDir = Path.fromOSString("CDTMBSTest"); - IPath tmpRootDir = Path.fromOSString(Files.createTempDirectory("testLinkedFolder").toAbsolutePath().toString()); - IPath tmpDir = ManagedBuildTestHelper.copyFilesToTempDir(srcDir, tmpRootDir, tmpSubDir, linkedFiles); - if (!pathVariableCreated) { - createPathVariable(tmpDir); - pathVariableCreated = true; - } - IPath location = Path.fromOSString(MBS_TEMP_DIR); - IProject[] projects = createProjects("linkedFolder", location, "cdt.managedbuild.target.testgnu21.lib", false); - // Build the project - succeeded = buildProjects("linkedFolder", projects, makefiles); - assertTrue(succeeded); - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java deleted file mode 100644 index ef5e66cacf8..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java +++ /dev/null @@ -1,269 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2016 Intel Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Intel Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.managedbuilder.core.tests; - -import java.io.File; -import java.io.FileFilter; -import java.util.ArrayList; - -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.projectconverter.UpdateManagedProjectManager; -import org.eclipse.cdt.managedbuilder.testplugin.CTestPlugin; -import org.eclipse.cdt.managedbuilder.testplugin.ManagedBuildTestHelper; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.ui.dialogs.IOverwriteQuery; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -public class ManagedProjectUpdateTests extends TestCase { - private IPath resourcesLocation = new Path( - CTestPlugin.getFileInPlugin(new Path("resources/oldTypeProjects/")).getAbsolutePath()); - - public ManagedProjectUpdateTests(String name) { - super(name); - } - - public static Test suite() { - TestSuite suite = new TestSuite(ManagedProjectUpdateTests.class.getName()); - - suite.addTest(new ManagedProjectUpdateTests("testProjectUpdate12_Update")); - suite.addTest(new ManagedProjectUpdateTests("testProjectUpdate20_Update")); - suite.addTest(new ManagedProjectUpdateTests("testProjectUpdate21_Update")); - // suite.addTest(new ManagedProjectUpdateTests("testProjectUpdate12_NoUpdate")); - // suite.addTest(new ManagedProjectUpdateTests("testProjectUpdate20_NoUpdate")); - // suite.addTest(new ManagedProjectUpdateTests("testProjectUpdate21_NoUpdate")); - // TODO: This is affected by the TODO in UpdateManagedProjectManager - suite.addTest(new ManagedProjectUpdateTests("testProjectUpdate21CPP_Update")); - - return suite; - } - - private File getVersionProjectsDir(String version) { - return CTestPlugin.getFileInPlugin(new Path("resources/oldTypeProjects/" + version)); - } - - private IProject[] createVersionProjects(String version) { - File file = getVersionProjectsDir(version); - if (file == null) { - fail("Test project directory is missing."); - return null; - } - - File projectZips[] = file.listFiles(new FileFilter() { - @Override - public boolean accept(File pathname) { - if (pathname.isDirectory()) - return false; - return true; - } - }); - - ArrayList projectList = new ArrayList<>(projectZips.length); - for (int i = 0; i < projectZips.length; i++) { - try { - String projectName = projectZips[i].getName(); - if (!projectName.endsWith(".zip")) - continue; - - projectName = projectName.substring(0, projectName.length() - ".zip".length()); - if (projectName.length() == 0) - continue; - IProject project = ManagedBuildTestHelper.createProject(projectName, projectZips[i], null, null); - if (project != null) - projectList.add(project); - } catch (Exception e) { - } - } - if (projectList.size() == 0) { - fail("No projects found in test project directory " + file.getName() - + ". The .zip file may be missing or corrupt."); - return null; - } - return projectList.toArray(new IProject[projectList.size()]); - } - - private void doTestProjectUpdate(String version, boolean updateProject, boolean overwriteBackupFiles, - IPath[] files) { - IOverwriteQuery queryALL = new IOverwriteQuery() { - @Override - public String queryOverwrite(String file) { - return ALL; - } - }; - IOverwriteQuery queryNOALL = new IOverwriteQuery() { - @Override - public String queryOverwrite(String file) { - return NO_ALL; - } - }; - - UpdateManagedProjectManager.setBackupFileOverwriteQuery(overwriteBackupFiles ? queryALL : queryNOALL); - UpdateManagedProjectManager.setUpdateProjectQuery(updateProject ? queryALL : queryNOALL); - - IProject projects[] = createVersionProjects(version); - if (projects == null || projects.length == 0) - return; - for (int i = 0; i < projects.length; i++) { - final IProject curProject = projects[i]; - - //the project conversion occures the first time - //ManagedBuildManager.getBuildInfo gets called - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(curProject); - - //check whether the managed build info is converted - boolean isCompatible = UpdateManagedProjectManager.isCompatibleProject(info); - assertTrue(isCompatible); - - if (isCompatible) { - //check for correct update - if (!updateProject) { - //TODO: if the user has chosen not to update the project the .cdtbuild file should not change - } else { - // Make sure that we have a valid project - if (info == null || info.getManagedProject() == null - || info.getManagedProject().isValid() == false) { - fail("the project \"" + curProject.getName() + "\" was not properly converted"); - } - } - - //check whether the project builds without errors - IWorkspace wsp = ResourcesPlugin.getWorkspace(); - ISchedulingRule rule = wsp.getRuleFactory().buildRule(); - Job buildJob = new Job("project build job") { //$NON-NLS-1$ - @Override - protected IStatus run(IProgressMonitor monitor) { - try { - curProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null); - } catch (CoreException e) { - fail(e.getStatus().getMessage()); - } catch (OperationCanceledException e) { - fail("the project \"" + curProject.getName() + "\" build was cancelled, exception message: " - + e.getMessage()); - } - return new Status(IStatus.OK, "org.eclipse.cdt.managedbuilder.core.tests", IStatus.OK, "", //$NON-NLS-2$ - null); - } - }; - buildJob.setRule(rule); - - buildJob.schedule(); - - try { - buildJob.join(); - } catch (InterruptedException e) { - fail("the build job for the project \"" + curProject.getName() - + "\" was interrupted, exception message: " + e.getMessage()); - } - - IStatus status = buildJob.getResult(); - if (status.getCode() != IStatus.OK) { - fail("the build job for the project \"" + curProject.getName() + "\" failed, status message: " - + status.getMessage()); - } - - //compare the generated makefiles to their benchmarks - if (files != null && files.length > 0) { - if (i == 0) { - String configName = info.getDefaultConfiguration().getName(); - IPath benchmarkLocationBase = resourcesLocation.append(version); - IPath buildLocation = curProject.getLocation().append(configName); - ManagedBuildTestHelper.compareBenchmarks(curProject, buildLocation, files, - benchmarkLocationBase); - } - } - } - } - - for (int i = 0; i < projects.length; i++) - ManagedBuildTestHelper.removeProject(projects[i].getName()); - } - - /* (non-Javadoc) - * tests project v1.2 update - * in case when user chooses to update the project - */ - public void testProjectUpdate12_Update() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk") }; - doTestProjectUpdate("1.2", true, true, makefiles); - } - - /* (non-Javadoc) - * tests project v2.0 update - * in case when user chooses to update the project - */ - public void testProjectUpdate20_Update() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk") }; - doTestProjectUpdate("2.0", true, true, makefiles); - } - - /* (non-Javadoc) - * tests project v2.1 update - * in case when user chooses to update the project - */ - public void testProjectUpdate21_Update() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk"), Path.fromOSString("Functions/subdir.mk") }; - doTestProjectUpdate("2.1", true, true, makefiles); - } - - /* (non-Javadoc) - * tests project v2.1 update of a C++ project with C source files - */ - public void testProjectUpdate21CPP_Update() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk"), Path.fromOSString("Functions/subdir.mk") }; - doTestProjectUpdate("2.1CPP", true, true, makefiles); - } - - /* (non-Javadoc) - * tests project v1.2 update - * in case when user chooses not to update the project - */ - public void testProjectUpdate12_NoUpdate() { - doTestProjectUpdate("1.2", false, true, null); - } - - /* (non-Javadoc) - * tests project v2.0 update - * in case when user chooses not to update the project - */ - public void testProjectUpdate20_NoUpdate() { - doTestProjectUpdate("2.0", false, true, null); - } - - /* (non-Javadoc) - * tests project v2.1 update - * in case when user chooses not to update the project - */ - public void testProjectUpdate21_NoUpdate() { - doTestProjectUpdate("2.1", false, true, null); - } -}