Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test legacy compilation feature, and use plugins that pass the tests

  • Loading branch information...
commit a7aee8e26c43221d0a18ab82ec97b247894d8d85 1 parent 9100600
@andreyvit andreyvit authored
Showing with 440 additions and 192 deletions.
  1. +1 −0  mac/Classes/Model/Project/Project.h
  2. +4 −0 mac/Classes/Model/Project/Project.m
  3. +7 −1 mac/Classes/SelfTest/LRTest.h
  4. +16 −2 mac/Classes/SelfTest/LRTest.m
  5. +20 −4 mac/LiveReload.xcodeproj/project.pbxproj
  6. +4 −0 mac/LiveReloadTestProjects/coffeescript_literate/livereload-test.json
  7. +4 −0 mac/LiveReloadTestProjects/coffeescript_literate_md/livereload-test.json
  8. +4 −0 mac/LiveReloadTestProjects/coffeescript_simple/livereload-test.json
  9. +9 −0 mac/LiveReloadTestProjects/eco_simple/livereload-test.json
  10. +9 −0 mac/LiveReloadTestProjects/haml_simple/livereload-test.json
  11. +4 −0 mac/LiveReloadTestProjects/icedcoffeescript_literate/livereload-test.json
  12. +4 −0 mac/LiveReloadTestProjects/icedcoffeescript_literate_md/livereload-test.json
  13. +4 −0 mac/LiveReloadTestProjects/icedcoffeescript_simple/livereload-test.json
  14. +9 −0 mac/LiveReloadTestProjects/jade_filter_markdown/livereload-test.json
  15. +9 −0 mac/LiveReloadTestProjects/jade_simple/livereload-test.json
  16. +4 −0 mac/LiveReloadTestProjects/less_imports/livereload-test.json
  17. +4 −0 mac/LiveReloadTestProjects/less_imports_reference/livereload-test.json
  18. +4 −0 mac/LiveReloadTestProjects/less_simple/livereload-test.json
  19. +4 −0 mac/LiveReloadTestProjects/less_version_5/livereload-test.json
  20. +4 −0 mac/LiveReloadTestProjects/sass_indented/livereload-test.json
  21. +4 −0 mac/LiveReloadTestProjects/sass_simple/livereload-test.json
  22. +9 −0 mac/LiveReloadTestProjects/slim_simple/livereload-test.json
  23. +11 −0 mac/LiveReloadTestProjects/stylus_nib/livereload-test.json
  24. +4 −0 mac/LiveReloadTestProjects/stylus_simple/livereload-test.json
  25. +4 −0 mac/LiveReloadTestProjects/typescript_simple/livereload-test.json
  26. +12 −0 mac/LiveReloadTests/ATAsyncTestCase.h
  27. +41 −0 mac/LiveReloadTests/ATAsyncTestCase.m
  28. +88 −0 mac/LiveReloadTests/LRCompilationTests.m
  29. +19 −0 mac/LiveReloadTests/LRIntegrationTestCase.h
  30. +38 −0 mac/LiveReloadTests/LRIntegrationTestCase.m
  31. +81 −0 mac/LiveReloadTests/LRLegacyCompilationTests.m
  32. +0 −184 mac/LiveReloadTests/LiveReloadTests.m
  33. +1 −1  plugins
