View | Details | Raw Unified | Return to bug 397116 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.photran.cdtinterface/.classpath (+2 lines)
Lines 3-7 Link Here
3
	<classpathentry kind="src" path="src"/>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
4
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
5
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
6
	<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.photran.core.vpg"/>
7
	<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.rephraserengine.core"/>
6
	<classpathentry kind="output" path="bin"/>
8
	<classpathentry kind="output" path="bin"/>
7
</classpath>
9
</classpath>
(-)a/org.eclipse.photran.cdtinterface/META-INF/MANIFEST.MF (-1 / +6 lines)
Lines 8-13 Link Here
8
Bundle-Vendor: %providerName
8
Bundle-Vendor: %providerName
9
Bundle-Localization: plugin
9
Bundle-Localization: plugin
10
Export-Package: org.eclipse.photran.cdtinterface.makegen,
10
Export-Package: org.eclipse.photran.cdtinterface.makegen,
11
 org.eclipse.photran.cdtinterface.managebuilder,
12
 org.eclipse.photran.cdtinterface.managebuilder.gnu,
13
 org.eclipse.photran.cdtinterface.managebuilder.intel,
14
 org.eclipse.photran.cdtinterface.managebuilder.xlf,
11
 org.eclipse.photran.internal.cdtinterface;x-internal:=true,
15
 org.eclipse.photran.internal.cdtinterface;x-internal:=true,
12
 org.eclipse.photran.internal.cdtinterface.core;x-friends:="org.eclipse.photran.ui",
16
 org.eclipse.photran.internal.cdtinterface.core;x-friends:="org.eclipse.photran.ui",
13
 org.eclipse.photran.internal.cdtinterface.dom;x-internal:=true,
17
 org.eclipse.photran.internal.cdtinterface.dom;x-internal:=true,
Lines 41-46 Link Here
41
 org.eclipse.ui.views,
45
 org.eclipse.ui.views,
42
 org.eclipse.cdt.managedbuilder.core,
46
 org.eclipse.cdt.managedbuilder.core,
43
 org.eclipse.ui.navigator.resources,
47
 org.eclipse.ui.navigator.resources,
44
 org.eclipse.ui.navigator
48
 org.eclipse.ui.navigator,
49
 org.eclipse.photran.core.vpg;bundle-version="8.0.0"
45
Bundle-ActivationPolicy: lazy
50
Bundle-ActivationPolicy: lazy
46
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
51
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
(-)a/org.eclipse.photran.cdtinterface/src/org/eclipse/photran/cdtinterface/makegen/DefaultFortranDependencyCalculator.java (-73 / +70 lines)
Lines 20-26 Link Here
20
import java.io.Reader;
20
import java.io.Reader;
21
import java.io.StreamTokenizer;
21
import java.io.StreamTokenizer;
22
import java.util.ArrayList;
22
import java.util.ArrayList;
23
import java.util.Arrays;
23
import java.util.Collection;
24
import java.util.Collection;
25
import java.util.List;
24
26
25
import org.eclipse.cdt.core.CCorePlugin;
27
import org.eclipse.cdt.core.CCorePlugin;
26
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
28
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
Lines 40-59 Link Here
40
import org.eclipse.core.runtime.Path;
42
import org.eclipse.core.runtime.Path;
41
import org.eclipse.core.runtime.content.IContentType;
43
import org.eclipse.core.runtime.content.IContentType;
42
import org.eclipse.photran.internal.cdtinterface.core.FortranLanguage;
44
import org.eclipse.photran.internal.cdtinterface.core.FortranLanguage;
45
import org.eclipse.photran.internal.core.vpg.PhotranVPG;
43
46
44
/**
47
/**
45
 *  This class implements the Dependency Manager and Output Name Provider interfaces
48
 *  This class implements the Dependency Manager and Output Name Provider interfaces
46
 *  @author Unknown
49
 *  @author Unknown
47
 *  @author Timofey Yuvashev 2009
50
 *  @author Timofey Yuvashev 2009
48
 *  @author Jeff Overbey -- files were not being closed (Bug 334796)
51
 *  @author Jeff Overbey -- files were not being closed (Bug 334796)
49
 *  
52
 *  @author Uchuva -- Use PhotranVPG to find dependencies for the given project
53
 *          (Managed Build project, Fall CS 427)
54
 *          Refactored: removed resources from getFileNameContainingModule
55
 *          function since Photran VPG does not need resources argument 
50
 *  @since 8.0
56
 *  @since 8.0
51
 */
57
 */
52
@SuppressWarnings({ "deprecation", "rawtypes", "unchecked", "unused" })
58
@SuppressWarnings({ "deprecation", "rawtypes", "unchecked", "unused" })
53
public class DefaultFortranDependencyCalculator implements IManagedDependencyGenerator,
59
public class DefaultFortranDependencyCalculator implements IManagedDependencyGenerator,
54
														   IManagedOutputNameProvider
60
														   IManagedOutputNameProvider
