in traceabilitytool/reportgenerator.cs [172:203]
private static void GetRequirementsFromSource(string rootFolderPath, string[] exclusionDirs)
{
// Generate a list of source code files under the root folder.
List<string> sourceCodeFilterList = new List<string>();
sourceCodeFilterList.Add("*.c");
sourceCodeFilterList.Add("*.cpp");
sourceCodeFilterList.Add("*.h");
sourceCodeFilterList.Add("*.cs");
sourceCodeFilterList.Add("*.java");
FileFinder.SetFileFilters(sourceCodeFilterList);
FileFinder.GetFileList(rootFolderPath, exclusionDirs, ref sourceCodeFiles);
// Read requirement identifiers from the source code files.
foreach (string sourceFile in sourceCodeFiles)
{
try
{
ReadSourceCodeRequirements(sourceFile, ref reqCodeLookup);
}
catch (Exception exception)
{
string message = "An error occurred while attempting to access the file " + sourceFile + System.Environment.NewLine +
"The error is: " + exception.Message + System.Environment.NewLine;
if (ReportGenerator.useGUI)
MessageBox.Show(message, "Error");
else
Console.WriteLine(message);
Program.exitCode = 1;
}
}
}