View
1  mac/Classes/Model/Project/Project.h
@@ -53,6 +53,7 @@ enum {
NSMutableDictionary *_compilerOptions;
BOOL _compilationEnabled;
+ BOOL _legacyCompilationEnabled;
ImportGraph *_importGraph;
BOOL _compassDetected;
View
4 mac/Classes/Model/Project/Project.m
@@ -146,6 +146,10 @@ - (id)initWithURL:(NSURL *)rootURL memento:(NSDictionary *)memento {
}
}];
}
+ _legacyCompilationEnabled = _compilationEnabled;
+ if ([memento objectForKey:@"legacyCompilationEnabled"]) {
+ _compilationEnabled = _legacyCompilationEnabled = [[memento objectForKey:@"legacyCompilationEnabled"] boolValue];
+ }
_disableLiveRefresh = [[memento objectForKey:@"disableLiveRefresh"] boolValue];
_enableRemoteServerWorkflow = [[memento objectForKey:@"enableRemoteServerWorkflow"] boolValue];
View
8 mac/Classes/SelfTest/LRTest.h
@@ -2,9 +2,15 @@
#import <Foundation/Foundation.h>
+typedef enum {
+ LRTestOptionNone = 0,
+ LRTestOptionLegacy = 0x01,
+} LRTestOptions;
+
+
@interface LRTest : NSObject
-- (id)initWithFolderURL:(NSURL *)folderURL;
+- (id)initWithFolderURL:(NSURL *)folderURL options:(LRTestOptions)options;
@property(nonatomic, readonly) BOOL valid;
View
18 mac/Classes/SelfTest/LRTest.m
@@ -21,6 +21,11 @@ @interface LRTest ()
@implementation LRTest {
+ LRTestOptions _options;
+
+ BOOL _skip;
+ BOOL _legacy;
+
NSMutableArray *_outputFiles;
NSSet *_originalFiles;
NSSet *_sourceFiles;
@@ -29,13 +34,16 @@ @implementation LRTest {
BOOL _buildRunning;
}
-- (id)initWithFolderURL:(NSURL *)folderURL {
+- (id)initWithFolderURL:(NSURL *)folderURL options:(LRTestOptions)options {
self = [super init];
if (self) {
_folderURL = [folderURL copy];
+ _options = options;
+
_manifestURL = [_folderURL URLByAppendingPathComponent:@"livereload-test.json"];
_outputFiles = [NSMutableArray new];
_valid = YES;
+ _legacy = !!(_options & LRTestOptionLegacy);
[self observeNotification:ProjectAnalysisDidFinishNotification withSelector:@selector(_checkAnalysisStatus)];
[self observeNotification:ProjectBuildFinishedNotification withSelector:@selector(_checkBuildStatus)];
@@ -59,7 +67,10 @@ - (void)analyze {
return;
}
- _projectMemento = _manifest[@"settings"] ?: @{};
+ NSString *settingsKey = (_legacy ? @"2x-settings" : @"settings");
+ _projectMemento = _manifest[settingsKey] ?: @{};
+ if (_legacy && nil == _manifest[settingsKey])
+ _skip = YES;
NSDictionary *outputs = _manifest[@"outputs"] ?: @{};
[outputs enumerateKeysAndObjectsUsingBlock:^(NSString *relativePath, id expectation, BOOL *stop) {
@@ -75,6 +86,9 @@ - (void)run {
if (!_valid) {
return [self _failWithError:_error];
}
+ if (_skip) {
+ return [self _failWithError:[NSError errorWithDomain:@"com.livereload.tests" code:1 userInfo:@{NSLocalizedDescriptionKey:@"Legacy mode not supported"}]];
+ }
for (LRTestOutputFile *outputFile in _outputFiles) {
[outputFile removeOutputFile];
View
24 mac/LiveReload.xcodeproj/project.pbxproj
@@ -181,7 +181,7 @@
436D735E173E1B3A00F78A23 /* CustomRubyInstance.m in Sources */ = {isa = PBXBuildFile; fileRef = 436D735D173E1B3A00F78A23 /* CustomRubyInstance.m */; };
4371095218585DB800FCB4C2 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 434BB29F17BBF512000BEB1C /* XCTest.framework */; };
4371095818585DB800FCB4C2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4371095618585DB800FCB4C2 /* InfoPlist.strings */; };
- 4371095A18585DB800FCB4C2 /* LiveReloadTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4371095918585DB800FCB4C2 /* LiveReloadTests.m */; };
+ 4371095A18585DB800FCB4C2 /* LRCompilationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4371095918585DB800FCB4C2 /* LRCompilationTests.m */; };
43710964185864E400FCB4C2 /* LRTestDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 43710963185864E400FCB4C2 /* LRTestDriver.m */; };
437109671858651B00FCB4C2 /* LRTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 437109661858651B00FCB4C2 /* LRTest.m */; };
437109B3185879B300FCB4C2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 437109B2185879B300FCB4C2 /* Cocoa.framework */; };
@@ -262,6 +262,9 @@
43C611941803BDBD008A707E /* SandboxAccessModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C611931803BDBD008A707E /* SandboxAccessModel.m */; };
43C611971803CCF8008A707E /* ATScheduling.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C611961803CCF8008A707E /* ATScheduling.m */; };
43C6119A1803D537008A707E /* LRGlobals.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C611991803D537008A707E /* LRGlobals.m */; };
+ 43C927791879317D002372B7 /* LRIntegrationTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C927781879317D002372B7 /* LRIntegrationTestCase.m */; };
+ 43C9277C187931B1002372B7 /* ATAsyncTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C9277B187931B1002372B7 /* ATAsyncTestCase.m */; };
+ 43C9277E187932A9002372B7 /* LRLegacyCompilationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C9277D187932A9002372B7 /* LRLegacyCompilationTests.m */; };
43CDCF8D17C6082A007B22D9 /* ATAttributedStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 43CDCF8C17C6082A007B22D9 /* ATAttributedStringAdditions.m */; };
43CDCF9017C70A94007B22D9 /* FSChange.m in Sources */ = {isa = PBXBuildFile; fileRef = 43CDCF8F17C70A94007B22D9 /* FSChange.m */; };
43DB9FD4178EDF2E007BEA36 /* Errors.m in Sources */ = {isa = PBXBuildFile; fileRef = 43DB9FD3178EDF2E007BEA36 /* Errors.m */; };
@@ -667,7 +670,7 @@
4371095118585DB800FCB4C2 /* LiveReloadTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LiveReloadTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4371095518585DB800FCB4C2 /* LiveReloadTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LiveReloadTests-Info.plist"; sourceTree = "<group>"; };
4371095718585DB800FCB4C2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- 4371095918585DB800FCB4C2 /* LiveReloadTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LiveReloadTests.m; sourceTree = "<group>"; };
+ 4371095918585DB800FCB4C2 /* LRCompilationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LRCompilationTests.m; sourceTree = "<group>"; };
4371095B18585DB800FCB4C2 /* LiveReloadTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LiveReloadTests-Prefix.pch"; sourceTree = "<group>"; };
43710962185864E400FCB4C2 /* LRTestDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LRTestDriver.h; sourceTree = "<group>"; };
43710963185864E400FCB4C2 /* LRTestDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LRTestDriver.m; sourceTree = "<group>"; };
@@ -806,6 +809,11 @@
43C611961803CCF8008A707E /* ATScheduling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATScheduling.m; sourceTree = "<group>"; };
43C611981803D537008A707E /* LRGlobals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LRGlobals.h; sourceTree = "<group>"; };
43C611991803D537008A707E /* LRGlobals.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LRGlobals.m; sourceTree = "<group>"; };
+ 43C927771879317D002372B7 /* LRIntegrationTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LRIntegrationTestCase.h; sourceTree = "<group>"; };
+ 43C927781879317D002372B7 /* LRIntegrationTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LRIntegrationTestCase.m; sourceTree = "<group>"; };
+ 43C9277A187931B1002372B7 /* ATAsyncTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATAsyncTestCase.h; sourceTree = "<group>"; };
+ 43C9277B187931B1002372B7 /* ATAsyncTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATAsyncTestCase.m; sourceTree = "<group>"; };
+ 43C9277D187932A9002372B7 /* LRLegacyCompilationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LRLegacyCompilationTests.m; sourceTree = "<group>"; };
43CDCF8B17C6082A007B22D9 /* ATAttributedStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATAttributedStringAdditions.h; sourceTree = "<group>"; };
43CDCF8C17C6082A007B22D9 /* ATAttributedStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATAttributedStringAdditions.m; sourceTree = "<group>"; };
43CDCF8E17C70A94007B22D9 /* FSChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSChange.h; sourceTree = "<group>"; };
@@ -1626,7 +1634,12 @@
isa = PBXGroup;
children = (
430ABDF0186BF1EA00407561 /* LRPathProcessingTests.m */,
- 4371095918585DB800FCB4C2 /* LiveReloadTests.m */,
+ 43C9277A187931B1002372B7 /* ATAsyncTestCase.h */,
+ 43C9277B187931B1002372B7 /* ATAsyncTestCase.m */,
+ 43C927771879317D002372B7 /* LRIntegrationTestCase.h */,
+ 43C927781879317D002372B7 /* LRIntegrationTestCase.m */,
+ 4371095918585DB800FCB4C2 /* LRCompilationTests.m */,
+ 43C9277D187932A9002372B7 /* LRLegacyCompilationTests.m */,
4371095418585DB800FCB4C2 /* Supporting Files */,
);
path = LiveReloadTests;
@@ -2360,8 +2373,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 4371095A18585DB800FCB4C2 /* LiveReloadTests.m in Sources */,
+ 4371095A18585DB800FCB4C2 /* LRCompilationTests.m in Sources */,
+ 43C927791879317D002372B7 /* LRIntegrationTestCase.m in Sources */,
430ABDF1186BF1EA00407561 /* LRPathProcessingTests.m in Sources */,
+ 43C9277E187932A9002372B7 /* LRLegacyCompilationTests.m in Sources */,
+ 43C9277C187931B1002372B7 /* ATAsyncTestCase.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
4 mac/LiveReloadTestProjects/coffeescript_literate/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.litcoffee": true
},
View
4 mac/LiveReloadTestProjects/coffeescript_literate_md/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.coffee.md": true
},
View
4 mac/LiveReloadTestProjects/coffeescript_simple/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.coffee": true
},
View
9 mac/LiveReloadTestProjects/eco_simple/livereload-test.json
@@ -9,6 +9,15 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true,
+ "compilers": {
+ "eco": {
+ "enabled2": true
+ }
+ }
+ },
+
"sources": {
"test.eco": true
},
View
9 mac/LiveReloadTestProjects/haml_simple/livereload-test.json
@@ -9,6 +9,15 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true,
+ "compilers": {
+ "haml": {
+ "enabled2": true
+ }
+ }
+ },
+
"sources": {
"test.haml": true
},
View
4 mac/LiveReloadTestProjects/icedcoffeescript_literate/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.litcoffee": true
},
View
4 mac/LiveReloadTestProjects/icedcoffeescript_literate_md/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.coffee.md": true
},
View
4 mac/LiveReloadTestProjects/icedcoffeescript_simple/livereload-test.json
@@ -10,6 +10,10 @@
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.iced": true
},
View
9 mac/LiveReloadTestProjects/jade_filter_markdown/livereload-test.json
@@ -9,6 +9,15 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true,
+ "compilers": {
+ "jade": {
+ "enabled2": true
+ }
+ }
+ },
+
"sources": {
"test.jade": true
},
View
9 mac/LiveReloadTestProjects/jade_simple/livereload-test.json
@@ -9,6 +9,15 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true,
+ "compilers": {
+ "jade": {
+ "enabled2": true
+ }
+ }
+ },
+
"sources": {
"test.jade": true
},
View
4 mac/LiveReloadTestProjects/less_imports/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.less": true,
"imported.less": true
View
4 mac/LiveReloadTestProjects/less_imports_reference/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.less": true,
"imported.less": true
View
4 mac/LiveReloadTestProjects/less_simple/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.less": true
},
View
4 mac/LiveReloadTestProjects/less_version_5/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.less": true
},
View
4 mac/LiveReloadTestProjects/sass_indented/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.sass": true
},
View
4 mac/LiveReloadTestProjects/sass_simple/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.scss": true
},
View
9 mac/LiveReloadTestProjects/slim_simple/livereload-test.json
@@ -9,6 +9,15 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true,
+ "compilers": {
+ "slim": {
+ "enabled2": true
+ }
+ }
+ },
+
"sources": {
"test.slim": true
},
View
11 mac/LiveReloadTestProjects/stylus_nib/livereload-test.json
@@ -12,6 +12,17 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true,
+ "compilers": {
+ "stylus": {
+ "options": {
+ "use-nib": 1
+ }
+ }
+ }
+ },
+
"sources": {
"test.styl": true
},
View
4 mac/LiveReloadTestProjects/stylus_simple/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.styl": true
},
View
4 mac/LiveReloadTestProjects/typescript_simple/livereload-test.json
@@ -9,6 +9,10 @@
]
},
+ "2x-settings": {
+ "legacyCompilationEnabled": true
+ },
+
"sources": {
"test.ts": true
},
View
12 mac/LiveReloadTests/ATAsyncTestCase.h
@@ -0,0 +1,12 @@
+
+#import <XCTest/XCTest.h>
+
+
+@interface XCTestCase (ATAsyncTest)
+
+- (void)waitWithTimeout:(NSTimeInterval)timeout;
+- (void)waitForCondition:(BOOL(^)())conditionBlock withTimeout:(NSTimeInterval)timeout;
+- (dispatch_block_t)completionBlock;
+- (void)done;
+
+@end
View
41 mac/LiveReloadTests/ATAsyncTestCase.m
@@ -0,0 +1,41 @@
+
+#import "ATAsyncTestCase.h"
+
+
+@implementation XCTestCase (ATAsyncTest)
+
+static volatile BOOL _ATAsyncTest_done;
+
+- (void)waitForCondition:(BOOL(^)())conditionBlock withTimeout:(NSTimeInterval)timeout {
+ NSDate *cutoff = [NSDate dateWithTimeIntervalSinceNow:timeout];
+ while (!conditionBlock() && [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:cutoff])
+ NSLog(@"Still waiting...");
+ if (!conditionBlock()) {
+ NSAssert([[NSDate date] compare:cutoff] == NSOrderedAscending, @"Timeout");
+ }
+}
+
+- (void)waitWithTimeout:(NSTimeInterval)timeout {
+ _ATAsyncTest_done = NO;
+ NSDate *cutoff = [NSDate dateWithTimeIntervalSinceNow:timeout];
+ while (!_ATAsyncTest_done && [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:cutoff])
+ NSLog(@"Still waiting...");
+ if (!_ATAsyncTest_done) {
+ NSAssert([[NSDate date] compare:cutoff] == NSOrderedAscending, @"Timeout");
+ }
+}
+
+- (dispatch_block_t)completionBlock {
+ return ^{
+ [self done];
+ };
+}
+
+- (void)done {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ _ATAsyncTest_done = YES;
+ });
+}
+
+
+@end
View
88 mac/LiveReloadTests/LRCompilationTests.m
@@ -0,0 +1,88 @@
+
+#import "LRIntegrationTestCase.h"
+
+
+@interface LRCompilationTests : LRIntegrationTestCase
+
+@end
+
+
+@implementation LRCompilationTests
+
+- (void)testHamlSimple {
+ XCTAssertNil([self runProjectTestNamed:@"haml_simple" options:LRTestOptionNone], @"Failed");
+}
+
+- (void)testLessSimple {
+ XCTAssertNil([self runProjectTestNamed:@"less_simple" options:LRTestOptionNone], @"Failed");
+}
+- (void)testLessImports {
+ XCTAssertNil([self runProjectTestNamed:@"less_imports" options:LRTestOptionNone], @"Failed");
+}
+- (void)testLessImportsReference {
+ XCTAssertNil([self runProjectTestNamed:@"less_imports_reference" options:LRTestOptionNone], @"Failed");
+}
+- (void)testLessVersion3 {
+ XCTAssertNil([self runProjectTestNamed:@"less_version_3" options:LRTestOptionNone], @"Failed");
+}
+- (void)testLessVersion4 {
+ XCTAssertNil([self runProjectTestNamed:@"less_version_4" options:LRTestOptionNone], @"Failed");
+}
+- (void)testLessVersion5 {
+ XCTAssertNil([self runProjectTestNamed:@"less_version_5" options:LRTestOptionNone], @"Failed");
+}
+
+- (void)testEcoSimple {
+ XCTAssertNil([self runProjectTestNamed:@"eco_simple" options:LRTestOptionNone], @"Failed");
+}
+
+- (void)testCoffeeScriptSimple {
+ XCTAssertNil([self runProjectTestNamed:@"coffeescript_simple" options:LRTestOptionNone], @"Failed");
+}
+- (void)testCoffeeScriptLiterate {
+ XCTAssertNil([self runProjectTestNamed:@"coffeescript_literate" options:LRTestOptionNone], @"Failed");
+}
+- (void)testCoffeeScriptLiterateMd {
+ XCTAssertNil([self runProjectTestNamed:@"coffeescript_literate_md" options:LRTestOptionNone], @"Failed");
+}
+
+- (void)testIcedCoffeeScriptSimple {
+ XCTAssertNil([self runProjectTestNamed:@"icedcoffeescript_simple" options:LRTestOptionNone], @"Failed");
+}
+- (void)testIcedCoffeeScriptLiterate {
+ XCTAssertNil([self runProjectTestNamed:@"icedcoffeescript_literate" options:LRTestOptionNone], @"Failed");
+}
+- (void)testIcedCoffeeScriptLiterateMd {
+ XCTAssertNil([self runProjectTestNamed:@"icedcoffeescript_literate_md" options:LRTestOptionNone], @"Failed");
+}
+
+- (void)testJadeSimple {
+ XCTAssertNil([self runProjectTestNamed:@"jade_simple" options:LRTestOptionNone], @"Failed");
+}
+- (void)testJadeFilterMarkdown {
+ XCTAssertNil([self runProjectTestNamed:@"jade_filter_markdown" options:LRTestOptionNone], @"Failed");
+}
+
+- (void)testSassSimple {
+ XCTAssertNil([self runProjectTestNamed:@"sass_simple" options:LRTestOptionNone], @"Failed");
+}
+- (void)testSassIndented {
+ XCTAssertNil([self runProjectTestNamed:@"sass_indented" options:LRTestOptionNone], @"Failed");
+}
+
+- (void)testSlimSimple {
+ XCTAssertNil([self runProjectTestNamed:@"slim_simple" options:LRTestOptionNone], @"Failed");
+}
+
+- (void)testStylusSimple {
+ XCTAssertNil([self runProjectTestNamed:@"stylus_simple" options:LRTestOptionNone], @"Failed");
+}
+- (void)testStylusNib {
+ XCTAssertNil([self runProjectTestNamed:@"stylus_nib" options:LRTestOptionNone], @"Failed");
+}
+
+- (void)testTypeScriptSimple {
+ XCTAssertNil([self runProjectTestNamed:@"typescript_simple" options:LRTestOptionNone], @"Failed");
+}
+
+@end
View
19 mac/LiveReloadTests/LRIntegrationTestCase.h
@@ -0,0 +1,19 @@
+
+#import <XCTest/XCTest.h>
+
+#import "LRTest.h"
+#import "LiveReloadAppDelegate.h"
+#import "AppState.h"
+#import "LRPackageManager.h"
+#import "PluginManager.h"
+#import "Plugin.h"
+#import "LRPackageContainer.h"
+
+#import "ATFunctionalStyle.h"
+
+
+@interface LRIntegrationTestCase : XCTestCase
+
+- (NSError *)runProjectTestNamed:(NSString *)name options:(LRTestOptions)options;
+
+@end
View
38 mac/LiveReloadTests/LRIntegrationTestCase.m
@@ -0,0 +1,38 @@
+
+#import "LRIntegrationTestCase.h"
+#import "ATAsyncTestCase.h"
+
+
+@interface LRIntegrationTestCase ()
+
+@end
+
+
+@implementation LRIntegrationTestCase {
+ NSURL *_baseFolderURL;
+}
+
+- (void)setUp {
+ [super setUp];
+
+ _baseFolderURL = [NSURL fileURLWithPath:[@"~/dev/livereload/devel/mac/LiveReloadTestProjects" stringByExpandingTildeInPath]];
+
+ NSLog(@"Waiting for initialization to finish...");
+ [self waitForCondition:^BOOL{
+ NSArray *packageContainers = [[PluginManager sharedPluginManager].plugins valueForKeyPath:@"@unionOfArrays.bundledPackageContainers"];
+ return (packageContainers.count > 0) && [packageContainers all:^BOOL(LRPackageContainer *container) {
+ return !container.updateInProgress;
+ }];
+ } withTimeout:3000];
+ NSLog(@"Initialization finished.");
+}
+
+- (NSError *)runProjectTestNamed:(NSString *)name options:(LRTestOptions)options {
+ LRTest *test = [[LRTest alloc] initWithFolderURL:[_baseFolderURL URLByAppendingPathComponent:name] options:options];
+ test.completionBlock = self.completionBlock;
+ [test run];
+ [self waitWithTimeout:3.0];
+ return test.error;
+}
+
+@end
View
81 mac/LiveReloadTests/LRLegacyCompilationTests.m
@@ -0,0 +1,81 @@
+
+#import "LRIntegrationTestCase.h"
+
+
+@interface LRLegacyCompilationTests : LRIntegrationTestCase
+@end
+
+
+@implementation LRLegacyCompilationTests
+
+- (void)testHamlSimple {
+ XCTAssertNil([self runProjectTestNamed:@"haml_simple" options:LRTestOptionLegacy], @"Failed");
+}
+
+- (void)testLessSimple {
+ XCTAssertNil([self runProjectTestNamed:@"less_simple" options:LRTestOptionLegacy], @"Failed");
+}
+- (void)testLessImports {
+ XCTAssertNil([self runProjectTestNamed:@"less_imports" options:LRTestOptionLegacy], @"Failed");
+}
+- (void)testLessImportsReference {
+ XCTAssertNil([self runProjectTestNamed:@"less_imports_reference" options:LRTestOptionLegacy], @"Failed");
+}
+- (void)testLessVersion5 {
+ XCTAssertNil([self runProjectTestNamed:@"less_version_5" options:LRTestOptionLegacy], @"Failed");
+}
+
+- (void)testEcoSimple {
+ XCTAssertNil([self runProjectTestNamed:@"eco_simple" options:LRTestOptionLegacy], @"Failed");
+}
+
+- (void)testCoffeeScriptSimple {
+ XCTAssertNil([self runProjectTestNamed:@"coffeescript_simple" options:LRTestOptionLegacy], @"Failed");
+}
+- (void)testCoffeeScriptLiterate {
+ XCTAssertNil([self runProjectTestNamed:@"coffeescript_literate" options:LRTestOptionLegacy], @"Failed");
+}
+- (void)XXXtestCoffeeScriptLiterateMd {
+ XCTAssertNil([self runProjectTestNamed:@"coffeescript_literate_md" options:LRTestOptionLegacy], @"Failed");
+}
+
+- (void)testIcedCoffeeScriptSimple {
+ XCTAssertNil([self runProjectTestNamed:@"icedcoffeescript_simple" options:LRTestOptionLegacy], @"Failed");
+}
+- (void)XXXtestIcedCoffeeScriptLiterate {
+ XCTAssertNil([self runProjectTestNamed:@"icedcoffeescript_literate" options:LRTestOptionLegacy], @"Failed");
+}
+- (void)XXXtestIcedCoffeeScriptLiterateMd {
+ XCTAssertNil([self runProjectTestNamed:@"icedcoffeescript_literate_md" options:LRTestOptionLegacy], @"Failed");
+}
+
+- (void)testJadeSimple {
+ XCTAssertNil([self runProjectTestNamed:@"jade_simple" options:LRTestOptionLegacy], @"Failed");
+}
+- (void)testJadeFilterMarkdown {
+ XCTAssertNil([self runProjectTestNamed:@"jade_filter_markdown" options:LRTestOptionLegacy], @"Failed");
+}
+
+- (void)testSassSimple {
+ XCTAssertNil([self runProjectTestNamed:@"sass_simple" options:LRTestOptionLegacy], @"Failed");
+}
+- (void)testSassIndented {
+ XCTAssertNil([self runProjectTestNamed:@"sass_indented" options:LRTestOptionLegacy], @"Failed");
+}
+
+- (void)testSlimSimple {
+ XCTAssertNil([self runProjectTestNamed:@"slim_simple" options:LRTestOptionLegacy], @"Failed");
+}
+
+- (void)testStylusSimple {
+ XCTAssertNil([self runProjectTestNamed:@"stylus_simple" options:LRTestOptionLegacy], @"Failed");
+}
+- (void)testStylusNib {
+ XCTAssertNil([self runProjectTestNamed:@"stylus_nib" options:LRTestOptionLegacy], @"Failed");
+}
+
+- (void)testTypeScriptSimple {
+ XCTAssertNil([self runProjectTestNamed:@"typescript_simple" options:LRTestOptionLegacy], @"Failed");
+}
+
+@end
View
184 mac/LiveReloadTests/LiveReloadTests.m
@@ -1,184 +0,0 @@
-//
-// LiveReloadTests.m
-// LiveReloadTests
-//
-// Created by Andrey Tarantsov on 11.12.2013.
-//
-//
-
-#import <XCTest/XCTest.h>
-
-#import "LRTest.h"
-#import "LiveReloadAppDelegate.h"
-#import "AppState.h"
-#import "LRPackageManager.h"
-#import "PluginManager.h"
-#import "Plugin.h"
-#import "LRPackageContainer.h"
-
-#import "ATFunctionalStyle.h"
-
-
-@interface XCTestCase (ATAsyncTest)
-
-- (void)waitWithTimeout:(NSTimeInterval)timeout;
-- (void)done;
-
-@end
-
-@implementation XCTestCase (ATAsyncTest)
-
-static volatile BOOL _ATAsyncTest_done;
-
-- (void)waitForCondition:(BOOL(^)())conditionBlock withTimeout:(NSTimeInterval)timeout {
- NSDate *cutoff = [NSDate dateWithTimeIntervalSinceNow:timeout];
- while (!conditionBlock() && [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:cutoff])
- NSLog(@"Still waiting...");
- if (!conditionBlock()) {
- NSAssert([[NSDate date] compare:cutoff] == NSOrderedAscending, @"Timeout");
- }
-}
-
-- (void)waitWithTimeout:(NSTimeInterval)timeout {
- _ATAsyncTest_done = NO;
- NSDate *cutoff = [NSDate dateWithTimeIntervalSinceNow:timeout];
- while (!_ATAsyncTest_done && [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:cutoff])
- NSLog(@"Still waiting...");
- if (!_ATAsyncTest_done) {
- NSAssert([[NSDate date] compare:cutoff] == NSOrderedAscending, @"Timeout");
- }
-}
-
-- (dispatch_block_t)completionBlock {
- return ^{
- [self done];
- };
-}
-
-- (void)done {
- dispatch_async(dispatch_get_main_queue(), ^{
- _ATAsyncTest_done = YES;
- });
-}
-
-
-@end
-
-
-@interface LiveReloadTests : XCTestCase
-
-@end
-
-
-@implementation LiveReloadTests {
- NSURL *_baseFolderURL;
-}
-
-+ (void)setUp {
- [super setUp];
-}
-
-- (void)setUp {
- [super setUp];
-
- _baseFolderURL = [NSURL fileURLWithPath:[@"~/dev/livereload/devel/mac/LiveReloadTestProjects" stringByExpandingTildeInPath]];
-
- NSLog(@"Waiting for initialization to finish...");
- [self waitForCondition:^BOOL{
- NSArray *packageContainers = [[PluginManager sharedPluginManager].plugins valueForKeyPath:@"@unionOfArrays.bundledPackageContainers"];
- return (packageContainers.count > 0) && [packageContainers all:^BOOL(LRPackageContainer *container) {
- return !container.updateInProgress;
- }];
- } withTimeout:3000];
- NSLog(@"Initialization finished.");
-}
-
-- (void)tearDown {
- [super tearDown];
-}
-
-- (NSError *)runProjectTestNamed:(NSString *)name {
- LRTest *test = [[LRTest alloc] initWithFolderURL:[_baseFolderURL URLByAppendingPathComponent:name]];
- test.completionBlock = self.completionBlock;
- [test run];
- [self waitWithTimeout:3.0];
- return test.error;
-}
-
-- (void)testHamlSimple {
- XCTAssertNil([self runProjectTestNamed:@"haml_simple"], @"Failed");
-}
-
-- (void)testLessSimple {
- XCTAssertNil([self runProjectTestNamed:@"less_simple"], @"Failed");
-}
-- (void)testLessImports {
- XCTAssertNil([self runProjectTestNamed:@"less_imports"], @"Failed");
-}
-- (void)testLessImportsReference {
- XCTAssertNil([self runProjectTestNamed:@"less_imports_reference"], @"Failed");
-}
-- (void)testLessVersion3 {
- XCTAssertNil([self runProjectTestNamed:@"less_version_3"], @"Failed");
-}
-- (void)testLessVersion4 {
- XCTAssertNil([self runProjectTestNamed:@"less_version_4"], @"Failed");
-}
-- (void)testLessVersion5 {
- XCTAssertNil([self runProjectTestNamed:@"less_version_5"], @"Failed");
-}
-
-- (void)testEcoSimple {
- XCTAssertNil([self runProjectTestNamed:@"eco_simple"], @"Failed");
-}
-
-- (void)testCoffeeScriptSimple {
- XCTAssertNil([self runProjectTestNamed:@"coffeescript_simple"], @"Failed");
-}
-- (void)testCoffeeScriptLiterate {
- XCTAssertNil([self runProjectTestNamed:@"coffeescript_literate"], @"Failed");
-}
-- (void)testCoffeeScriptLiterateMd {
- XCTAssertNil([self runProjectTestNamed:@"coffeescript_literate_md"], @"Failed");
-}
-
-- (void)testIcedCoffeeScriptSimple {
- XCTAssertNil([self runProjectTestNamed:@"icedcoffeescript_simple"], @"Failed");
-}
-- (void)testIcedCoffeeScriptLiterate {
- XCTAssertNil([self runProjectTestNamed:@"icedcoffeescript_literate"], @"Failed");
-}
-- (void)testIcedCoffeeScriptLiterateMd {
- XCTAssertNil([self runProjectTestNamed:@"icedcoffeescript_literate_md"], @"Failed");
-}
-
-- (void)testJadeSimple {
- XCTAssertNil([self runProjectTestNamed:@"jade_simple"], @"Failed");
-}
-- (void)testJadeFilterMarkdown {
- XCTAssertNil([self runProjectTestNamed:@"jade_filter_markdown"], @"Failed");
-}
-
-- (void)testSassSimple {
- XCTAssertNil([self runProjectTestNamed:@"sass_simple"], @"Failed");
-}
-- (void)testSassIndented {
- XCTAssertNil([self runProjectTestNamed:@"sass_indented"], @"Failed");
-}
-
-- (void)testSlimSimple {
- XCTAssertNil([self runProjectTestNamed:@"slim_simple"], @"Failed");
-}
-
-- (void)testStylusSimple {
- XCTAssertNil([self runProjectTestNamed:@"stylus_simple"], @"Failed");
-}
-- (void)testStylusNib {
- XCTAssertNil([self runProjectTestNamed:@"stylus_nib"], @"Failed");
-}
-
-- (void)testTypeScriptSimple {
- XCTAssertNil([self runProjectTestNamed:@"typescript_simple"], @"Failed");
-}
-
-@end
2  plugins
@@ -1 +1 @@
-Subproject commit 5d433fd891eb1dcb2374472aeee16181f83ca1af
+Subproject commit 8a4700cb7cefd3c68d20750d01f03c0c547ecd0d
Please sign in to comment.
Something went wrong with that request. Please try again.