Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/rdmd
- import std.stdio;
- import std.string;
- import std.conv;
- void main(string[] args)
- {
- string[] records;
- bool inRecord;
- bool failedRecord;
- string testname;
- string[] failedTests;
- foreach(line; File(args[1]).byLine)
- {
- records ~= to!string(line);
- if (line == "================================================================================")
- {
- if (inRecord)
- {
- inRecord = false;
- // Print lines of failed Test
- if (failedRecord)
- {
- if (testname != "")
- failedTests ~= testname;
- testname = "";
- foreach(record; records)
- {
- writeln(record);
- }
- }
- // Reset and continue processing next record
- records = [];
- failedRecord = false;
- continue;
- }
- if (!inRecord)
- {
- inRecord = true;
- continue;
- }
- }
- if (line.startsWith("Result: FAIL"))
- {
- failedRecord = true;
- }
- if (line.startsWith("/usr/share/glusterfs/tests/") && line.stripRight.endsWith(" .."))
- {
- testname = to!string(line.replace(" ..", ""));
- }
- }
- stderr.writeln("Failed test files:");
- stderr.writeln(failedTests.join("\n"));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement