Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Display diff between failed test and expected output. Fix Test03

  • Loading branch information...
commit c8671acc306358eec1a60039db4da4cd3d07a01a 1 parent ce98fbe
hiddenGithub authored April 09, 2012
2  Tests
... ...
@@ -1 +1 @@
1  
-Subproject commit f096f0b1f14d65b44898fdcc35ea93c60cd96199
  1
+Subproject commit b2d719fac74f6a2986937329fa641ba4a0b1c011
44  Tipi.xcodeproj/project.pbxproj
@@ -56,6 +56,20 @@
56 56
 /* End PBXCopyFilesBuildPhase section */
57 57
 
58 58
 /* Begin PBXFileReference section */
  59
+		831A8D1D153329DF00E36646 /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
  60
+		831A8D1F153329DF00E36646 /* Test01.input */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test01.input; sourceTree = "<group>"; };
  61
+		831A8D20153329DF00E36646 /* Test01.output */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test01.output; sourceTree = "<group>"; };
  62
+		831A8D21153329DF00E36646 /* Test02.input */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test02.input; sourceTree = "<group>"; };
  63
+		831A8D22153329DF00E36646 /* Test02.output */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test02.output; sourceTree = "<group>"; };
  64
+		831A8D23153329DF00E36646 /* Test03.input */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test03.input; sourceTree = "<group>"; };
  65
+		831A8D24153329DF00E36646 /* Test03.output */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test03.output; sourceTree = "<group>"; };
  66
+		831A8D25153329DF00E36646 /* Test04.input */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test04.input; sourceTree = "<group>"; };
  67
+		831A8D26153329DF00E36646 /* Test04.output */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test04.output; sourceTree = "<group>"; };
  68
+		831A8D27153329DF00E36646 /* Test05.input */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test05.input; sourceTree = "<group>"; };
  69
+		831A8D28153329DF00E36646 /* Test05.output */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test05.output; sourceTree = "<group>"; };
  70
+		831A8D29153329DF00E36646 /* Test06.input */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test06.input; sourceTree = "<group>"; };
  71
+		831A8D2A153329DF00E36646 /* Test06.output */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test06.output; sourceTree = "<group>"; };
  72
+		831A8D2B153329DF00E36646 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = "<group>"; };
59 73
 		838CA669152DB08F0013C064 /* Tipi */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Tipi; sourceTree = BUILT_PRODUCTS_DIR; };
60 74
 		838CA66D152DB08F0013C064 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
61 75
 		838CA670152DB08F0013C064 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@@ -125,6 +139,35 @@
125 139
 /* End PBXFrameworksBuildPhase section */
126 140
 
127 141
 /* Begin PBXGroup section */
  142
+		831A8D1C153329DF00E36646 /* Tests */ = {
  143
+			isa = PBXGroup;
  144
+			children = (
  145
+				831A8D1D153329DF00E36646 /* .gitignore */,
  146
+				831A8D1E153329DF00E36646 /* basic */,
  147
+				831A8D2B153329DF00E36646 /* README.md */,
  148
+			);
  149
+			path = Tests;
  150
+			sourceTree = SOURCE_ROOT;
  151
+		};
  152
+		831A8D1E153329DF00E36646 /* basic */ = {
  153
+			isa = PBXGroup;
  154
+			children = (
  155
+				831A8D1F153329DF00E36646 /* Test01.input */,
  156
+				831A8D20153329DF00E36646 /* Test01.output */,
  157
+				831A8D21153329DF00E36646 /* Test02.input */,
  158
+				831A8D22153329DF00E36646 /* Test02.output */,
  159
+				831A8D23153329DF00E36646 /* Test03.input */,
  160
+				831A8D24153329DF00E36646 /* Test03.output */,
  161
+				831A8D25153329DF00E36646 /* Test04.input */,
  162
+				831A8D26153329DF00E36646 /* Test04.output */,
  163
+				831A8D27153329DF00E36646 /* Test05.input */,
  164
+				831A8D28153329DF00E36646 /* Test05.output */,
  165
+				831A8D29153329DF00E36646 /* Test06.input */,
  166
+				831A8D2A153329DF00E36646 /* Test06.output */,
  167
+			);
  168
+			path = basic;
  169
+			sourceTree = "<group>";
  170
+		};
128 171
 		838CA65E152DB08F0013C064 = {
129 172
 			isa = PBXGroup;
130 173
 			children = (
@@ -154,6 +197,7 @@
154 197
 		838CA66F152DB08F0013C064 /* Tipi */ = {
155 198
 			isa = PBXGroup;
156 199
 			children = (
  200
+				831A8D1C153329DF00E36646 /* Tests */,
157 201
 				838CA67B152DB0BF0013C064 /* Tipi */,
158 202
 				838CA670152DB08F0013C064 /* main.m */,
159 203
 				838CA674152DB08F0013C064 /* Tipi.1 */,
21  Tipi/main.m
@@ -44,6 +44,27 @@ int main(int argc, const char * argv[]) {
44 44
 								}
45 45
 								else {
46 46
 									NSLog(@"[%@] >>>> Test failed <<<<", item);
  47
+									
  48
+									NSString *temporaryPath = [NSString stringWithFormat:@"%@.fail", outputPath];
  49
+									
  50
+									NSLog(@"Temporary Path: %@", temporaryPath);
  51
+									
  52
+									[expansion writeToFile:temporaryPath
  53
+												atomically:NO
  54
+												  encoding:NSUTF8StringEncoding
  55
+													 error:nil];
  56
+									
  57
+									NSTask *task = [[NSTask alloc] init];
  58
+									task.launchPath = @"/usr/bin/diff";
  59
+									task.arguments = [NSArray arrayWithObjects:
  60
+																		@"-u",
  61
+																		outputPath,
  62
+																		temporaryPath, nil];
  63
+									[task launch];
  64
+									[task waitUntilExit];
  65
+									
  66
+									[[NSFileManager defaultManager] removeItemAtPath:temporaryPath
  67
+																			   error:nil];
47 68
 								}
48 69
 							}
49 70
 							else {

0 notes on commit c8671ac

Please sign in to comment.
Something went wrong with that request. Please try again.