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 index 1da3f7f9c7d..62345aa2949 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/test12.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/test12.zip differ 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 index c372d2a0b1e..a29b009efcc 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/test20.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/test20.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/test21.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/test21.zip index 0b1270a81c8..e667da1c81c 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/test21.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/test21.zip differ 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 index 85fa12caede..51ca87b51b5 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Test21CXX.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Test21CXX.zip differ 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 index 8c423b59eb6..35f4182a8e6 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/linkedLib.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/linkedLib.zip differ 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 index 0fd7d9c5caa..e552559d784 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/testResCfg.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/testResCfg.zip differ 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 index bd4783a07d8..fe886a9eb07 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/testSingleExe.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/testSingleExe.zip differ 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 index fb99e7fd7a6..2b01fc40ee6 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/testDoubleSO.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/testDoubleSO.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest1/CDTFortranTest1.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest1/CDTFortranTest1.zip index b92612420d9..1d4db049aa6 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest1/CDTFortranTest1.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest1/CDTFortranTest1.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest2/CDTFortranTest2.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest2/CDTFortranTest2.zip index c42f9ae35f9..52e98613819 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest2/CDTFortranTest2.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest2/CDTFortranTest2.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/TestATO/TestATO.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/TestATO/TestATO.zip index a0c5a351486..7e24fe90283 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/TestATO/TestATO.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/TestATO/TestATO.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/copyandDeploy/copyandDeploy.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/copyandDeploy/copyandDeploy.zip index 326e5abe6b2..83d811e5067 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/copyandDeploy/copyandDeploy.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/copyandDeploy/copyandDeploy.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/deleteFile/deleteFile.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/deleteFile/deleteFile.zip index 91883e7a119..ba82e9f6ba0 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/deleteFile/deleteFile.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/deleteFile/deleteFile.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/makefile index 3f2c7ba6d61..08a017cfdb0 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/makefile @@ -1,43 +1,43 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -ROOT := .. - --include $(ROOT)/makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include $(SUBDIRS:%=%/subdir.mk) --include objects.mk -ifneq ($(strip $(DEPS)),) --include $(DEPS) -endif - --include $(ROOT)/makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: lib.a - -# Tool invocations -lib.a: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: MBS30.archiver.gnu' - @echo ar -r lib.a $(OBJS) $(USER_OBJS) $(LIBS) - @ar -r lib.a $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(OBJS)$(ARCHIVES)$(DEPS) lib.a - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include $(ROOT)/makefile.targets +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +ROOT := .. + +-include $(ROOT)/makefile.init + +RM := rm -rf + +# All of the sources participating in the build are defined here +-include sources.mk +-include $(SUBDIRS:%=%/subdir.mk) +-include objects.mk +ifneq ($(strip $(DEPS)),) +-include $(DEPS) +endif + +-include $(ROOT)/makefile.defs + +# Add inputs and outputs from these tool invocations to the build variables + +# All Target +all: lib.a + +# Tool invocations +lib.a: $(OBJS) $(USER_OBJS) + @echo 'Building target: $@' + @echo 'Invoking: MBS30.archiver.gnu' + @echo ar -r lib.a $(OBJS) $(USER_OBJS) $(LIBS) + @ar -r lib.a $(OBJS) $(USER_OBJS) $(LIBS) + @echo 'Finished building target: $@' + @echo ' ' + +# Other Targets +clean: + -$(RM) $(OBJS)$(ARCHIVES)$(DEPS) lib.a + -@echo ' ' + +.PHONY: all clean dependents +.SECONDARY: + +-include $(ROOT)/makefile.targets diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/objects.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/objects.mk index eae6a31b65d..80f51041115 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/objects.mk +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/objects.mk @@ -1,7 +1,7 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -LIBS := - +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +LIBS := + USER_OBJS := \ No newline at end of file diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/sources.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/sources.mk index 0a4b7d18d1d..02f9758b2ee 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/sources.mk +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/sources.mk @@ -1,14 +1,14 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -C_SRCS := -O_SRCS := -OBJS := -ARCHIVES := -DEPS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ - +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +C_SRCS := +O_SRCS := +OBJS := +ARCHIVES := +DEPS := + +# Every subdirectory with source files must be described here +SUBDIRS := \ +. \ + diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/subdir.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/subdir.mk index ed487cec9c7..d0bc9450379 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/subdir.mk +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/subdir.mk @@ -1,34 +1,34 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -$(ROOT)/f1.c \ -$(ROOT)/f2.c - -OBJS += \ -${addprefix ./, \ -f1.o \ -f2.o \ -} - -DEPS += \ -${addprefix ./, \ -f1.d \ -f2.d \ -} - - -# Each subdirectory must supply rules for building sources it contributes -%.o: $(ROOT)/%.c - @echo 'Building file: $<' - @echo 'Invoking: MBS30.compiler.gnu.c' - @echo gcc -O0 -g3 -Wall -c -fmessage-length=0 -o$@ $< - @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 ' ' - - +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +# Add inputs and outputs from these tool invocations to the build variables +C_SRCS += \ +$(ROOT)/f1.c \ +$(ROOT)/f2.c + +OBJS += \ +${addprefix ./, \ +f1.o \ +f2.o \ +} + +DEPS += \ +${addprefix ./, \ +f1.d \ +f2.d \ +} + + +# Each subdirectory must supply rules for building sources it contributes +%.o: $(ROOT)/%.c + @echo 'Building file: $<' + @echo 'Invoking: MBS30.compiler.gnu.c' + @echo gcc -O0 -g3 -Wall -c -fmessage-length=0 -o$@ $< + @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 ' ' + + diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/f1.c b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/f1.c index 5e77893b8a6..eba1ec730fa 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/f1.c +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/f1.c @@ -1,8 +1,8 @@ -#include -#include "test_ar.h" - -void f1_ar() -{ - printf ( "Hello from f1_ar.\n" ) ; - return ; -} +#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/test30Projects/linkedFolder/f2.c b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/f2.c index 56e2c730d4d..f37980720b4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/f2.c +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/f2.c @@ -1,8 +1,8 @@ -#include -#include "test_ar.h" - -void f2_ar() -{ - printf ( "Hello from f2_ar.\n" ) ; - return ; -} +#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/test30Projects/linkedFolder/test_ar.h b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/test_ar.h index 55e38f0d5ac..b41ce20c434 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/test_ar.h +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/test_ar.h @@ -1,2 +1,2 @@ -void f1_ar() ; -void f2_ar() ; +void f1_ar() ; +void f2_ar() ; diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/f1.c b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/f1.c index 5e77893b8a6..eba1ec730fa 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/f1.c +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/f1.c @@ -1,8 +1,8 @@ -#include -#include "test_ar.h" - -void f1_ar() -{ - printf ( "Hello from f1_ar.\n" ) ; - return ; -} +#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/test30Projects/linkedLib/f2.c b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/f2.c index 56e2c730d4d..f37980720b4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/f2.c +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/f2.c @@ -1,8 +1,8 @@ -#include -#include "test_ar.h" - -void f2_ar() -{ - printf ( "Hello from f2_ar.\n" ) ; - return ; -} +#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/test30Projects/linkedLib/linkedLib.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/linkedLib.zip index ce01ebc6dc1..4d3e311b6e5 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/linkedLib.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/linkedLib.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/test_ar.h b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/test_ar.h index 55e38f0d5ac..b41ce20c434 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/test_ar.h +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib/test_ar.h @@ -1,2 +1,2 @@ -void f1_ar() ; -void f2_ar() ; +void f1_ar() ; +void f2_ar() ; diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/multiResConfig/multiResConfig.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/multiResConfig/multiResConfig.zip index 3155d37b6d3..dfee95a1f28 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/multiResConfig/multiResConfig.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/multiResConfig/multiResConfig.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/preAndPostBuildSteps/preAndPostBuildSteps.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/preAndPostBuildSteps/preAndPostBuildSteps.zip index 3504025ef12..f7b18776f7a 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/preAndPostBuildSteps/preAndPostBuildSteps.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/preAndPostBuildSteps/preAndPostBuildSteps.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/rcbsBasicTest/rcbsBasicTest.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/rcbsBasicTest/rcbsBasicTest.zip index 9f9fbc8b7a9..1d19b4f2aa5 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/rcbsBasicTest/rcbsBasicTest.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/rcbsBasicTest/rcbsBasicTest.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/singleFileExe/singleFileExe.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/singleFileExe/singleFileExe.zip index 47787cb0b8b..e671d6792e9 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/singleFileExe/singleFileExe.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/singleFileExe/singleFileExe.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test with spaces/test with spaces.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test with spaces/test with spaces.zip index f78c1d632e8..26e7e67f662 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test with spaces/test with spaces.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test with spaces/test with spaces.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_1/test30_1.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_1/test30_1.zip index eb52f1cd66c..d2ab430ac8b 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_1/test30_1.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_1/test30_1.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_2/test30_2.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_2/test30_2.zip index d4f2235c225..fb92eee703a 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_2/test30_2.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_2/test30_2.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testFileWithNoExtension/testFileWithNoExtension.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testFileWithNoExtension/testFileWithNoExtension.zip index 959c126f720..4009a747542 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testFileWithNoExtension/testFileWithNoExtension.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testFileWithNoExtension/testFileWithNoExtension.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testMacroSupportInBuildDefinitions/testMacroSupportInBuildDefinitions.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testMacroSupportInBuildDefinitions/testMacroSupportInBuildDefinitions.zip index 18205095c18..1e8c53bf5f8 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testMacroSupportInBuildDefinitions/testMacroSupportInBuildDefinitions.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testMacroSupportInBuildDefinitions/testMacroSupportInBuildDefinitions.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/twoFileSO/twoFileSO.zip b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/twoFileSO/twoFileSO.zip index ac24de644a1..d698018a7ee 100644 Binary files a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/twoFileSO/twoFileSO.zip and b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/twoFileSO/twoFileSO.zip differ diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject30MakefileTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject30MakefileTests.java index 9868711fccd..84e4a7eb15a 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject30MakefileTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject30MakefileTests.java @@ -1,615 +1,621 @@ -/******************************************************************************* - * Copyright (c) 2005 Intel Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Intel Corporation - Initial API and implementation - *******************************************************************************/ - -/********************************************************************** - * These tests are for a 3.0 style tool integration. - **********************************************************************/ - -package org.eclipse.cdt.managedbuilder.core.tests; - -import java.io.File; -import java.io.FileFilter; -import java.util.ArrayList; -import java.util.Iterator; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.managedbuilder.core.IAdditionalInput; -import org.eclipse.cdt.managedbuilder.core.IInputType; -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.IManagedProject; -import org.eclipse.cdt.managedbuilder.core.IOutputType; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.cdt.managedbuilder.internal.core.Tool; -import org.eclipse.cdt.managedbuilder.internal.core.ToolChain; -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.*; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.ui.dialogs.IOverwriteQuery; - -public class ManagedProject30MakefileTests extends TestCase { - public static final String MBS_TEMP_DIR = "MBSTemp"; - - static boolean pathVariableCreated = false; - - public ManagedProject30MakefileTests(String name) { - super(name); - } - - public static Test suite() { - TestSuite suite = new TestSuite(ManagedProject30MakefileTests.class.getName()); - - suite.addTest(new ManagedProject30MakefileTests("test30SingleFileExe")); - suite.addTest(new ManagedProject30MakefileTests("test30TwoFileSO")); - suite.addTest(new ManagedProject30MakefileTests("test30MultiResConfig")); - suite.addTest(new ManagedProject30MakefileTests("test30LinkedLib")); - // 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 ManagedProject30MakefileTests("test30LinkedFolder")); - suite.addTest(new ManagedProject30MakefileTests("test30CopyandDeploy")); - suite.addTest(new ManagedProject30MakefileTests("test30DeleteFile")); - suite.addTest(new ManagedProject30MakefileTests("test30NoFilesToBuild")); - suite.addTest(new ManagedProject30MakefileTests("testFileWithNoExtension")); - suite.addTest(new ManagedProject30MakefileTests("testPreAndPostProcessBuildSteps")); - suite.addTest(new ManagedProject30MakefileTests("testResourceCustomBuildStep")); - suite.addTest(new ManagedProject30MakefileTests("test30_1")); - suite.addTest(new ManagedProject30MakefileTests("test30_2")); - suite.addTest(new ManagedProject30MakefileTests("testTopTC")); - suite.addTest(new ManagedProject30MakefileTests("CDTFortranTest1")); - suite.addTest(new ManagedProject30MakefileTests("CDTFortranTest2")); - suite.addTest(new ManagedProject30MakefileTests("TestATO")); - suite.addTest(new ManagedProject30MakefileTests("testMacroSupportInBuildDefinitions")); - suite.addTest(new ManagedProject30MakefileTests("testSpaces")); - return suite; - } - - private IProject[] createProject(String projName, IPath location, String projectTypeId, boolean containsZip){ - ArrayList projectList = null; - if (containsZip) { - File testDir = CTestPlugin.getFileInPlugin(new Path("resources/test30Projects/" + projName)); - if(testDir == null) { - fail("Test project directory " + projName + " is missing."); - return null; - } - - File projectZips[] = testDir.listFiles(new FileFilter(){ - 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 (IProject[])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(){ - public String queryOverwrite(String file) { - return ALL; - }}; - IOverwriteQuery queryNOALL = new IOverwriteQuery(){ - public String queryOverwrite(String file) { - return NO_ALL; - }}; - - UpdateManagedProjectManager.setBackupFileOverwriteQuery(queryALL); - UpdateManagedProjectManager.setUpdateProjectQuery(queryALL); - - IProject projects[] = createProject(projName, location, projectTypeId, containsZip); - return projects; - } - - private void buildProjectsWorker(IProject projects[], IPath[] files, boolean compareBenchmark) { - if(projects == null || projects.length == 0) - return; - - boolean succeeded = true; - 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 makefiles - 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); - if (compareBenchmark) - succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildDir, files); - else - succeeded = ManagedBuildTestHelper.verifyFilesDoNotExist(curProject, buildDir, files); - } - } - } - } - - if (succeeded) { // Otherwise leave the projects around for comparison - for (int i = 0; i < projects.length; i++) - ManagedBuildTestHelper.removeProject(projects[i].getName()); - } - } - - // Build projects and compare benchmarks - private void buildProjects(IProject projects[], IPath[] files) { - buildProjectsWorker(projects, files, true); - } - - // Build projects but don't compare benchmarks because there should be not build files generated - private void buildDegenerativeProjects(IProject projects[], IPath[] files) { - buildProjectsWorker(projects, files, false); - } - - 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 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);} - } - - /* (non-Javadoc) - * tests 3.0 style tool integration for a single file executable - */ - public void test30SingleFileExe(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk")}; - IProject[] projects = createProjects("singleFileExe", null, null, true); - buildProjects(projects, makefiles); - } - - /* (non-Javadoc) - * tests 3.0 style tool integration for a two file SO - */ - public void test30TwoFileSO(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk")}; - IProject[] projects = createProjects("twoFileSO", null, null, true); - buildProjects(projects, makefiles); - } - - /* (non-Javadoc) - * tests 3.0 style tool integration for multiple source files & a resource configuration - */ - public void test30MultiResConfig(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - 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(projects, makefiles); - } - - /* (non-Javadoc) - * tests 3.0 style tool integration for linked files - */ - public void test30LinkedLib(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - //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/test30Projects/linkedLib/")); - IPath srcDir = Path.fromOSString(srcDirFile.toString()); - IPath tmpSubDir = Path.fromOSString("CDTMBSTest"); - IPath tmpDir = ManagedBuildTestHelper.copyFilesToTempDir(srcDir, tmpSubDir, linkedFiles); - try { - IProject[] projects = createProjects("linkedLib", null, "cdt.managedbuild.target.gnu30.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 - buildProjects(projects, makefiles); - } finally {ManagedBuildTestHelper.deleteTempDir(tmpSubDir, linkedFiles);} - } - - /* (non-Javadoc) - * tests 3.0 style tool integration for a linked folder - */ - public void test30LinkedFolder(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - 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/objects.mk"), - Path.fromOSString("Benchmarks/subdir.mk"), - Path.fromOSString("Benchmarks/sources.mk")}; - File srcDirFile = CTestPlugin.getFileInPlugin(new Path("resources/test30Projects/linkedFolder/")); - IPath srcDir = Path.fromOSString(srcDirFile.toString()); - IPath tmpSubDir = Path.fromOSString("CDTMBSTest"); - IPath tmpDir = ManagedBuildTestHelper.copyFilesToTempDir(srcDir, tmpSubDir, linkedFiles); - if (!pathVariableCreated) { - createPathVariable(tmpDir); - pathVariableCreated = true; - } - try { - IPath location = Path.fromOSString(MBS_TEMP_DIR); - IProject[] projects = createProjects("linkedFolder", location, "cdt.managedbuild.target.gnu30.lib", false); - // Build the project - buildProjects(projects, makefiles); - } finally {ManagedBuildTestHelper.deleteTempDir(tmpSubDir, linkedFiles);} - } - - /* (non-Javadoc) - * tests 3.0 style tool integration with pre and post process steps added to typical compile & link - */ - public void test30CopyandDeploy(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk"), - Path.fromOSString("Functions/subdir.mk")}; - IProject[] projects = createProjects("copyandDeploy", null, null, true); - buildProjects(projects, makefiles); - } - - /* (non-Javadoc) - * tests 3.0 style tool integration in the context of deleting a file, to see if the proper behavior - * occurs in the managedbuild system - */ - public void test30DeleteFile(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - Path.fromOSString("subdir.mk"), - Path.fromOSString("sources.mk")}; - - IProject[] projects = createProjects("deleteFile", null, null, true); - final IWorkspace workspace = ResourcesPlugin.getWorkspace(); - ArrayList resourceList = new ArrayList(1); - IProject project = projects[0]; - IFile projfile = project.getFile("filetobedeleted.cxx"); - resourceList.add(projfile); - final IResource[] fileResource = (IResource[])resourceList.toArray(new IResource[resourceList.size()]); - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - workspace.delete(fileResource, false, null); - } - }; - try { - NullProgressMonitor monitor = new NullProgressMonitor(); - workspace.run(runnable, workspace.getRoot(), IWorkspace.AVOID_UPDATE, monitor); - } catch (Exception e) { - fail("could not delete file in project " + project.getName()); - } - buildProjects(projects, makefiles); - } - - /* (non-Javadoc) - * tests 3.0 managed build system with a project which has only a single source file that is marked as - * "excluded from build" to see that this degenerative case is handled gracefully - */ - public void test30NoFilesToBuild(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - Path.fromOSString("subdir.mk"), - Path.fromOSString("sources.mk")}; - - IProject[] projects = createProjects("noFilesToBuild", null, null, true); - IProject project = projects[0]; - IFile projfile = project.getFile("filetobeexcluded.cxx"); - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - IConfiguration config = info.getDefaultConfiguration(); - IResourceConfiguration rconfig = config.createResourceConfiguration(projfile); - rconfig.setExclude(true); - buildDegenerativeProjects(projects, makefiles); - } - - /** - * (non-Javadoc) - * tests 3.0 managed build system with a project which has a file with no file extesnion - */ - public void testFileWithNoExtension() - { - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk")}; - IProject[] projects = createProjects("testFileWithNoExtension", null, null, true); - buildProjects(projects, makefiles); - } - - - /* (non-Javadoc) - * tests 3.0 style tool integration: create pre-build and post-build steps and verify that - * the proper commands are generated in the makefile which is created by the managedbuild system - */ - public void testPreAndPostProcessBuildSteps(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - Path.fromOSString("subdir.mk"), - Path.fromOSString("sources.mk")}; - - IProject[] projects = createProjects("preAndPostBuildSteps", null, null, true); - IProject project = projects[0]; - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - IConfiguration config = info.getDefaultConfiguration(); - IFile projfile = project.getFile("main.cxx"); - config.setPreannouncebuildStep("Pre-announce Build Step"); - config.setPrebuildStep("echo 'executing Pre-Build Step' "); - config.setPostannouncebuildStep("Post-announce Build Step"); - config.setPostbuildStep("echo 'executing Post-Build Step' "); - buildProjects(projects, makefiles); - } - - - /* (non-Javadoc) - * tests 3.0 style tool integration: create resource custom build step and verify that - * the proper commands are generated in the makefile which is created by the managedbuild system - */ - public void testResourceCustomBuildStep(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - Path.fromOSString("subdir.mk"), - Path.fromOSString("sources.mk")}; - ITool rcbsTool; - IInputType rcbsToolInputType; - IAdditionalInput rcbsToolInputTypeAdditionalInput; - IOutputType rcbsToolOutputType; - - IProject[] projects = createProjects("rcbsBasicTest", null, null, true); - IProject project = projects[0]; - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - IConfiguration config = info.getDefaultConfiguration(); - IFile projfile = project.getFile("rcbsBasicTest.c"); - IResourceConfiguration rconfig = config.createResourceConfiguration(projfile); - rcbsTool = rconfig.createTool(null,"rcbsBasicTestTool","rcbs Basic Test Tool",false); - rcbsToolInputType = rcbsTool.createInputType(null,"rcbsToolInputTypeId","rcbsToolInputTypeName",false); - rcbsToolInputTypeAdditionalInput = rcbsToolInputType.createAdditionalInput(""); - rcbsToolInputTypeAdditionalInput.setKind(IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY); - rcbsToolOutputType = rcbsTool.createOutputType(null,"rcbsToolOutputTypeId","rcbsToolOutputTypeName",false); - rcbsToolOutputType.setOutputNames("rcbsBasicTest.o"); - rcbsTool.setCustomBuildStep(true); - rcbsTool.setToolCommand("gcc -g -c ../rcbsBasicTest.c -o ./rcbsBasicTest.o"); - rcbsTool.setAnnouncement("Now executing custom build step for rcbsBasicTest debug config"); - rconfig.setRcbsApplicability(IResourceConfiguration.KIND_APPLY_RCBS_TOOL_AS_OVERRIDE); - buildProjects(projects, makefiles); - } - - - /* (non-Javadoc) - * tests 3.0 style tool integration with pre and post process steps added to typical compile & link - */ - public void test30_1(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk")}; - IProject[] projects = createProjects("test30_1", null, null, true); - buildProjects(projects, makefiles); - } - - /* (non-Javadoc) - * tests 3.0 style tool integration with multiple input types use Eclipse content types - */ - public void test30_2(){ - IPath[] makefiles = { - Path.fromOSString("makefile"), - Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), - Path.fromOSString("subdir.mk")}; - IProject[] projects = createProjects("test30_2", null, null, true); - buildProjects(projects, makefiles); - } - - /* (non-Javadoc) - * tests 3.0 top-level tool-chain definition - */ - public void testTopTC(){ - IProject[] projects = createProjects("TopTC", null, "TopTC.target.exe", false); - // There should be only one project. - assertNotNull(projects); - assertEquals(1, projects.length); - IProject project = projects[0]; - // Verify a number of other attributes - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - assertNotNull(info); - IManagedProject managedProj = info.getManagedProject(); - assertNotNull(managedProj); - IConfiguration[] configs = managedProj.getConfigurations(); - assertNotNull(configs); - assertEquals(2, configs.length); - // Make sure that each configuration has a tool-chain with all 5 tools - for (int i=0; i 0) { + if (i == 0) { + String configName = info.getDefaultConfiguration().getName(); + IPath buildDir = Path.fromOSString(configName); + if (compareBenchmark) + succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildDir, files); + else + succeeded = ManagedBuildTestHelper.verifyFilesDoNotExist(curProject, buildDir, files); + } + } + } + } + + if (succeeded) { // Otherwise leave the projects around for comparison + for (int i = 0; i < projects.length; i++) + ManagedBuildTestHelper.removeProject(projects[i].getName()); + } + } + + // Build projects and compare benchmarks + private void buildProjects(IProject projects[], IPath[] files) { + buildProjectsWorker(projects, files, true); + } + + // Build projects but don't compare benchmarks because there should be not build files generated + private void buildDegenerativeProjects(IProject projects[], IPath[] files) { + buildProjectsWorker(projects, files, false); + } + + 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 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);} + } + + /* (non-Javadoc) + * tests 3.0 style tool integration for a single file executable + */ + public void test30SingleFileExe(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk")}; + IProject[] projects = createProjects("singleFileExe", null, null, true); + buildProjects(projects, makefiles); + } + + /* (non-Javadoc) + * tests 3.0 style tool integration for a two file SO + */ + public void test30TwoFileSO(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk")}; + IProject[] projects = createProjects("twoFileSO", null, null, true); + buildProjects(projects, makefiles); + } + + /* (non-Javadoc) + * tests 3.0 style tool integration for multiple source files & a resource configuration + */ + public void test30MultiResConfig(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), + Path.fromOSString("main.d"), + Path.fromOSString("source1/subdir.mk"), + Path.fromOSString("source1/Class1.d"), + Path.fromOSString("source2/subdir.mk"), + Path.fromOSString("source2/Class2.d"), + Path.fromOSString("source2/source21/Class21.d"), + Path.fromOSString("source2/source21/subdir.mk")}; + IProject[] projects = createProjects("multiResConfig", null, null, true); + buildProjects(projects, makefiles); + } + + /* (non-Javadoc) + * tests 3.0 style tool integration for linked files + */ + public void test30LinkedLib(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + //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/test30Projects/linkedLib/")); + IPath srcDir = Path.fromOSString(srcDirFile.toString()); + IPath tmpSubDir = Path.fromOSString("CDTMBSTest"); + IPath tmpDir = ManagedBuildTestHelper.copyFilesToTempDir(srcDir, tmpSubDir, linkedFiles); + try { + IProject[] projects = createProjects("linkedLib", null, "cdt.managedbuild.target.gnu30.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 + buildProjects(projects, makefiles); + } finally {ManagedBuildTestHelper.deleteTempDir(tmpSubDir, linkedFiles);} + } + + /* (non-Javadoc) + * tests 3.0 style tool integration for a linked folder + */ + public void test30LinkedFolder(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + 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/objects.mk"), + Path.fromOSString("Benchmarks/subdir.mk"), + Path.fromOSString("Benchmarks/sources.mk")}; + File srcDirFile = CTestPlugin.getFileInPlugin(new Path("resources/test30Projects/linkedFolder/")); + IPath srcDir = Path.fromOSString(srcDirFile.toString()); + IPath tmpSubDir = Path.fromOSString("CDTMBSTest"); + IPath tmpDir = ManagedBuildTestHelper.copyFilesToTempDir(srcDir, tmpSubDir, linkedFiles); + if (!pathVariableCreated) { + createPathVariable(tmpDir); + pathVariableCreated = true; + } + try { + IPath location = Path.fromOSString(MBS_TEMP_DIR); + IProject[] projects = createProjects("linkedFolder", location, "cdt.managedbuild.target.gnu30.lib", false); + // Build the project + buildProjects(projects, makefiles); + } finally {ManagedBuildTestHelper.deleteTempDir(tmpSubDir, linkedFiles);} + } + + /* (non-Javadoc) + * tests 3.0 style tool integration with pre and post process steps added to typical compile & link + */ + public void test30CopyandDeploy(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), + Path.fromOSString("main.d"), + Path.fromOSString("Functions/subdir.mk"), + Path.fromOSString("Functions/Func1.d")}; + IProject[] projects = createProjects("copyandDeploy", null, null, true); + buildProjects(projects, makefiles); + } + + /* (non-Javadoc) + * tests 3.0 style tool integration in the context of deleting a file, to see if the proper behavior + * occurs in the managedbuild system + */ + public void test30DeleteFile(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("subdir.mk"), + Path.fromOSString("sources.mk")}; + + IProject[] projects = createProjects("deleteFile", null, null, true); + final IWorkspace workspace = ResourcesPlugin.getWorkspace(); + ArrayList resourceList = new ArrayList(1); + IProject project = projects[0]; + IFile projfile = project.getFile("filetobedeleted.cxx"); + resourceList.add(projfile); + final IResource[] fileResource = (IResource[])resourceList.toArray(new IResource[resourceList.size()]); + IWorkspaceRunnable runnable = new IWorkspaceRunnable() { + public void run(IProgressMonitor monitor) throws CoreException { + workspace.delete(fileResource, false, null); + } + }; + try { + NullProgressMonitor monitor = new NullProgressMonitor(); + workspace.run(runnable, workspace.getRoot(), IWorkspace.AVOID_UPDATE, monitor); + } catch (Exception e) { + fail("could not delete file in project " + project.getName()); + } + buildProjects(projects, makefiles); + } + + /* (non-Javadoc) + * tests 3.0 managed build system with a project which has only a single source file that is marked as + * "excluded from build" to see that this degenerative case is handled gracefully + */ + public void test30NoFilesToBuild(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("subdir.mk"), + Path.fromOSString("sources.mk")}; + + IProject[] projects = createProjects("noFilesToBuild", null, null, true); + IProject project = projects[0]; + IFile projfile = project.getFile("filetobeexcluded.cxx"); + IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); + IConfiguration config = info.getDefaultConfiguration(); + IResourceConfiguration rconfig = config.createResourceConfiguration(projfile); + rconfig.setExclude(true); + buildDegenerativeProjects(projects, makefiles); + } + + /** + * (non-Javadoc) + * tests 3.0 managed build system with a project which has a file with no file extesnion + */ + public void testFileWithNoExtension() + { + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk")}; + IProject[] projects = createProjects("testFileWithNoExtension", null, null, true); + buildProjects(projects, makefiles); + } + + + /* (non-Javadoc) + * tests 3.0 style tool integration: create pre-build and post-build steps and verify that + * the proper commands are generated in the makefile which is created by the managedbuild system + */ + public void testPreAndPostProcessBuildSteps(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("subdir.mk"), + Path.fromOSString("sources.mk")}; + + IProject[] projects = createProjects("preAndPostBuildSteps", null, null, true); + IProject project = projects[0]; + IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); + IConfiguration config = info.getDefaultConfiguration(); + IFile projfile = project.getFile("main.cxx"); + config.setPreannouncebuildStep("Pre-announce Build Step"); + config.setPrebuildStep("echo 'executing Pre-Build Step' "); + config.setPostannouncebuildStep("Post-announce Build Step"); + config.setPostbuildStep("echo 'executing Post-Build Step' "); + buildProjects(projects, makefiles); + } + + + /* (non-Javadoc) + * tests 3.0 style tool integration: create resource custom build step and verify that + * the proper commands are generated in the makefile which is created by the managedbuild system + */ + public void testResourceCustomBuildStep(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("subdir.mk"), + Path.fromOSString("sources.mk")}; + ITool rcbsTool; + IInputType rcbsToolInputType; + IAdditionalInput rcbsToolInputTypeAdditionalInput; + IOutputType rcbsToolOutputType; + + IProject[] projects = createProjects("rcbsBasicTest", null, null, true); + IProject project = projects[0]; + IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); + IConfiguration config = info.getDefaultConfiguration(); + IFile projfile = project.getFile("rcbsBasicTest.c"); + IResourceConfiguration rconfig = config.createResourceConfiguration(projfile); + rcbsTool = rconfig.createTool(null,"rcbsBasicTestTool","rcbs Basic Test Tool",false); + rcbsToolInputType = rcbsTool.createInputType(null,"rcbsToolInputTypeId","rcbsToolInputTypeName",false); + rcbsToolInputTypeAdditionalInput = rcbsToolInputType.createAdditionalInput(""); + rcbsToolInputTypeAdditionalInput.setKind(IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY); + rcbsToolOutputType = rcbsTool.createOutputType(null,"rcbsToolOutputTypeId","rcbsToolOutputTypeName",false); + rcbsToolOutputType.setOutputNames("rcbsBasicTest.o"); + rcbsTool.setCustomBuildStep(true); + rcbsTool.setToolCommand("gcc -g -c ../rcbsBasicTest.c -o ./rcbsBasicTest.o"); + rcbsTool.setAnnouncement("Now executing custom build step for rcbsBasicTest debug config"); + rconfig.setRcbsApplicability(IResourceConfiguration.KIND_APPLY_RCBS_TOOL_AS_OVERRIDE); + buildProjects(projects, makefiles); + } + + + /* (non-Javadoc) + * tests 3.0 style tool integration with pre and post process steps added to typical compile & link + */ + public void test30_1(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk")}; + IProject[] projects = createProjects("test30_1", null, null, true); + buildProjects(projects, makefiles); + } + + /* (non-Javadoc) + * tests 3.0 style tool integration with multiple input types use Eclipse content types + */ + public void test30_2(){ + IPath[] makefiles = { + Path.fromOSString("makefile"), + Path.fromOSString("objects.mk"), + Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk")}; + IProject[] projects = createProjects("test30_2", null, null, true); + buildProjects(projects, makefiles); + } + + /* (non-Javadoc) + * tests 3.0 top-level tool-chain definition + */ + public void testTopTC(){ + IProject[] projects = createProjects("TopTC", null, "TopTC.target.exe", false); + // There should be only one project. + assertNotNull(projects); + assertEquals(1, projects.length); + IProject project = projects[0]; + // Verify a number of other attributes + IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); + assertNotNull(info); + IManagedProject managedProj = info.getManagedProject(); + assertNotNull(managedProj); + IConfiguration[] configs = managedProj.getConfigurations(); + assertNotNull(configs); + assertEquals(2, configs.length); + // Make sure that each configuration has a tool-chain with all 5 tools + for (int i=0; i