55
{
61
{
56
	public static final String MODULE_EXTENSION = "o";	//$NON-NLS-1$
62
	public static final String MODULE_EXTENSION = "o";	//$NON-NLS-1$	
57
	
63
	
58
	/*
64
	/*
59
	 * Return a list of the names of all modules used by a file
65
	 * Return a list of the names of all modules used by a file
Lines 243-249 Link Here
243
								//  to generate .mod files in the directory from which the compiler is run.  For MBS, this
249
								//  to generate .mod files in the directory from which the compiler is run.  For MBS, this
244
								//  is the top-level build directory.  
250
								//  is the top-level build directory.  
245
								//  TODO: Support the /module:path option and use that in determining the path of the module file 
251
								//  TODO: Support the /module:path option and use that in determining the path of the module file 
246
								IPath modName = getModulePath(topBuildDir, modules[im], res, project);
252
								IPath modName = getModulePath(topBuildDir, modules[im], resourcesToSearch, project);
247
								modRes.add(project.getFile(modName));
253
								modRes.add(project.getFile(modName));
248
								foundDependency = true;
254
								foundDependency = true;
249
								break;
255
								break;
Lines 280-286 Link Here
280
	private IPath getModulePath(String topBuildDir, String moduleName, IResource[] resources, IProject project)
286
	private IPath getModulePath(String topBuildDir, String moduleName, IResource[] resources, IProject project)
281
	{
287
	{
282
		String fileNameContainingModule;
288
		String fileNameContainingModule;
283
		fileNameContainingModule = getFileNameContainingModule(moduleName, resources, topBuildDir);
289
		fileNameContainingModule = getFileNameContainingModule(resources, moduleName);
284
		
290
		
285
		//If we can't find any files with that module, remove Debug folder
291
		//If we can't find any files with that module, remove Debug folder
286
		if(fileNameContainingModule == null || fileNameContainingModule == "") //$NON-NLS-1$
292
		if(fileNameContainingModule == null || fileNameContainingModule == "") //$NON-NLS-1$
Lines 302-379 Link Here
302
	}
308
	}
303
	
309
	
304
	/*
310
	/*
305
	 * This method operates under that assumption that 
311
	 * This method finds the relative path to the filename that contains the 
306
	 * 1. There will be no 2 files that are named the same, even if they are in separate folder
312
	 * name of the given module. It returns a string which is the relative 
307
	 * 2. There is only 1 module per file
313
	 * path to the file containing the given module, with that
308
	 * 3. There are no files that differ in their names only by upper or lower case letters (i.e. file1.f90 and fILe1.f90)
314
	 * file's extension chopped off.
309
	 * 
315
	 * 
310
	 * This method finds the relative path to the filename that matches the name of the given module. It 
316
	 * @moduleName - name of the module that we are retrieving the filename
311
	 * searches the list of given @resources to compare the names of contained files. It returns a string which
312
	 * is the relative path to the file supposedly containing the given module, with that file's extension chopped off.
313
	 * 
314
	 * @moduleName - name of the module that we are comparing files against
315
	 * @resources  - list of resources that we look through (could be files and folders)
316
	 */
317
	 */
317
	private String getFileNameContainingModule(String moduleName, IResource[] resources, String buildDirName)
318
	@SuppressWarnings("restriction")
319
    public String getFileNameContainingModule(IResource[] resources, String moduleName)
318
	{
320
	{
319
		ArrayList possibleMatchingFiles = new ArrayList();
321
      if(resources == null || resources.length < 1 || 
320
		if(resources == null || resources.length < 1 || 
322
          moduleName == null || moduleName == "") //$NON-NLS-1$
321
		   moduleName == null || moduleName == "") //$NON-NLS-1$
323
      {
322
		{
324
          return null;
323
			return null;
325
      }
324
		}
326
      List<IFile> fileList = PhotranVPG.getInstance().findFilesThatExportModule(moduleName);
325
		
327
      
326
		for(int i = 0; i < resources.length; i++)
328
      return getFilePathFromResources(resources, fileList);
327
		{
328
			if(resources[i] instanceof IFile)
329
			{
330
				IFile f = (IFile)resources[i];
331
				
332
				//Gets rid of the file extension
333
				String fileName = f.getName().replaceFirst("\\..+", ""); //$NON-NLS-1$ //$NON-NLS-2$
334
				
335
				//If a file name matches a module name exactly -- return the relative path to that file
336
				if(fileName == moduleName)
337
					return f.getProjectRelativePath().toString().replaceFirst("\\..+", ""); //$NON-NLS-1$ //$NON-NLS-2$
338
				
339
				//Otherwise, check if the two names have different cases
340
				else if(fileName.equalsIgnoreCase(moduleName))
341
				{
342
					//And if they do, keep it
343
					possibleMatchingFiles.add(f.getProjectRelativePath().toString().replaceFirst("\\..+", "")); //$NON-NLS-1$ //$NON-NLS-2$
344
				}
345
			}
346
			//If its a folder, recurse, but don't look in other build folders (Bug 326333)
347
			else if(resources[i] instanceof IContainer && !resources[i].isDerived())
348
			{
349
				IContainer folder = (IContainer)resources[i];
350
				IResource[] subResource = null;
351
				
352
				//Skip build folder, because it contains files with the same
353
				// names as the one we are looking for (created .o files)
354
				if(folder.getName().equalsIgnoreCase(buildDirName))
355
					continue;
356
					
357
				try 
358
				{
359
					subResource = folder.members();
360
				} 
361
				catch (CoreException e) 
362
				{
363
					throw new Error("Could not open a container to explore its files"); //$NON-NLS-1$
364
				}
365
				
366
				String name = getFileNameContainingModule(moduleName, subResource, buildDirName);
367
				if(name != null)
368
					return name;
369
			}			
370
		}
371
		if(possibleMatchingFiles.size() == 1)
372
			return (String) possibleMatchingFiles.get(0);
373
		
374
		return null;
375
			
376
	}
329
	}
330
331
	
332
    /**
333
     * Returns the file path of the file from file list that matches a 
334
     * resource. 
335
     * 
336
     * @param resources: list of resources within the project
337
     * @param files: list of files
338
     */
339
    private String getFilePathFromResources(IResource[] resources, List<IFile> files)
340
    {
341
        for(IFile file: files){
342
              for (IResource resource : resources){
343
                  if (file.getProjectRelativePath().equals(resource.getProjectRelativePath())){
344
                      return file.getProjectRelativePath().toString().replaceFirst("\\..+", ""); //$NON-NLS-1$ //$NON-NLS-2$
345
                  }
346
              }
347
          }
348
        return null;
349
    }
377
	
350
	
378
	private void removeDir(File f)
351
	private void removeDir(File f)
379
	{	
352
	{	
Lines 395-401 Link Here
395
	/* (non-Javadoc)
368
	/* (non-Javadoc)
396
	 * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#findDependencies(org.eclipse.core.resources.IResource)
369
	 * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#findDependencies(org.eclipse.core.resources.IResource)
397
	 */
370
	 */
398
	public IResource[] findDependencies(IResource resource, IProject project) {
371
	@SuppressWarnings("restriction")
372
    public IResource[] findDependencies(IResource resource, IProject project) {
373
	    boolean isRefactoringEnableForProject = PhotranVPG.getInstance().shouldProcessProject(project);
374
	    if(!isRefactoringEnableForProject){
375
	        forcePhotranVPGUpdate(project, true);
376
	    }
377
	    
399
		ArrayList dependencies = new ArrayList();
378
		ArrayList dependencies = new ArrayList();
400
		Collection fortranContentTypes = new FortranLanguage().getRegisteredContentTypeIds();
379
		Collection fortranContentTypes = new FortranLanguage().getRegisteredContentTypeIds();
401
380
Lines 431-440 Link Here
431
		{
410
		{
432
			return new IResource[0];
411
			return new IResource[0];
433
		}
412
		}
413
		finally{
414
    		if(!isRefactoringEnableForProject){
415
    	        PhotranVPG.getInstance().clearDatabase();
416
    		    forcePhotranVPGUpdate(project, false);
417
    		}
418
		}
434
		
419
		
435
		return (IResource[]) dependencies.toArray(new IResource[dependencies.size()]);
420
		return (IResource[]) dependencies.toArray(new IResource[dependencies.size()]);
436
	}
421
	}
437
422
423
    /**
424
     * Force Photran VPG update and ensure the database is up-to-date
425
     *  
426
     * @param project - Project to force VPG update on it
427
     * @param forceUpdate - whether force update 
428
     */
429
    @SuppressWarnings("restriction")
430
    private void forcePhotranVPGUpdate(IProject project, boolean forceUpdate){
431
        PhotranVPG.getInstance().setPropertyEnableVpg(project, forceUpdate);
432
        PhotranVPG.getInstance().ensureVPGIsUpToDate(new NullProgressMonitor());
433
    }
434
438
	/* (non-Javadoc)
435
	/* (non-Javadoc)
439
	 * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#getCalculatorType()
436
	 * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#getCalculatorType()
440
	 */
437
	 */
(-)a/org.eclipse.photran.cdtinterface/src/org/eclipse/photran/cdtinterface/managebuilder/BaseManageBuilderToolChainSupported.java (+69 lines)
Added Link Here
1
/**
2
 *  This class implements managed tool chain supported and outputs 
3
 *  whether Os, Compiler and tool chain are supported
4
 *  @author Uchuva - Managed Build project, Fall CS 427
5
 */
6
package org.eclipse.photran.cdtinterface.managebuilder;
7
8
import java.util.Arrays;
9
10
import org.eclipse.cdt.managedbuilder.core.IManagedIsToolChainSupported;
11
import org.eclipse.cdt.managedbuilder.core.IToolChain;
12
import org.osgi.framework.Version;
13
14
public abstract class BaseManageBuilderToolChainSupported implements IManagedIsToolChainSupported
15
{
16
    private IPlatformOS platformOs = new PlatformOS();
17
    private ISupportedCompiler supportedCompiler = new CompilerSupported();
18
    
19
    /**
20
     * Sets mocked OS for unit testing
21
     * 
22
     * @param platformOs - Mock up OS to support testing.      
23
     */
24
    public void setPlatformOs(IPlatformOS platformOs)
25
    {
26
        this.platformOs = platformOs;
27
    }
28
    
29
    /**
30
     * Sets mocked compiler for unit testing
31
     * 
32
     * @param supportedCompiler - Mock up compiler to support testing.      
33
     */
34
    public void setCompilerSupported(ISupportedCompiler supportedCompiler)
35
    {
36
        this.supportedCompiler = supportedCompiler;
37
    }
38
    
39
    /**
40
     * @return <code>true</code> if the given tool-chain is supported on the system
41
     * otherwise returns <code>false</code>
42
     * 
43
     */
44
    public boolean isSupported(IToolChain toolChain, Version version, String instance)
45
    {
46
       return isOsSupported(toolChain) && isCompilerSupported();
47
    }
48
 
49
    protected abstract boolean isCompilerSupported();
50
    
51
    /**
52
     * @return <code>true</code> if the given OS in the tool-chain is supported on 
53
     * the system otherwise returns <code>false</code>
54
     *
55
     */
56
    private boolean isOsSupported(IToolChain toolChain)
57
    {
58
        return Arrays.asList(toolChain.getOSList()).contains(platformOs.getOS());
59
    }
60
    
61
    /**
62
     * @return <code>true</code> if the given compiler executable and version is 
63
     * supported on the system otherwise returns <code>false</code>
64
     *
65
     */
66
    protected boolean isCompilerSupported(String compilerExecutable, String versionFlag){
67
        return this.supportedCompiler.isSupported(compilerExecutable, versionFlag);
68
    }
69
}
(-)a/org.eclipse.photran.cdtinterface/src/org/eclipse/photran/cdtinterface/managebuilder/CompilerSupported.java (+46 lines)
Added Link Here
1
/**
2
 *  This class implements supported compiler and outputs whether given compiler 
3
 *  is supported on the system.
4
 *  @author Uchuva - Managed Build project, Fall CS 427
5
 */
6
package org.eclipse.photran.cdtinterface.managebuilder;
7
8
import java.io.BufferedReader;
9
import java.io.InputStreamReader;
10
11
12
public class CompilerSupported implements ISupportedCompiler
13
{
14
15
    /**
16
     * @return <code>true</code> if the given compiler is supported on the system
17
     * otherwise returns <code>false</code>
18
     * 
19
     */
20
    @Override
21
    public boolean isSupported(String compilerExecutable, String versionFlag)
22
    {
23
        if(compilerExecutable == null || compilerExecutable == "") //$NON-NLS-1$
24
            throw new IllegalArgumentException("Invalid compilerExecutable argument"); //$NON-NLS-1$
25
        if(versionFlag == null || versionFlag == "") //$NON-NLS-1$
26
            throw new IllegalArgumentException("Invalid versionFlag argument"); //$NON-NLS-1$
27
        
28
        String[] command = new String[] {compilerExecutable, versionFlag};
29
30
        Process runCompilerCommand = null;
31
        boolean compilerSupported = false;
32
        try {
33
            runCompilerCommand = Runtime.getRuntime().exec(command);
34
            new BufferedReader(new InputStreamReader(
35
                runCompilerCommand.getInputStream()));            
36
            compilerSupported = true;
37
        } catch (Exception e) {
38
            System.out.println("Compiler doesn't exist " + e.getMessage()); //$NON-NLS-1$
39
        }
40
        finally{
41
            if(runCompilerCommand != null)
42
                runCompilerCommand.destroy();
43
        }
44
        return compilerSupported;
45
    }
46
}
(-)a/org.eclipse.photran.cdtinterface/src/org/eclipse/photran/cdtinterface/managebuilder/IPlatformOS.java (+10 lines)
Added Link Here
1
/**
2
 *  Interface to implement supported platform OS.
3
 *  @author Uchuva - Managed Build project, Fall CS 427
4
 */
5
package org.eclipse.photran.cdtinterface.managebuilder;
6
7
public interface IPlatformOS
8
{
9
    String getOS();
10
}
(-)a/org.eclipse.photran.cdtinterface/src/org/eclipse/photran/cdtinterface/managebuilder/ISupportedCompiler.java (+10 lines)
Added Link Here
1
/**
2
 *  Interface to implement supported compiler.
3
 *  @author Uchuva - Managed Build project, Fall CS 427
4
 */
5
package org.eclipse.photran.cdtinterface.managebuilder;
6
7
public interface ISupportedCompiler
8
{
9
    public boolean isSupported(String compilerExecutable, String versionFlag);
10
}
(-)a/org.eclipse.photran.cdtinterface/src/org/eclipse/photran/cdtinterface/managebuilder/PlatformOS.java (+20 lines)
Added Link Here
1
/**
2
 *  This class implements platform OS and outputs 
3
 *  Os, used only for unit testing to mock different 
4
 *  operating systems.
5
 *  @author Uchuva - Managed Build project, Fall CS 427
6
 */
7
package org.eclipse.photran.cdtinterface.managebuilder;
8
9
import org.eclipse.core.runtime.Platform;
10
11
public class PlatformOS implements IPlatformOS
12
{
13
14
    @Override
15
    public String getOS()
16
    {
17
        return Platform.getOS();
18
    }
19
20
}
(-)a/org.eclipse.photran.cdtinterface/src/org/eclipse/photran/cdtinterface/managebuilder/gnu/IsGnuToolChainSupported.java (+25 lines)
Added Link Here
1
/**
2
 *  This class extends managed tool chain supported and outputs 
3
 *  whether Gnu fortran compiler is supported on the system.
4
 *  @author Uchuva - Managed Build project, Fall CS 427
5
 */
6
package org.eclipse.photran.cdtinterface.managebuilder.gnu;
7
8
import org.eclipse.photran.cdtinterface.managebuilder.BaseManageBuilderToolChainSupported;
9
10
public class IsGnuToolChainSupported  extends BaseManageBuilderToolChainSupported
11
{
12
    private static final String COMPILER_EXECUTABLE = "gfortran"; //$NON-NLS-1$
13
    private static final String VERSION_FLAG = "-dumpversion"; //$NON-NLS-1$ 
14
    
15
    /**
16
     * @return <code>true</code> if the gnu fortran compiler is supported on the system
17
     * otherwise returns <code>false</code>
18
     * 
19
     */
20
    @Override
21
    protected boolean isCompilerSupported()
22
    {
23
        return isCompilerSupported(COMPILER_EXECUTABLE,VERSION_FLAG);
24
    }
25
}
(-)a/org.eclipse.photran.cdtinterface/src/org/eclipse/photran/cdtinterface/managebuilder/intel/IsIntelToolChainSupported.java (+24 lines)
Added Link Here
1
/**
2
 *  This class extends managed tool chain supported and outputs 
3
 *  whether Intel fortran compiler is supported on the system.
4
 *  @author Uchuva - Managed Build project, Fall CS 427
5
 */
6
package org.eclipse.photran.cdtinterface.managebuilder.intel;
7
8
import org.eclipse.photran.cdtinterface.managebuilder.BaseManageBuilderToolChainSupported;
9
10
public class IsIntelToolChainSupported  extends BaseManageBuilderToolChainSupported
11
{
12
    private static final String COMPILER_EXECUTABLE = "ifort"; //$NON-NLS-1$
13
    private static final String VERSION_FLAG = "-version"; //$NON-NLS-1$ 
14
    /**
15
     * @return <code>true</code> if the intel fortran compiler is supported on the system
16
     * otherwise returns <code>false</code>
17
     * 
18
     */
19
    @Override
20
    protected boolean isCompilerSupported()
21
    {
22
        return isCompilerSupported(COMPILER_EXECUTABLE, VERSION_FLAG);
23
    }
24
}
(-)a/org.eclipse.photran.cdtinterface/src/org/eclipse/photran/cdtinterface/managebuilder/xlf/IsXlfToolChainSupported.java (+25 lines)
Added Link Here
1
/**
2
 *  This class extends managed tool chain supported and outputs 
3
 *  whether Xlf fortran compiler is supported on the system.
4
 *  @author Uchuva - Managed Build project, Fall CS 427
5
 */
6
package org.eclipse.photran.cdtinterface.managebuilder.xlf;
7
8
import org.eclipse.photran.cdtinterface.managebuilder.BaseManageBuilderToolChainSupported;
9
10
public class IsXlfToolChainSupported extends BaseManageBuilderToolChainSupported
11
{
12
    private static final String COMPILER_EXECUTABLE = "xlf"; //$NON-NLS-1$
13
    private static final String VERSION_FLAG = "-qversion"; //$NON-NLS-1$    
14
15
    /**
16
     * @return <code>true</code> if the Xlf fortran compiler is supported on the system
17
     * otherwise returns <code>false</code>
18
     * 
19
     */
20
    @Override
21
    protected boolean isCompilerSupported()
22
    {
23
        return isCompilerSupported(COMPILER_EXECUTABLE, VERSION_FLAG);
24
    }
25
}
(-)a/org.eclipse.photran.core.vpg.tests/.classpath (+1 lines)
Lines 3-7 Link Here
3
	<classpathentry kind="src" path="src"/>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
4
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
5
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
6
	<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.photran.cdtinterface"/>
6
	<classpathentry kind="output" path="bin"/>
7
	<classpathentry kind="output" path="bin"/>
7
</classpath>
8
</classpath>
(-)a/org.eclipse.photran.core.vpg.tests/META-INF/MANIFEST.MF (-1 / +3 lines)
Lines 17-23 Link Here
17
 org.eclipse.rephraserengine.core,
17
 org.eclipse.rephraserengine.core,
18
 org.eclipse.rephraserengine.testing.junit3,
18
 org.eclipse.rephraserengine.testing.junit3,
19
 org.eclipse.rephraserengine.ui,
19
 org.eclipse.rephraserengine.ui,
20
 org.eclipse.photran.core
20
 org.eclipse.photran.core,
21
 org.eclipse.photran.cdtinterface;bundle-version="8.0.0",
22
 org.eclipse.cdt.managedbuilder.core;bundle-version="8.1.0"
21
Bundle-ActivationPolicy: lazy
23
Bundle-ActivationPolicy: lazy
22
Bundle-Activator: org.eclipse.photran.internal.tests.Activator
24
Bundle-Activator: org.eclipse.photran.internal.tests.Activator
23
Export-Package: org.eclipse.photran.internal.tests;x-friends:="org.eclipse.photran.core.vpg.tests.failing,org.eclipse.photran.core.vpg.preprocessor.c.tests",
25
Export-Package: org.eclipse.photran.internal.tests;x-friends:="org.eclipse.photran.core.vpg.tests.failing,org.eclipse.photran.core.vpg.preprocessor.c.tests",
(-)a/org.eclipse.photran.core.vpg.tests/src/org/eclipse/photran/internal/tests/PhotranWorkspaceTestCase.java (-1 / +35 lines)
Lines 25-36 Link Here
25
import java.net.URISyntaxException;
25
import java.net.URISyntaxException;
26
import java.net.URL;
26
import java.net.URL;
27
import java.util.ArrayList;
27
import java.util.ArrayList;
28
import java.util.Arrays;
28
import java.util.HashMap;
29
import java.util.HashMap;
30
import java.util.List;
29
31
30
import org.eclipse.cdt.core.CCorePlugin;
32
import org.eclipse.cdt.core.CCorePlugin;
31
import org.eclipse.cdt.core.dom.IPDOMManager;
33
import org.eclipse.cdt.core.dom.IPDOMManager;
34
import org.eclipse.cdt.core.model.CoreModel;
32
import org.eclipse.cdt.core.model.ICProject;
35
import org.eclipse.cdt.core.model.ICProject;
36
import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
37
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
38
import org.eclipse.cdt.core.settings.model.ICFolderDescription;
39
import org.eclipse.cdt.core.settings.model.ICLanguageSetting;
40
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
41
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
42
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
33
import org.eclipse.core.resources.IFile;
43
import org.eclipse.core.resources.IFile;
44
import org.eclipse.core.resources.IFolder;
34
import org.eclipse.core.resources.IProject;
45
import org.eclipse.core.resources.IProject;
35
import org.eclipse.core.resources.IResource;
46
import org.eclipse.core.resources.IResource;
36
import org.eclipse.core.resources.IWorkspace;
47
import org.eclipse.core.resources.IWorkspace;
Lines 60-65 Link Here
60
 * @author Jeff Overbey - Modified so that every test case creates a new project - Added line/column
71
 * @author Jeff Overbey - Modified so that every test case creates a new project - Added line/column
61
 *         computation when importing files - Added {@link #compileAndRunFortranProgram(String...)}
72
 *         computation when importing files - Added {@link #compileAndRunFortranProgram(String...)}
62
 *         Also added marker infrastructure.
73
 *         Also added marker infrastructure.
74
 * @author Uchuva - Modified to create test sub directories to avoid overwriting test file contents
75
 *         when file names are identical in sub directories.        
63
 */
76
 */
64
public abstract class PhotranWorkspaceTestCase extends PhotranTestCase {
77
public abstract class PhotranWorkspaceTestCase extends PhotranTestCase {
65
78
Lines 169-176 Link Here
169
            PhotranVPG.getInstance().clearDatabase();
182
            PhotranVPG.getInstance().clearDatabase();
170
        }
183
        }
171
        project = null;
184
        project = null;
172
	}
185
    }
173
186
187
	// import file with test directory
188
    protected IFile importFile(String testSrcDir, String fileName, String contents) throws Exception
189
    {
190
        if(testSrcDir != null && testSrcDir != "")
191
        {
192
            IFolder folder = project.getProject().getFolder(testSrcDir);
193
            if(!folder.exists())
194
                  folder.create(true, false, monitor);
195
            fileName = "/" + testSrcDir + "/" + fileName;
196
        }        
197
        return importFile(fileName, contents);
198
    }
199
    
174
    protected IFile importFile(String fileName, String contents) throws Exception
200
    protected IFile importFile(String fileName, String contents) throws Exception
175
    {
201
    {
176
		//Obtain file handle
202
		//Obtain file handle
Lines 282-287 Link Here
282
        return result;
308
        return result;
283
    }
309
    }
284
310
311
    protected IFile importFile(Plugin activator, String srcDir, String filename, String testSrcDir) throws Exception
312
    {
313
        //project.getProject().getFile(filename).delete(true, new NullProgressMonitor());
314
        IFile result = importFile(testSrcDir, filename, readTestFile(activator, srcDir, filename));
315
        //project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
316
        return result;
317
    }
318
    
285
    protected String readTestFile(Plugin activator, String srcDir, String filename) throws IOException, URISyntaxException
319
    protected String readTestFile(Plugin activator, String srcDir, String filename) throws IOException, URISyntaxException
286
    {
320
    {
287
        ArrayList<Integer> lineMap = new ArrayList<Integer>(50);
321
        ArrayList<Integer> lineMap = new ArrayList<Integer>(50);
(-)a/org.eclipse.photran.core.vpg.tests/src/org/eclipse/photran/internal/tests/managed/build/IsToolChainSupportedTest.java (+189 lines)
Added Link Here
1
/**
2
 *  Unit test class for testing supported platform OS and compilers for a given 
3
 *  project type and tool chain in new fortran project wizard. 
4
 *  
5
 *  @author Uchuva -- Use PhotranVPG to find dependencies for the given project 
6
 *          (Managed Build project, Fall CS 427)
7
 */
8
package org.eclipse.photran.internal.tests.managed.build;
9
10
import org.eclipse.cdt.managedbuilder.core.IToolChain;
11
import org.eclipse.photran.cdtinterface.managebuilder.BaseManageBuilderToolChainSupported;
12
import org.eclipse.photran.cdtinterface.managebuilder.CompilerSupported;
13
import org.eclipse.photran.cdtinterface.managebuilder.gnu.IsGnuToolChainSupported;
14
import org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported;
15
import org.eclipse.photran.cdtinterface.managebuilder.xlf.IsXlfToolChainSupported;
16
import org.eclipse.photran.internal.tests.PhotranWorkspaceTestCase;
17
18
public class IsToolChainSupportedTest extends PhotranWorkspaceTestCase
19
{
20
    //Test win32 and gnu fortran compiler are supported, other OSes are unsupported.
21
    public void testOsWindowsAndGnuIsSupported() throws Exception
22
    {
23
        BaseManageBuilderToolChainSupported toolChainSupported = new IsGnuToolChainSupported();
24
        osAndAndCompilerIsSupported(toolChainSupported,"win32", new String[] {"solaris", "linux", "hpux", "aix", "qnx", "macosx"}, "gfortran", "-dumpversion");
25
    }
26
    
27
    //Test macosx and gnu fortran compiler are supported, other OSes are unsupported.
28
    public void testOsMacOsXAndGnuIsSupported() throws Exception
29
    {
30
        BaseManageBuilderToolChainSupported toolChainSupported = new IsGnuToolChainSupported();
31
        osAndAndCompilerIsSupported(toolChainSupported,"macosx", new String[] {"solaris", "linux", "hpux", "aix", "qnx", "win32"}, "gfortran", "-dumpversion");
32
    }
33
    
34
    //Test linux and gnu fortran compiler are supported, other OSes are unsupported.
35
    public void testOsLinuxAndGnuIsSupported() throws Exception
36
    {
37
        BaseManageBuilderToolChainSupported toolChainSupported = new IsGnuToolChainSupported();
38
        osAndAndCompilerIsSupported(toolChainSupported, "linux", new String[] {"win32", "macosx"}, "gfortran", "-dumpversion");
39
    }
40
    
41
    //Test win32 and intel fortran compiler are supported, other OSes are unsupported.
42
    public void testOsWindowsAndIntelIsSupported() throws Exception
43
    {
44
        BaseManageBuilderToolChainSupported toolChainSupported = new IsIntelToolChainSupported();
45
        osAndAndCompilerIsSupported(toolChainSupported, "win32", new String[] {"solaris", "linux", "hpux", "aix", "qnx", "macosx"}, "ifort", "-version");
46
    }
47
    
48
    //Test macosx and intel fortran compiler are supported, other OSes are unsupported.
49
    public void testOsMacOsXAndIntelIsSupported() throws Exception
50
    {
51
        BaseManageBuilderToolChainSupported toolChainSupported = new IsIntelToolChainSupported();
52
        osAndAndCompilerIsSupported(toolChainSupported, "macosx", new String[] {"solaris", "linux", "hpux", "aix", "qnx", "win32"}, "ifort", "-version");
53
    }
54
    
55
    //Test linux and intel fortran compiler are supported, other OSes are unsupported.
56
    public void testOsLinuxAndAndIntelIsSupported() throws Exception
57
    {
58
        BaseManageBuilderToolChainSupported toolChainSupported = new IsIntelToolChainSupported();
59
        osAndAndCompilerIsSupported(toolChainSupported, "linux", new String[] {"win32", "macosx"}, "ifort", "-version");
60
    }
61
    
62
    //Test win32 and xlf fortran compiler are supported, other OSes are unsupported.
63
    public void testOsWindowsAndXlfIsSupported() throws Exception
64
    {
65
        BaseManageBuilderToolChainSupported toolChainSupported = new IsXlfToolChainSupported();
66
        osAndAndCompilerIsSupported(toolChainSupported, "win32", new String[] {"solaris", "linux", "hpux", "aix", "qnx", "macosx"}, "xlf", "-qversion");
67
    }
68
    
69
    //Test macosx and xlf fortran compiler are supported, other OSes are unsupported.
70
    public void testOsMacOsXAndXlfIsSupported() throws Exception
71
    {
72
        BaseManageBuilderToolChainSupported toolChainSupported = new IsXlfToolChainSupported();
73
        osAndAndCompilerIsSupported(toolChainSupported,"macosx", new String[] {"solaris", "linux", "hpux", "aix", "qnx", "win32"}, "xlf", "-qversion");
74
    }
75
    
76
    //Test linux and xlf fortran compiler are supported, other OSes are unsupported.
77
    public void testOsLinuxAndAndXlfIsSupported() throws Exception
78
    {
79
        BaseManageBuilderToolChainSupported toolChainSupported = new IsXlfToolChainSupported();
80
        osAndAndCompilerIsSupported(toolChainSupported, "linux", new String[] {"win32", "macosx"}, "xlf", "-qversion");
81
    }
82
    
83
    //Test input validation for empty compiler executable
84
    public void testEmptyCompilerExecutable() throws Exception
85
    {
86
        try
87
        {            
88
            CompilerSupported compilerSupported = new CompilerSupported();
89
            compilerSupported.isSupported("", "-qversion");
90
        }
91
        catch(IllegalArgumentException e)
92
        {
93
            return;
94
        }
95
        fail("testEmptyCompilerExecutable failed to throw exception");
96
    }
97
    
98
    //Test input validation for null compiler executable
99
    public void testNullCompilerExecutable() throws Exception
100
    {
101
        try
102
        {
103
            CompilerSupported compilerSupported = new CompilerSupported();
104
            compilerSupported.isSupported(null, "-qversion");
105
        }
106
        catch(IllegalArgumentException e)
107
        {
108
            return;
109
        }
110
        fail("testNullCompilerExecutable failed to throw exception");
111
    }
112
    
113
    //Test input validation for empty version flag
114
    public void testEmptyCompilerFlag() throws Exception
115
    {
116
        try
117
        {
118
            CompilerSupported compilerSupported = new CompilerSupported();
119
            compilerSupported.isSupported("xlf", "");            
120
        }
121
        catch(IllegalArgumentException e)
122
        {
123
            return;
124
        }
125
        fail("testEmptyCompilerFlag failed to throw exception");
126
    }
127
    
128
    //Test input validation for null version flag
129
    public void testNullCompilerFlag() throws Exception
130
    {
131
        try
132
        {
133
            CompilerSupported compilerSupported = new CompilerSupported();
134
            compilerSupported.isSupported("xlf", null);
135
        }
136
        catch(IllegalArgumentException e)
137
        {
138
            return;
139
        }
140
        fail("testNullCompilerFlag failed to throw exception");
141
    }
142
    
143
    //Test catch block with invalid executable
144
    public void testInvalidCompilerCommand() throws Exception
145
    {
146
        CompilerSupported compilerSupported = new CompilerSupported();
147
        assertFalse(compilerSupported.isSupported("invalidCompiler", "-version"));
148
    }
149
    
150
151
    //Test at least one OS and one fortran compiler is supported
152
    public void testOneOsAndOneCompilerIsSupported() throws Exception
153
    {
154
        boolean hasAtLeastOneToolChainSupport = false;
155
        
156
        IToolChain supportedOs = new MockToolChain();
157
        supportedOs.setOSList(new String[] {"win32","macosx","solaris", "linux", "hpux", "aix", "qnx"});
158
        
159
        BaseManageBuilderToolChainSupported toolChainSupported = new IsGnuToolChainSupported();
160
        
161
        hasAtLeastOneToolChainSupport = toolChainSupported.isSupported(supportedOs, null, null);
162
        
163
        if (!hasAtLeastOneToolChainSupport) {
164
            toolChainSupported = new IsIntelToolChainSupported();
165
            hasAtLeastOneToolChainSupport = toolChainSupported.isSupported(supportedOs, null, null);
166
        }
167
        
168
        if (!hasAtLeastOneToolChainSupport) {
169
            toolChainSupported = new IsXlfToolChainSupported();
170
            hasAtLeastOneToolChainSupport = toolChainSupported.isSupported(supportedOs, null, null);
171
        }
172
        
173
        assertTrue(hasAtLeastOneToolChainSupport);
174
    }
175
    
176
    // Helper function to set mock tool chain and test whether OS and compiler are supported.
177
    private void osAndAndCompilerIsSupported(BaseManageBuilderToolChainSupported toolChainSupported, String supportedOsString, String[] unsupportedOsString, String compiler, String versionFlag)
178
    {
179
        toolChainSupported.setPlatformOs(new MockPlatformOS(supportedOsString));
180
        toolChainSupported.setCompilerSupported(new MockSupportedCompiler(compiler, versionFlag));
181
        IToolChain supportedOs = new MockToolChain();
182
        supportedOs.setOSList(new String[] {supportedOsString});
183
        assertTrue(toolChainSupported.isSupported(supportedOs, null, null));
184
        IToolChain unsupportedOs = new MockToolChain();
185
        unsupportedOs.setOSList(unsupportedOsString);
186
        assertFalse(toolChainSupported.isSupported(unsupportedOs, null, null));
187
    }
188
189
}
(-)a/org.eclipse.photran.core.vpg.tests/src/org/eclipse/photran/internal/tests/managed/build/MockPlatformOS.java (+24 lines)
Added Link Here
1
/**
2
 *  This class implements platform OS supported and outputs mocked OS.
3
 *  @author Uchuva - Managed Build project, Fall CS 427
4
 */
5
package org.eclipse.photran.internal.tests.managed.build;
6
7
import org.eclipse.photran.cdtinterface.managebuilder.IPlatformOS;
8
9
public class MockPlatformOS implements IPlatformOS
10
{
11
    private String os;
12
13
    public MockPlatformOS(String os)
14
    {
15
        this.os = os;
16
    }
17
   
18
    @Override
19
    public String getOS()
20
    {
21
        return os;
22
    }
23
24
}
(-)a/org.eclipse.photran.core.vpg.tests/src/org/eclipse/photran/internal/tests/managed/build/MockSupportedCompiler.java (+26 lines)
Added Link Here
1
/**
2
 *  This class implements supported compiler and outputs result
3
 *  based on mocked compiler executable and version flag.
4
 *  @author Uchuva - Managed Build project, Fall CS 427
5
 */
6
7
package org.eclipse.photran.internal.tests.managed.build;
8
9
import org.eclipse.photran.cdtinterface.managebuilder.ISupportedCompiler;
10
11
12
public class MockSupportedCompiler implements ISupportedCompiler 
13
{
14
    private String compilerExecutable;
15
    private String versionFlag;
16
    public MockSupportedCompiler(String compilerExecutable, String versionFlag){
17
       this.compilerExecutable = compilerExecutable;
18
       this.versionFlag = versionFlag;     
19
    }
20
21
    @Override
22
    public boolean isSupported(String compilerExecutable, String versionFlag)
23
    {
24
        return this.compilerExecutable.equals(compilerExecutable) && this.versionFlag.equals(versionFlag);
25
    }
26
}
(-)a/org.eclipse.photran.core.vpg.tests/src/org/eclipse/photran/internal/tests/managed/build/MockToolChain.java (+702 lines)
Added Link Here
1
/**
2
 *  This class implements tool chain and outputs mocked tool chain.
3
 *  @author Uchuva - Managed Build project, Fall CS 427
4
 */
5
6
package org.eclipse.photran.internal.tests.managed.build;
7
8
import org.eclipse.cdt.core.settings.model.extension.CTargetPlatformData;
9
import org.eclipse.cdt.managedbuilder.core.BuildException;
10
import org.eclipse.cdt.managedbuilder.core.IBuilder;
11
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
12
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
13
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
14
import org.eclipse.cdt.managedbuilder.core.IOption;
15
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
16
import org.eclipse.cdt.managedbuilder.core.IOptionPathConverter;
17
import org.eclipse.cdt.managedbuilder.core.IOutputType;
18
import org.eclipse.cdt.managedbuilder.core.ITargetPlatform;
19
import org.eclipse.cdt.managedbuilder.core.ITool;
20
import org.eclipse.cdt.managedbuilder.core.IToolChain;
21
import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
22
import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
23
import org.osgi.framework.Version;
24
25
public class MockToolChain implements IToolChain
26
{
27
28
    /* (non-Javadoc)
29
     * @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getId()
30
     */
31
    @Override
32
    public String getId()
33
    {
34
        // TODO Auto-generated method stub
35
        return null;
36
    }
37
38
    /* (non-Javadoc)
39
     * @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getName()
40
     */
41
    @Override
42
    public String getName()
43
    {
44
        // TODO Auto-generated method stub
45
        return null;
46
    }
47
48
    /* (non-Javadoc)
49
     * @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getBaseId()
50
     */
51
    @Override
52
    public String getBaseId()
53
    {
54
        // TODO Auto-generated method stub
55
        return null;
56
    }
57
58
    /* (non-Javadoc)
59
     * @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getVersion()
60
     */
61
    @Override
62
    public Version getVersion()
63
    {
64
        // TODO Auto-generated method stub
65
        return null;
66
    }
67
68
    /* (non-Javadoc)
69
     * @see org.eclipse.cdt.managedbuilder.core.IBuildObject#setVersion(org.osgi.framework.Version)
70
     */
71
    @Override
72
    public void setVersion(Version version)
73
    {
74
        // TODO Auto-generated method stub
75
76
    }
77
78
    /* (non-Javadoc)
79
     * @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getManagedBuildRevision()
80
     */
81
    @Override
82
    public String getManagedBuildRevision()
83
    {
84
        // TODO Auto-generated method stub
85
        return null;
86
    }
87
88
    /* (non-Javadoc)
89
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#createOption(org.eclipse.cdt.managedbuilder.core.IOption, java.lang.String, java.lang.String, boolean)
90
     */
91
    @Override
92
    public IOption createOption(IOption superClass, String Id, String name,
93
        boolean isExtensionElement)
94
    {
95
        // TODO Auto-generated method stub
96
        return null;
97
    }
98
99
    /* (non-Javadoc)
100
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#removeOption(org.eclipse.cdt.managedbuilder.core.IOption)
101
     */
102
    @Override
103
    public void removeOption(IOption option)
104
    {
105
        // TODO Auto-generated method stub
106
107
    }
108
109
    /* (non-Javadoc)
110
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOption(java.lang.String)
111
     */
112
    @Override
113
    @Deprecated
114
    public IOption getOption(String id)
115
    {
116
        // TODO Auto-generated method stub
117
        return null;
118
    }
119
120
    /* (non-Javadoc)
121
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOptionById(java.lang.String)
122
     */
123
    @Override
124
    public IOption getOptionById(String id)
125
    {
126
        // TODO Auto-generated method stub
127
        return null;
128
    }
129
130
    /* (non-Javadoc)
131
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOptionBySuperClassId(java.lang.String)
132
     */
133
    @Override
134
    public IOption getOptionBySuperClassId(String id)
135
    {
136
        // TODO Auto-generated method stub
137
        return null;
138
    }
139
140
    /* (non-Javadoc)
141
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOptions()
142
     */
143
    @Override
144
    public IOption[] getOptions()
145
    {
146
        // TODO Auto-generated method stub
147
        return null;
148
    }
149
150
    /* (non-Javadoc)
151
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getChildCategories()
152
     */
153
    @Override
154
    public IOptionCategory[] getChildCategories()
155
    {
156
        // TODO Auto-generated method stub
157
        return null;
158
    }
159
160
    /* (non-Javadoc)
161
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#addOptionCategory(org.eclipse.cdt.managedbuilder.core.IOptionCategory)
162
     */
163
    @Override
164
    public void addOptionCategory(IOptionCategory category)
165
    {
166
        // TODO Auto-generated method stub
167
168
    }
169
170
    /* (non-Javadoc)
171
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOptionCategory(java.lang.String)
172
     */
173
    @Override
174
    public IOptionCategory getOptionCategory(String id)
175
    {
176
        // TODO Auto-generated method stub
177
        return null;
178
    }
179
180
    /* (non-Javadoc)
181
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#createOptions(org.eclipse.cdt.managedbuilder.core.IHoldsOptions)
182
     */
183
    @Override
184
    public void createOptions(IHoldsOptions superClass)
185
    {
186
        // TODO Auto-generated method stub
187
188
    }
189
190
    /* (non-Javadoc)
191
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOptionToSet(org.eclipse.cdt.managedbuilder.core.IOption, boolean)
192
     */
193
    @Override
194
    public IOption getOptionToSet(IOption option, boolean adjustExtension) throws BuildException
195
    {
196
        // TODO Auto-generated method stub
197
        return null;
198
    }
199
200
    /* (non-Javadoc)
201
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#needsRebuild()
202
     */
203
    @Override
204
    public boolean needsRebuild()
205
    {
206
        // TODO Auto-generated method stub
207
        return false;
208
    }
209
210
    /* (non-Javadoc)
211
     * @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#setRebuildState(boolean)
212
     */
213
    @Override
214
    public void setRebuildState(boolean rebuild)
215
    {
216
        // TODO Auto-generated method stub
217
218
    }
219
220
    /* (non-Javadoc)
221
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getParent()
222
     */
223
    @Override
224
    public IConfiguration getParent()
225
    {
226
        // TODO Auto-generated method stub
227
        return null;
228
    }
229
230
    /* (non-Javadoc)
231
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#createTargetPlatform(org.eclipse.cdt.managedbuilder.core.ITargetPlatform, java.lang.String, java.lang.String, boolean)
232
     */
233
    @Override
234
    public ITargetPlatform createTargetPlatform(ITargetPlatform superClass, String Id, String name,
235
        boolean isExtensionElement)
236
    {
237
        // TODO Auto-generated method stub
238
        return null;
239
    }
240
241
    /* (non-Javadoc)
242
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getTargetPlatform()
243
     */
244
    @Override
245
    public ITargetPlatform getTargetPlatform()
246
    {
247
        // TODO Auto-generated method stub
248
        return null;
249
    }
250
251
    /* (non-Javadoc)
252
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#removeLocalTargetPlatform()
253
     */
254
    @Override
255
    public void removeLocalTargetPlatform()
256
    {
257
        // TODO Auto-generated method stub
258
259
    }
260
261
    /* (non-Javadoc)
262
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getVersionsSupported()
263
     */
264
    @Override
265
    public String getVersionsSupported()
266
    {
267
        // TODO Auto-generated method stub
268
        return null;
269
    }
270
271
    /* (non-Javadoc)
272
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getConvertToId()
273
     */
274
    @Override
275
    public String getConvertToId()
276
    {
277
        // TODO Auto-generated method stub
278
        return null;
279
    }
280
281
    /* (non-Javadoc)
282
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setVersionsSupported(java.lang.String)
283
     */
284
    @Override
285
    public void setVersionsSupported(String versionsSupported)
286
    {
287
        // TODO Auto-generated method stub
288
289
    }
290
291
    /* (non-Javadoc)
292
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setConvertToId(java.lang.String)
293
     */
294
    @Override
295
    public void setConvertToId(String convertToId)
296
    {
297
        // TODO Auto-generated method stub
298
299
    }
300
301
    /* (non-Javadoc)
302
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#createBuilder(org.eclipse.cdt.managedbuilder.core.IBuilder, java.lang.String, java.lang.String, boolean)
303
     */
304
    @Override
305
    public IBuilder createBuilder(IBuilder superClass, String Id, String name,
306
        boolean isExtensionElement)
307
    {
308
        // TODO Auto-generated method stub
309
        return null;
310
    }
311
312
    /* (non-Javadoc)
313
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#removeLocalBuilder()
314
     */
315
    @Override
316
    public void removeLocalBuilder()
317
    {
318
        // TODO Auto-generated method stub
319
320
    }
321
322
    /* (non-Javadoc)
323
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getBuilder()
324
     */
325
    @Override
326
    public IBuilder getBuilder()
327
    {
328
        // TODO Auto-generated method stub
329
        return null;
330
    }
331
332
    /* (non-Javadoc)
333
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#createTool(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String, java.lang.String, boolean)
334
     */
335
    @Override
336
    public ITool createTool(ITool superClass, String Id, String name, boolean isExtensionElement)
337
    {
338
        // TODO Auto-generated method stub
339
        return null;
340
    }
341
342
    /* (non-Javadoc)
343
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getTools()
344
     */
345
    @Override
346
    public ITool[] getTools()
347
    {
348
        // TODO Auto-generated method stub
349
        return null;
350
    }
351
352
    /* (non-Javadoc)
353
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getTool(java.lang.String)
354
     */
355
    @Override
356
    public ITool getTool(String id)
357
    {
358
        // TODO Auto-generated method stub
359
        return null;
360
    }
361
362
    /* (non-Javadoc)
363
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getToolsBySuperClassId(java.lang.String)
364
     */
365
    @Override
366
    public ITool[] getToolsBySuperClassId(String id)
367
    {
368
        // TODO Auto-generated method stub
369
        return null;
370
    }
371
372
    /* (non-Javadoc)
373
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getSuperClass()
374
     */
375
    @Override
376
    public IToolChain getSuperClass()
377
    {
378
        // TODO Auto-generated method stub
379
        return null;
380
    }
381
382
    /* (non-Javadoc)
383
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#isAbstract()
384
     */
385
    @Override
386
    public boolean isAbstract()
387
    {
388
        // TODO Auto-generated method stub
389
        return false;
390
    }
391
392
    /* (non-Javadoc)
393
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setIsAbstract(boolean)
394
     */
395
    @Override
396
    public void setIsAbstract(boolean b)
397
    {
398
        // TODO Auto-generated method stub
399
400
    }
401
402
    /* (non-Javadoc)
403
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getUnusedChildren()
404
     */
405
    @Override
406
    public String getUnusedChildren()
407
    {
408
        // TODO Auto-generated method stub
409
        return null;
410
    }
411
412
    private String[] osList; 
413
    
414
    /* (non-Javadoc)
415
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getOSList()
416
     */
417
    @Override
418
    public String[] getOSList()
419
    {
420
        return osList;
421
    }
422
423
    /* (non-Javadoc)
424
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setOSList(java.lang.String[])
425
     */
426
    @Override
427
    public void setOSList(String[] OSs)
428
    {
429
        osList = OSs;
430
    }
431
432
    /* (non-Javadoc)
433
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getArchList()
434
     */
435
    @Override
436
    public String[] getArchList()
437
    {
438
        // TODO Auto-generated method stub
439
        return null;
440
    }
441
442
    /* (non-Javadoc)
443
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setArchList(java.lang.String[])
444
     */
445
    @Override
446
    public void setArchList(String[] archs)
447
    {
448
        // TODO Auto-generated method stub
449
450
    }
451
452
    /* (non-Javadoc)
453
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getErrorParserIds()
454
     */
455
    @Override
456
    public String getErrorParserIds()
457
    {
458
        // TODO Auto-generated method stub
459
        return null;
460
    }
461
462
    /* (non-Javadoc)
463
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getErrorParserIds(org.eclipse.cdt.managedbuilder.core.IConfiguration)
464
     */
465
    @Override
466
    public String getErrorParserIds(IConfiguration config)
467
    {
468
        // TODO Auto-generated method stub
469
        return null;
470
    }
471
472
    /* (non-Javadoc)
473
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getErrorParserList()
474
     */
475
    @Override
476
    public String[] getErrorParserList()
477
    {
478
        // TODO Auto-generated method stub
479
        return null;
480
    }
481
482
    /* (non-Javadoc)
483
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setErrorParserIds(java.lang.String)
484
     */
485
    @Override
486
    public void setErrorParserIds(String ids)
487
    {
488
        // TODO Auto-generated method stub
489
490
    }
491
492
    /* (non-Javadoc)
493
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getDefaultLanguageSettingsProviderIds()
494
     */
495
    @Override
496
    public String getDefaultLanguageSettingsProviderIds()
497
    {
498
        // TODO Auto-generated method stub
499
        return null;
500
    }
501
502
    /* (non-Javadoc)
503
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getScannerConfigDiscoveryProfileId()
504
     */
505
    @Override
506
    public String getScannerConfigDiscoveryProfileId()
507
    {
508
        // TODO Auto-generated method stub
509
        return null;
510
    }
511
512
    /* (non-Javadoc)
513
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setScannerConfigDiscoveryProfileId(java.lang.String)
514
     */
515
    @Override
516
    public void setScannerConfigDiscoveryProfileId(String profileId)
517
    {
518
        // TODO Auto-generated method stub
519
520
    }
521
522
    /* (non-Javadoc)
523
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getTargetToolIds()
524
     */
525
    @Override
526
    public String getTargetToolIds()
527
    {
528
        // TODO Auto-generated method stub
529
        return null;
530
    }
531
532
    /* (non-Javadoc)
533
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setTargetToolIds(java.lang.String)
534
     */
535
    @Override
536
    public void setTargetToolIds(String targetToolIds)
537
    {
538
        // TODO Auto-generated method stub
539
540
    }
541
542
    /* (non-Javadoc)
543
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getTargetToolList()
544
     */
545
    @Override
546
    public String[] getTargetToolList()
547
    {
548
        // TODO Auto-generated method stub
549
        return null;
550
    }
551
552
    /* (non-Javadoc)
553
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getSecondaryOutputs()
554
     */
555
    @Override
556
    public IOutputType[] getSecondaryOutputs()
557
    {
558
        // TODO Auto-generated method stub
559
        return null;
560
    }
561
562
    /* (non-Javadoc)
563
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setSecondaryOutputs(java.lang.String)
564
     */
565
    @Override
566
    public void setSecondaryOutputs(String ids)
567
    {
568
        // TODO Auto-generated method stub
569
570
    }
571
572
    /* (non-Javadoc)
573
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#isDirty()
574
     */
575
    @Override
576
    public boolean isDirty()
577
    {
578
        // TODO Auto-generated method stub
579
        return false;
580
    }
581
582
    /* (non-Javadoc)
583
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#setDirty(boolean)
584
     */
585
    @Override
586
    public void setDirty(boolean isDirty)
587
    {
588
        // TODO Auto-generated method stub
589
590
    }
591
592
    /* (non-Javadoc)
593
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#isExtensionElement()
594
     */
595
    @Override
596
    public boolean isExtensionElement()
597
    {
598
        // TODO Auto-generated method stub
599
        return false;
600
    }
601
602
    /* (non-Javadoc)
603
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#isSupported()
604
     */
605
    @Override
606
    public boolean isSupported()
607
    {
608
        // TODO Auto-generated method stub
609
        return false;
610
    }
611
612
    /* (non-Javadoc)
613
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getEnvironmentVariableSupplier()
614
     */
615
    @Override
616
    public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier()
617
    {
618
        // TODO Auto-generated method stub
619
        return null;
620
    }
621
622
    /* (non-Javadoc)
623
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getBuildMacroSupplier()
624
     */
625
    @Override
626
    public IConfigurationBuildMacroSupplier getBuildMacroSupplier()
627
    {
628
        // TODO Auto-generated method stub
629
        return null;
630
    }
631
632
    /* (non-Javadoc)
633
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getOptionPathConverter()
634
     */
635
    @Override
636
    public IOptionPathConverter getOptionPathConverter()
637
    {
638
        // TODO Auto-generated method stub
639
        return null;
640
    }
641
642
    /* (non-Javadoc)
643
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getParentFolderInfo()
644
     */
645
    @Override
646
    public IFolderInfo getParentFolderInfo()
647
    {
648
        // TODO Auto-generated method stub
649
        return null;
650
    }
651
652
    /* (non-Javadoc)
653
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getTargetPlatformData()
654
     */
655
    @Override
656
    public CTargetPlatformData getTargetPlatformData()
657
    {
658
        // TODO Auto-generated method stub
659
        return null;
660
    }
661
662
    /* (non-Javadoc)
663
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#supportsBuild(boolean)
664
     */
665
    @Override
666
    public boolean supportsBuild(boolean managed)
667
    {
668
        // TODO Auto-generated method stub
669
        return false;
670
    }
671
672
    /* (non-Javadoc)
673
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#isSystemObject()
674
     */
675
    @Override
676
    public boolean isSystemObject()
677
    {
678
        // TODO Auto-generated method stub
679
        return false;
680
    }
681
682
    /* (non-Javadoc)
683
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#matches(org.eclipse.cdt.managedbuilder.core.IToolChain)
684
     */
685
    @Override
686
    public boolean matches(IToolChain tc)
687
    {
688
        // TODO Auto-generated method stub
689
        return false;
690
    }
691
692
    /* (non-Javadoc)
693
     * @see org.eclipse.cdt.managedbuilder.core.IToolChain#getUniqueRealName()
694
     */
695
    @Override
696
    public String getUniqueRealName()
697
    {
698
        // TODO Auto-generated method stub
699
        return null;
700
    }
701
702
}
(-)a/org.eclipse.photran.core.vpg.tests/src/org/eclipse/photran/internal/tests/managed/build/ModuleNameDifferentTest.java (+128 lines)
Added Link Here
1
/**
2
 *  Unit test class for testing module name dependency on file name using 
3
 *  PhotranVPG
4
 *  
5
 *  @author Uchuva -- Use PhotranVPG to find dependencies for the given project 
6
 *          (Managed Build project, Fall CS 427)
7
 */
8
package org.eclipse.photran.internal.tests.managed.build;
9
10
import org.eclipse.core.resources.IFile;
11
import org.eclipse.core.resources.IResource;
12
import org.eclipse.core.runtime.NullProgressMonitor;
13
import org.eclipse.photran.cdtinterface.makegen.DefaultFortranDependencyCalculator;
14
import org.eclipse.photran.internal.core.properties.SearchPathProperties;
15
import org.eclipse.photran.internal.core.vpg.PhotranVPG;
16
import org.eclipse.photran.internal.tests.Activator;
17
import org.eclipse.photran.internal.tests.PhotranWorkspaceTestCase;
18
19
public class ModuleNameDifferentTest extends PhotranWorkspaceTestCase
20
{
21
    private static final String DIR = "vpg-test-code/managed-build/module-name-different/";
22
    
23
    // Test module name matches file name
24
    public void testModuleMatchFile() throws Exception
25
    {
26
        String DIR_test = DIR + "test1";
27
        IResource[] resources = new IResource[1];
28
        IFile module1 = importFile(Activator.getDefault(), DIR_test, "module1.f90");
29
        PhotranVPG.getInstance().ensureVPGIsUpToDate(new NullProgressMonitor());
30
        resources[0] = module1;
31
32
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
33
        String fileName = calculator.getFileNameContainingModule(resources, "module1");
34
        assertEquals("module1", fileName);
35
    }
36
37
    // Test module name does not match file name
38
    public void testModuleNotMatchFile() throws Exception
39
    {        
40
        String DIR_test = DIR + "test2";
41
        IResource[] resources = new IResource[1];
42
        IFile module1 = importFile(Activator.getDefault(), DIR_test, "modules.f90");
43
        PhotranVPG.getInstance().ensureVPGIsUpToDate(new NullProgressMonitor());
44
        resources[0] = module1;
45
46
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
47
        String fileName = calculator.getFileNameContainingModule(resources, "module1");
48
        assertEquals("modules", fileName);
49
     }
50
51
    // Test module name does not exist in the file 
52
    public void testNonexistentModuleName() throws Exception
53
    {        
54
        String DIR_test = DIR + "test3";
55
        IResource[] resources = new IResource[1];
56
        IFile module1 = importFile(Activator.getDefault(), DIR_test, "modules.f90");
57
        PhotranVPG.getInstance().ensureVPGIsUpToDate(new NullProgressMonitor());
58
        resources[0] = module1;
59
60
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
61
        String fileName = calculator.getFileNameContainingModule(resources, "nonexistentModule");
62
        assertNull(fileName);
63
     }
64
    
65
    // Test empty module name
66
    public void testEmptyModuleName() throws Exception
67
    {        
68
        String DIR_test = DIR + "test3";
69
        IResource[] resources = new IResource[1];
70
        IFile module1 = importFile(Activator.getDefault(), DIR_test, "modules.f90");
71
        PhotranVPG.getInstance().ensureVPGIsUpToDate(new NullProgressMonitor());
72
        resources[0] = module1;
73
74
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
75
        String fileName = calculator.getFileNameContainingModule(resources, "");
76
        assertNull(fileName);
77
     }
78
    
79
    // Test null module name
80
    public void testNullModuleName() throws Exception
81
    {        
82
        String DIR_test = DIR + "test3";
83
        IResource[] resources = new IResource[1];
84
        IFile module1 = importFile(Activator.getDefault(), DIR_test, "modules.f90");
85
        PhotranVPG.getInstance().ensureVPGIsUpToDate(new NullProgressMonitor());
86
        resources[0] = module1;
87
88
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
89
        String fileName = calculator.getFileNameContainingModule(resources, null);
90
        assertNull(fileName);
91
     }
92
    
93
    // Test empty resources 
94
    public void testEmptyResources() throws Exception
95
    {        
96
        IResource[] resources = new IResource[0];
97
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
98
        String fileName = calculator.getFileNameContainingModule(resources, "module1");
99
        assertNull(fileName);
100
     }
101
    
102
    // Test null resources
103
    public void testNullResources() throws Exception
104
    {        
105
        IResource[] resources = null;
106
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
107
        String fileName = calculator.getFileNameContainingModule(resources, "module1");
108
        assertNull(fileName);
109
    }
110
111
    // Test set analysis/refactoring enable
112
    public void testSetPropertyEnableVpg() throws Exception
113
    {   
114
        // initial setting is false
115
        String vpgDisableProperty = new SearchPathProperties().getProperty(project, SearchPathProperties.ENABLE_VPG_PROPERTY_NAME);
116
        assertFalse(vpgDisableProperty.equals("false"));
117
        
118
        // set it to true
119
        PhotranVPG.getInstance().setPropertyEnableVpg(project, true);
120
        String vpgEnabledProperty = new SearchPathProperties().getProperty(project, SearchPathProperties.ENABLE_VPG_PROPERTY_NAME);
121
        assertTrue(vpgEnabledProperty.equals("true"));
122
        
123
        // set it back to false
124
        PhotranVPG.getInstance().setPropertyEnableVpg(project, false);
125
        vpgDisableProperty  = new SearchPathProperties().getProperty(project, SearchPathProperties.ENABLE_VPG_PROPERTY_NAME);
126
        assertTrue(vpgDisableProperty.equals("false"));
127
    }
128
}
(-)a/org.eclipse.photran.core.vpg.tests/src/org/eclipse/photran/internal/tests/managed/build/MulitpleModuleInFileTest.java (+104 lines)
Added Link Here
1
/**
2
 *  Unit test class for testing multiple modules and files using PhotranVPG
3
 *  
4
 *  @author Uchuva -- Use PhotranVPG to find dependencies for the given project 
5
 *          (Managed Build project, Fall CS 427)
6
 */
7
8
package org.eclipse.photran.internal.tests.managed.build;
9
10
11
import org.eclipse.core.resources.IFile;
12
import org.eclipse.core.resources.IResource;
13
import org.eclipse.core.runtime.NullProgressMonitor;
14
import org.eclipse.photran.cdtinterface.makegen.DefaultFortranDependencyCalculator;
15
import org.eclipse.photran.internal.core.vpg.PhotranVPG;
16
import org.eclipse.photran.internal.tests.Activator;
17
import org.eclipse.photran.internal.tests.PhotranWorkspaceTestCase;
18
19
public class MulitpleModuleInFileTest extends PhotranWorkspaceTestCase
20
{
21
    private static final String DIR = "vpg-test-code/managed-build/multiple-module-in-file/";
22
    
23
    // Test for multiple modules in a single file, and main program 
24
    // has same order on how modules are defined in the source file
25
    public void testMultipleModulesInOrder() throws Exception
26
    {
27
        String DIR_test = DIR + "testMultipleModulesInOrder";
28
        IResource[] resources = new IResource[2];
29
        IFile main = importFile(Activator.getDefault(), DIR_test, "main.f90");
30
        IFile module1 = importFile(Activator.getDefault(), DIR_test, "modules.f90");
31
        PhotranVPG.getInstance().ensureVPGIsUpToDate(new NullProgressMonitor());
32
        resources[0] = main;
33
        resources[1] = module1;
34
35
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
36
        String fileName = calculator.getFileNameContainingModule(resources, "module1");
37
        assertEquals("modules", fileName);
38
        
39
        fileName = calculator.getFileNameContainingModule(resources, "module2");
40
        assertEquals("modules", fileName);
41
    }
42
43
    // Test for multiple modules in a single file, and main program 
44
    // has different order on how modules are defined in the source file
45
    public void testMultipleModulesNotInOrder() throws Exception
46
    {
47
        String DIR_test = DIR + "testMultipleModulesNotInOrder";
48
        IResource[] resources = new IResource[2];
49
        IFile main = importFile(Activator.getDefault(), DIR_test, "main.f90");
50
        IFile modules = importFile(Activator.getDefault(), DIR_test, "modules.f90");
51
        PhotranVPG.getInstance().ensureVPGIsUpToDate(new NullProgressMonitor());
52
        resources[0] = main;
53
        resources[1] = modules;
54
55
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
56
        String fileName = calculator.getFileNameContainingModule(resources, "module1");
57
        assertEquals("modules", fileName);
58
        
59
        fileName = calculator.getFileNameContainingModule(resources, "module2");
60
        assertEquals("modules", fileName);
61
    }
62
63
    // Test different module in same file name and different folder
64
    public void testDifferentFoldersIdenticalFilesContainsUniqueModule() throws Exception
65
    {   
66
        String DIR_test = DIR + "testDifferentFoldersIdenticalFilesContainsUniqueModule/";
67
        String DIR_folder1_test = DIR_test + "folder1";
68
        String DIR_folder2_test = DIR_test + "folder2";
69
        IResource[] resources = new IResource[2];
70
        IFile module1 = importFile(Activator.getDefault(), DIR_folder1_test, "modules.f90", "folder1");
71
        IFile module2 = importFile(Activator.getDefault(), DIR_folder2_test, "modules.f90", "folder2");
72
        PhotranVPG.getInstance().ensureVPGIsUpToDate(new NullProgressMonitor());
73
        
74
        resources[0] = module1;
75
        resources[1] = module2;
76
77
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
78
        
79
        String fileNameModule1 = calculator.getFileNameContainingModule(resources, "module1");
80
        assertEquals("folder1/modules", fileNameModule1);
81
        
82
        String fileNameModule2 = calculator.getFileNameContainingModule(resources, "module2");
83
        assertEquals("folder2/modules", fileNameModule2);
84
     }
85
    
86
    // Test different module in same file name and different folder
87
    public void testDifferentFoldersIdenticalFilesContainsUniqueModuleDifferentProjects() throws Exception
88
    {   
89
        String DIR_test = DIR + "testDifferentFoldersIdenticalFilesContainsUniqueModuleDifferentProjects/";
90
        String DIR_project1_test = DIR_test + "project1";
91
        String DIR_project2_folder1_test = DIR_test + "project2/folder1";
92
        IResource[] resources = new IResource[1];
93
        IFile project1_module1 = importFile(Activator.getDefault(), DIR_project1_test, "modules.f90");
94
        IFile project2_module1 = importFile(Activator.getDefault(), DIR_project2_folder1_test, "modules.f90", "folder1");
95
        PhotranVPG.getInstance().ensureVPGIsUpToDate(new NullProgressMonitor());
96
        
97
        resources[0] = project2_module1;
98
99
        DefaultFortranDependencyCalculator calculator = new DefaultFortranDependencyCalculator();
100
        
101
        String fileNameModule1 = calculator.getFileNameContainingModule(resources, "module1");
102
        assertEquals("folder1/modules", fileNameModule1);
103
     }
104
}
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/module-name-different/test1/module1.f90 (+2 lines)
Added Link Here
1
module module1
2
end module module1
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/module-name-different/test2/modules.f90 (+2 lines)
Added Link Here
1
module module1
2
end module module1
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/module-name-different/test3/modules.f90 (+2 lines)
Added Link Here
1
module module1
2
end module module1
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/multiple-module-in-file/testDifferentFoldersIdenticalFilesContainsUniqueModule/folder1/modules.f90 (+2 lines)
Added Link Here
1
module module1
2
end module module1
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/multiple-module-in-file/testDifferentFoldersIdenticalFilesContainsUniqueModule/folder2/modules.f90 (+2 lines)
Added Link Here
1
module module2
2
end module module2
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/multiple-module-in-file/testDifferentFoldersIdenticalFilesContainsUniqueModuleDifferentProjects/project1/modules.f90 (+2 lines)
Added Link Here
1
module module1
2
end module module1
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/multiple-module-in-file/testDifferentFoldersIdenticalFilesContainsUniqueModuleDifferentProjects/project2/folder1/modules.f90 (+2 lines)
Added Link Here
1
module module1
2
end module module1
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/multiple-module-in-file/testMultipleModulesInOrder/main.f90 (+4 lines)
Added Link Here
1
program main
2
	USE Module1	
3
    USE Module2
4
end program
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/multiple-module-in-file/testMultipleModulesInOrder/modules.f90 (+5 lines)
Added Link Here
1
module module1
2
end module module1
3
4
module module2
5
end module module2
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/multiple-module-in-file/testMultipleModulesNotInOrder/main.f90 (+4 lines)
Added Link Here
1
program main
2
	USE Module2
3
	USE Module1
4
end program
(-)a/org.eclipse.photran.core.vpg.tests/vpg-test-code/managed-build/multiple-module-in-file/testMultipleModulesNotInOrder/modules.f90 (+5 lines)
Added Link Here
1
module module1
2
end module module1
3
4
module module2
5
end module module2
(-)a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/vpg/PhotranVPG.java (+15 lines)
Lines 39-44 Link Here
39
 * Photran's Virtual Program Graph.
39
 * Photran's Virtual Program Graph.
40
 *
40
 *
41
 * @author Jeff Overbey
41
 * @author Jeff Overbey
42
 * @author Uchuva -- Add setPropertyEnableVpg function to set Enable VPG property 
43
 *          programmatically (Managed Build project, Fall CS 427)
42
 */
44
 */
43
//public class PhotranVPG extends EclipseVPG<IFortranAST, Token, PhotranTokenRef, PhotranVPGDB, PhotranVPGLog>
45
//public class PhotranVPG extends EclipseVPG<IFortranAST, Token, PhotranTokenRef, PhotranVPGDB, PhotranVPGLog>
44
public class PhotranVPG extends EclipseVPG<IFortranAST, Token, PhotranTokenRef>
46
public class PhotranVPG extends EclipseVPG<IFortranAST, Token, PhotranTokenRef>
Lines 544-549 Link Here
544
            return false; // Project may be closed, or something like that; see Bug 369094
546
            return false; // Project may be closed, or something like that; see Bug 369094
545
        }
547
        }
546
    }
548
    }
549
    
550
    /**
551
     * Set the ENABLE_VPG_PROPERTY_NAME property for a given project
552
     * 
553
     * @author Uchuva 
554
     * 
555
     * @param project - Project to set its ENABLE_VPG_PROPERTY_NAME property
556
     * @param value - property value to set
557
     */
558
    public void setPropertyEnableVpg(IProject project, boolean value)
559
    {
560
        new SearchPathProperties().setProperty(project, SearchPathProperties.ENABLE_VPG_PROPERTY_NAME, Boolean.toString(value));
561
    }
547
562
548
    public String describeWhyCannotProcessProject(IProject project)
563
    public String describeWhyCannotProcessProject(IProject project)
549
    {
564
    {
(-)a/org.eclipse.photran.managedbuilder.gnu.ui/plugin.xml (-6 / +12 lines)
Lines 594-600 Link Here
594
                     name="%ToolChainName.Dbg"
594
                     name="%ToolChainName.Dbg"
595
                     targetTool="photran.managedbuild.tool.gnu.fortran.linker.exe.debug"
595
                     targetTool="photran.managedbuild.tool.gnu.fortran.linker.exe.debug"
596
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
596
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
597
                     id="photran.managedbuild.toolchain.gnu.fortran.exe.debug">
597
                     id="photran.managedbuild.toolchain.gnu.fortran.exe.debug"
598
                     isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.gnu.IsGnuToolChainSupported">
598
		          <targetPlatform
599
		          <targetPlatform
599
		              id="photran.managedbuild.target.gnu.platform.exe.debug"
600
		              id="photran.managedbuild.target.gnu.platform.exe.debug"
600
		              name="%PlatformName.Dbg"
601
		              name="%PlatformName.Dbg"
Lines 655-661 Link Here
655
                     name="%ToolChainName.Rel"
656
                     name="%ToolChainName.Rel"
656
                     targetTool="photran.managedbuild.tool.gnu.fortran.linker.exe.release"
657
                     targetTool="photran.managedbuild.tool.gnu.fortran.linker.exe.release"
657
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
658
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
658
                     id="photran.managedbuild.toolchain.gnu.fortran.exe.release">
659
                     id="photran.managedbuild.toolchain.gnu.fortran.exe.release"
660
                     isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.gnu.IsGnuToolChainSupported">
659
		          <targetPlatform
661
		          <targetPlatform
660
		              id="photran.managedbuild.target.gnu.platform.fortran.exe.release"
662
		              id="photran.managedbuild.target.gnu.platform.fortran.exe.release"
661
		              name="%PlatformName.Rel"
663
		              name="%PlatformName.Rel"
Lines 728-734 Link Here
728
                     name="%ToolChainName.Dbg"
730
                     name="%ToolChainName.Dbg"
729
                     targetTool="photran.managedbuild.tool.macosx.fortran.linker.macosx.exe.debug"
731
                     targetTool="photran.managedbuild.tool.macosx.fortran.linker.macosx.exe.debug"
730
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
732
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
731
                     id="photran.managedbuild.toolchain.gnu.fortran.macosx.exe.debug">
733
                     id="photran.managedbuild.toolchain.gnu.fortran.macosx.exe.debug"
734
                     isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.gnu.IsGnuToolChainSupported">
732
                  <targetPlatform
735
                  <targetPlatform
733
					  id="photran.managedbuild.target.gnu.platform.macosx.exe.debug"
736
					  id="photran.managedbuild.target.gnu.platform.macosx.exe.debug"
734
				 	  name="%PlatformName.Dbg"
737
				 	  name="%PlatformName.Dbg"
Lines 789-795 Link Here
789
                     name="%ToolChainName.Rel"
792
                     name="%ToolChainName.Rel"
790
                     targetTool="photran.managedbuild.tool.macosx.fortran.linker.macosx.exe.release"
793
                     targetTool="photran.managedbuild.tool.macosx.fortran.linker.macosx.exe.release"
791
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
794
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
792
                     id="photran.managedbuild.toolchain.gnu.fortran.macosx.exe.release">
795
                     id="photran.managedbuild.toolchain.gnu.fortran.macosx.exe.release"
796
                     isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.gnu.IsGnuToolChainSupported">
793
                  <targetPlatform
797
                  <targetPlatform
794
					  id="photran.managedbuild.target.gnu.platform.fortran.macosx.exe.release"
798
					  id="photran.managedbuild.target.gnu.platform.fortran.macosx.exe.release"
795
				 	  name="%PlatformName.Rel"
799
				 	  name="%PlatformName.Rel"
Lines 862-868 Link Here
862
                     name="%ToolChainName.Dbg"
866
                     name="%ToolChainName.Dbg"
863
                     targetTool="photran.managedbuild.tool.gnu.fortran.linker.exe.debug"
867
                     targetTool="photran.managedbuild.tool.gnu.fortran.linker.exe.debug"
864
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
868
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
865
                     id="photran.managedbuild.toolchain.gnu.fortran.win32.exe.debug">
869
                     id="photran.managedbuild.toolchain.gnu.fortran.win32.exe.debug"
870
                     isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.gnu.IsGnuToolChainSupported">
866
                  <targetPlatform
871
                  <targetPlatform
867
					  id="photran.managedbuild.target.gnu.platform.win32.exe.debug"
872
					  id="photran.managedbuild.target.gnu.platform.win32.exe.debug"
868
				 	  name="%PlatformName.Dbg"
873
				 	  name="%PlatformName.Dbg"
Lines 923-929 Link Here
923
                     name="%ToolChainName.Rel"
928
                     name="%ToolChainName.Rel"
924
                     targetTool="photran.managedbuild.tool.gnu.fortran.linker.exe.release"
929
                     targetTool="photran.managedbuild.tool.gnu.fortran.linker.exe.release"
925
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
930
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
926
                     id="photran.managedbuild.toolchain.gnu.fortran.win32.exe.release">
931
                     id="photran.managedbuild.toolchain.gnu.fortran.win32.exe.release"
932
                     isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.gnu.IsGnuToolChainSupported">
927
                  <targetPlatform
933
                  <targetPlatform
928
					  id="photran.managedbuild.target.gnu.platform.fortran.win32.exe.release"
934
					  id="photran.managedbuild.target.gnu.platform.fortran.win32.exe.release"
929
				 	  name="%PlatformName.Rel"
935
				 	  name="%PlatformName.Rel"
(-)a/org.eclipse.photran.managedbuilder.intel.ui/plugin.xml (-21 / +42 lines)
Lines 1918-1924 Link Here
1918
               osList="linux"
1918
               osList="linux"
1919
               name="%ToolChainName.x86"
1919
               name="%ToolChainName.x86"
1920
               targetTool="photran.managedbuild.tool.intel.fortran.linker;photran.managedbuild.tool.intel.fortran.archiver"
1920
               targetTool="photran.managedbuild.tool.intel.fortran.linker;photran.managedbuild.tool.intel.fortran.archiver"
1921
               id="photran.managedbuild.toolchain.intel.fortran.x86.base">
1921
               id="photran.managedbuild.toolchain.intel.fortran.x86.base"
1922
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
1922
               <!-- add archList="x86,x86_64" when possible-->
1923
               <!-- add archList="x86,x86_64" when possible-->
1923
		       <targetPlatform
1924
		       <targetPlatform
1924
		          id="photran.managedbuild.target.intel.platform.x86.base"
1925
		          id="photran.managedbuild.target.intel.platform.x86.base"
Lines 1976-1982 Link Here
1976
               osList="linux"
1977
               osList="linux"
1977
               name="%ToolChainName.x86_64"
1978
               name="%ToolChainName.x86_64"
1978
               targetTool="photran.managedbuild.tool.intel.fortran.linker;photran.managedbuild.tool.intel.fortran.archiver"
1979
               targetTool="photran.managedbuild.tool.intel.fortran.linker;photran.managedbuild.tool.intel.fortran.archiver"
1979
               id="photran.managedbuild.toolchain.intel.fortran.x86_64.base">
1980
               id="photran.managedbuild.toolchain.intel.fortran.x86_64.base"
1981
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
1980
		       <targetPlatform
1982
		       <targetPlatform
1981
		          id="photran.managedbuild.target.intel.platform.x86_64.base"
1983
		          id="photran.managedbuild.target.intel.platform.x86_64.base"
1982
		          name="%PlatformName.x86_64"
1984
		          name="%PlatformName.x86_64"
Lines 2032-2038 Link Here
2032
               osList="linux"
2034
               osList="linux"
2033
               name="%ToolChainName.ipf"
2035
               name="%ToolChainName.ipf"
2034
               targetTool="photran.managedbuild.tool.intel.fortran.linker;photran.managedbuild.tool.intel.fortran.archiver"
2036
               targetTool="photran.managedbuild.tool.intel.fortran.linker;photran.managedbuild.tool.intel.fortran.archiver"
2035
               id="photran.managedbuild.toolchain.intel.fortran.ipf.base">
2037
               id="photran.managedbuild.toolchain.intel.fortran.ipf.base"
2038
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2036
               <targetPlatform
2039
               <targetPlatform
2037
                  id="photran.managedbuild.target.intel.platform.ipf.base"
2040
                  id="photran.managedbuild.target.intel.platform.ipf.base"
2038
                  name="%PlatformName.ipf"
2041
                  name="%PlatformName.ipf"
Lines 2117-2123 Link Here
2117
	        buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2120
	        buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2118
            <toolChain
2121
            <toolChain
2119
               id="photran.managedbuild.toolchain.intel.fortran.exe.x86.debug"
2122
               id="photran.managedbuild.toolchain.intel.fortran.exe.x86.debug"
2120
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base">
2123
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base"
2124
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2121
		       <targetPlatform
2125
		       <targetPlatform
2122
		          id="photran.managedbuild.target.intel.platform.exe.x86.debug"
2126
		          id="photran.managedbuild.target.intel.platform.exe.x86.debug"
2123
		          superClass="photran.managedbuild.target.intel.platform.x86.base">
2127
		          superClass="photran.managedbuild.target.intel.platform.x86.base">
Lines 2171-2177 Link Here
2171
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2175
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2172
            <toolChain
2176
            <toolChain
2173
               id="photran.managedbuild.toolchain.intel.fortran.exe.x86.release"
2177
               id="photran.managedbuild.toolchain.intel.fortran.exe.x86.release"
2174
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base">
2178
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base"
2179
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2175
               <targetPlatform
2180
               <targetPlatform
2176
                  id="photran.managedbuild.target.intel.platform.fortran.exe.x86.release"
2181
                  id="photran.managedbuild.target.intel.platform.fortran.exe.x86.release"
2177
                  superClass="photran.managedbuild.target.intel.platform.x86.base">
2182
                  superClass="photran.managedbuild.target.intel.platform.x86.base">
Lines 2215-2221 Link Here
2215
	        buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2220
	        buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2216
            <toolChain
2221
            <toolChain
2217
               id="photran.managedbuild.toolchain.intel.fortran.exe.x86_64.debug"
2222
               id="photran.managedbuild.toolchain.intel.fortran.exe.x86_64.debug"
2218
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base">
2223
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base"
2224
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2219
		       <targetPlatform
2225
		       <targetPlatform
2220
		          id="photran.managedbuild.target.intel.platform.exe.x86_64.debug"
2226
		          id="photran.managedbuild.target.intel.platform.exe.x86_64.debug"
2221
		          superClass="photran.managedbuild.target.intel.platform.x86_64.base">
2227
		          superClass="photran.managedbuild.target.intel.platform.x86_64.base">
Lines 2269-2275 Link Here
2269
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2275
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2270
            <toolChain
2276
            <toolChain
2271
               id="photran.managedbuild.toolchain.intel.fortran.exe.x86_64.release"
2277
               id="photran.managedbuild.toolchain.intel.fortran.exe.x86_64.release"
2272
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base">
2278
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base"
2279
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2273
               <targetPlatform
2280
               <targetPlatform
2274
                  id="photran.managedbuild.target.intel.platform.fortran.exe.x86_64.release"
2281
                  id="photran.managedbuild.target.intel.platform.fortran.exe.x86_64.release"
2275
                  superClass="photran.managedbuild.target.intel.platform.x86_64.base">
2282
                  superClass="photran.managedbuild.target.intel.platform.x86_64.base">
Lines 2314-2320 Link Here
2314
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2321
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2315
            <toolChain
2322
            <toolChain
2316
               id="photran.managedbuild.toolchain.intel.fortran.exe.ipf.debug"
2323
               id="photran.managedbuild.toolchain.intel.fortran.exe.ipf.debug"
2317
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base">
2324
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base"
2325
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2318
               <targetPlatform
2326
               <targetPlatform
2319
                  id="photran.managedbuild.target.intel.platform.exe.ipf.debug"
2327
                  id="photran.managedbuild.target.intel.platform.exe.ipf.debug"
2320
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
2328
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
Lines 2368-2374 Link Here
2368
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2376
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2369
            <toolChain
2377
            <toolChain
2370
               id="photran.managedbuild.toolchain.intel.fortran.exe.ipf.release"
2378
               id="photran.managedbuild.toolchain.intel.fortran.exe.ipf.release"
2371
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base">
2379
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base"
2380
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2372
               <targetPlatform
2381
               <targetPlatform
2373
                  id="photran.managedbuild.target.intel.platform.fortran.exe.ipf.release"
2382
                  id="photran.managedbuild.target.intel.platform.fortran.exe.ipf.release"
2374
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
2383
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
Lines 2423-2429 Link Here
2423
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2432
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2424
            <toolChain
2433
            <toolChain
2425
               id="photran.managedbuild.toolchain.intel.fortran.ar.x86.debug"
2434
               id="photran.managedbuild.toolchain.intel.fortran.ar.x86.debug"
2426
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base">
2435
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base"
2436
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2427
               <targetPlatform
2437
               <targetPlatform
2428
                  id="photran.managedbuild.target.intel.platform.ar.x86.debug"
2438
                  id="photran.managedbuild.target.intel.platform.ar.x86.debug"
2429
                  superClass="photran.managedbuild.target.intel.platform.x86.base">
2439
                  superClass="photran.managedbuild.target.intel.platform.x86.base">
Lines 2477-2483 Link Here
2477
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2487
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2478
            <toolChain
2488
            <toolChain
2479
               id="photran.managedbuild.toolchain.intel.fortran.ar.x86.release"
2489
               id="photran.managedbuild.toolchain.intel.fortran.ar.x86.release"
2480
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base">
2490
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base"
2491
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2481
               <targetPlatform
2492
               <targetPlatform
2482
                  id="photran.managedbuild.target.intel.platform.fortran.ar.x86.release"
2493
                  id="photran.managedbuild.target.intel.platform.fortran.ar.x86.release"
2483
                  superClass="photran.managedbuild.target.intel.platform.x86.base">
2494
                  superClass="photran.managedbuild.target.intel.platform.x86.base">
Lines 2521-2527 Link Here
2521
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2532
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2522
            <toolChain
2533
            <toolChain
2523
               id="photran.managedbuild.toolchain.intel.fortran.ar.x86_64.debug"
2534
               id="photran.managedbuild.toolchain.intel.fortran.ar.x86_64.debug"
2524
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base">
2535
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base"
2536
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2525
               <targetPlatform
2537
               <targetPlatform
2526
                  id="photran.managedbuild.target.intel.platform.ar.x86_64.debug"
2538
                  id="photran.managedbuild.target.intel.platform.ar.x86_64.debug"
2527
                  superClass="photran.managedbuild.target.intel.platform.x86_64.base">
2539
                  superClass="photran.managedbuild.target.intel.platform.x86_64.base">
Lines 2575-2581 Link Here
2575
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2587
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2576
            <toolChain
2588
            <toolChain
2577
               id="photran.managedbuild.toolchain.intel.fortran.ar.x86_64.release"
2589
               id="photran.managedbuild.toolchain.intel.fortran.ar.x86_64.release"
2578
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base">
2590
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base"
2591
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2579
               <targetPlatform
2592
               <targetPlatform
2580
                  id="photran.managedbuild.target.intel.platform.fortran.ar.x86_64.release"
2593
                  id="photran.managedbuild.target.intel.platform.fortran.ar.x86_64.release"
2581
                  superClass="photran.managedbuild.target.intel.platform.x86_64.base">
2594
                  superClass="photran.managedbuild.target.intel.platform.x86_64.base">
Lines 2619-2625 Link Here
2619
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2632
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2620
            <toolChain
2633
            <toolChain
2621
               id="photran.managedbuild.toolchain.intel.fortran.ar.ipf.debug"
2634
               id="photran.managedbuild.toolchain.intel.fortran.ar.ipf.debug"
2622
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base">
2635
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base"
2636
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2623
               <targetPlatform
2637
               <targetPlatform
2624
                  id="photran.managedbuild.target.intel.platform.ar.ipf.debug"
2638
                  id="photran.managedbuild.target.intel.platform.ar.ipf.debug"
2625
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
2639
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
Lines 2673-2679 Link Here
2673
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2687
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2674
            <toolChain
2688
            <toolChain
2675
               id="photran.managedbuild.toolchain.intel.fortran.ar.ipf.release"
2689
               id="photran.managedbuild.toolchain.intel.fortran.ar.ipf.release"
2676
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base">
2690
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base"
2691
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2677
               <targetPlatform
2692
               <targetPlatform
2678
                  id="photran.managedbuild.target.intel.platform.fortran.ar.ipf.release"
2693
                  id="photran.managedbuild.target.intel.platform.fortran.ar.ipf.release"
2679
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
2694
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
Lines 2727-2733 Link Here
2727
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2742
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2728
            <toolChain
2743
            <toolChain
2729
               id="photran.managedbuild.toolchain.intel.fortran.so.x86.debug"
2744
               id="photran.managedbuild.toolchain.intel.fortran.so.x86.debug"
2730
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base">
2745
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base"
2746
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2731
               <targetPlatform
2747
               <targetPlatform
2732
                  id="photran.managedbuild.target.intel.platform.so.x86.debug"
2748
                  id="photran.managedbuild.target.intel.platform.so.x86.debug"
2733
                  superClass="photran.managedbuild.target.intel.platform.x86.base">
2749
                  superClass="photran.managedbuild.target.intel.platform.x86.base">
Lines 2785-2791 Link Here
2785
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2801
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2786
            <toolChain
2802
            <toolChain
2787
               id="photran.managedbuild.toolchain.intel.fortran.so.x86.release"
2803
               id="photran.managedbuild.toolchain.intel.fortran.so.x86.release"
2788
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base">
2804
               superClass="photran.managedbuild.toolchain.intel.fortran.x86.base"
2805
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2789
               <targetPlatform
2806
               <targetPlatform
2790
                  id="photran.managedbuild.target.intel.platform.fortran.so.x86.release"
2807
                  id="photran.managedbuild.target.intel.platform.fortran.so.x86.release"
2791
                  superClass="photran.managedbuild.target.intel.platform.x86.base">
2808
                  superClass="photran.managedbuild.target.intel.platform.x86.base">
Lines 2832-2838 Link Here
2832
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2849
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2833
            <toolChain
2850
            <toolChain
2834
               id="photran.managedbuild.toolchain.intel.fortran.so.x86_64.debug"
2851
               id="photran.managedbuild.toolchain.intel.fortran.so.x86_64.debug"
2835
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base">
2852
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base"
2853
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2836
               <targetPlatform
2854
               <targetPlatform
2837
                  id="photran.managedbuild.target.intel.platform.so.x86_64.debug"
2855
                  id="photran.managedbuild.target.intel.platform.so.x86_64.debug"
2838
                  superClass="photran.managedbuild.target.intel.platform.x86_64.base">
2856
                  superClass="photran.managedbuild.target.intel.platform.x86_64.base">
Lines 2890-2896 Link Here
2890
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2908
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2891
            <toolChain
2909
            <toolChain
2892
               id="photran.managedbuild.toolchain.intel.fortran.so.x86_64.release"
2910
               id="photran.managedbuild.toolchain.intel.fortran.so.x86_64.release"
2893
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base">
2911
               superClass="photran.managedbuild.toolchain.intel.fortran.x86_64.base"
2912
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2894
               <targetPlatform
2913
               <targetPlatform
2895
                  id="photran.managedbuild.target.intel.platform.fortran.so.x86_64.release"
2914
                  id="photran.managedbuild.target.intel.platform.fortran.so.x86_64.release"
2896
                  superClass="photran.managedbuild.target.intel.platform.x86_64.base">
2915
                  superClass="photran.managedbuild.target.intel.platform.x86_64.base">
Lines 2937-2943 Link Here
2937
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2956
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
2938
            <toolChain
2957
            <toolChain
2939
               id="photran.managedbuild.toolchain.intel.fortran.so.ipf.debug"
2958
               id="photran.managedbuild.toolchain.intel.fortran.so.ipf.debug"
2940
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base">
2959
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base"
2960
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2941
               <targetPlatform
2961
               <targetPlatform
2942
                  id="photran.managedbuild.target.intel.platform.so.ipf.debug"
2962
                  id="photran.managedbuild.target.intel.platform.so.ipf.debug"
2943
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
2963
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
Lines 2995-3001 Link Here
2995
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
3015
            buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
2996
            <toolChain
3016
            <toolChain
2997
               id="photran.managedbuild.toolchain.intel.fortran.so.ipf.release"
3017
               id="photran.managedbuild.toolchain.intel.fortran.so.ipf.release"
2998
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base">
3018
               superClass="photran.managedbuild.toolchain.intel.fortran.ipf.base"
3019
               isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.intel.IsIntelToolChainSupported">
2999
               <targetPlatform
3020
               <targetPlatform
3000
                  id="photran.managedbuild.target.intel.platform.fortran.so.ipf.release"
3021
                  id="photran.managedbuild.target.intel.platform.fortran.so.ipf.release"
3001
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
3022
                  superClass="photran.managedbuild.target.intel.platform.ipf.base">
(-)a/org.eclipse.photran.managedbuilder.xlf.ui/plugin.xml (-2 / +4 lines)
Lines 418-424 Link Here
418
                     name="%XLFToolChainName.Dbg"
418
                     name="%XLFToolChainName.Dbg"
419
                     targetTool="photran.managedbuild.tool.macosx.fortran.xlf.linker.macosx.exe.debug"
419
                     targetTool="photran.managedbuild.tool.macosx.fortran.xlf.linker.macosx.exe.debug"
420
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
420
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
421
                     id="photran.managedbuild.toolchain.xlf.fortran.macosx.exe.debug">
421
                     id="photran.managedbuild.toolchain.xlf.fortran.macosx.exe.debug"
422
                     isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.xlf.IsXlfToolChainSupported">
422
                  <!--targetPlatform
423
                  <!--targetPlatform
423
					  id="photran.managedbuild.target.xlf.platform.macosx.exe.debug"
424
					  id="photran.managedbuild.target.xlf.platform.macosx.exe.debug"
424
				 	  name="%PlatformName.Dbg"
425
				 	  name="%PlatformName.Dbg"
Lines 479-485 Link Here
479
                     name="%XLFToolChainName.Rel"
480
                     name="%XLFToolChainName.Rel"
480
                     targetTool="photran.managedbuild.tool.macosx.fortran.xlf.linker.macosx.exe.release"
481
                     targetTool="photran.managedbuild.tool.macosx.fortran.xlf.linker.macosx.exe.release"
481
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
482
                     scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
482
                     id="photran.managedbuild.toolchain.xlf.fortran.macosx.exe.release">
483
                     id="photran.managedbuild.toolchain.xlf.fortran.macosx.exe.release"
484
                     isToolChainSupported="org.eclipse.photran.cdtinterface.managebuilder.xlf.IsXlfToolChainSupported">
483
                  <!--targetPlatform
485
                  <!--targetPlatform
484
					  id="photran.managedbuild.target.xlf.platform.fortran.macosx.exe.release"
486
					  id="photran.managedbuild.target.xlf.platform.fortran.macosx.exe.release"
485
				 	  name="%PlatformName.Rel"
487
				 	  name="%PlatformName.Rel"

Return to bug 397116