Skip to content
Permalink
Browse files

Add unit tests, remove company and author names, add travis.yml

  • Loading branch information...
sdgandhi committed Sep 29, 2015
1 parent a2344a1 commit 292ff35f93ba2ea22bf3d7f1df7771522043b70a
Showing with 340 additions and 80 deletions.
  1. +7 −0 .travis.yml
  2. +2 −1 README.md
  3. +20 −14 SYNQueue/SYNQueue.xcodeproj/project.pbxproj
  4. +4 −0 SYNQueue/SYNQueue.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  5. +22 −0 ...eddata/xcbaselines/9F6202351B333AAF0026CE2C.xcbaseline/24523CEE-5CA3-4AAB-A970-50D68B159D1F.plist
  6. +40 −0 SYNQueue/SYNQueue.xcodeproj/xcshareddata/xcbaselines/9F6202351B333AAF0026CE2C.xcbaseline/Info.plist
  7. +7 −3 SYNQueue/SYNQueue.xcodeproj/xcshareddata/xcschemes/SYNQueue.xcscheme
  8. +57 −0 SYNQueue/SYNQueue.xcodeproj/xcshareddata/xcschemes/SYNQueueTests.xcscheme
  9. +1 −1 SYNQueue/SYNQueue/Info.plist
  10. +0 −3 SYNQueue/SYNQueue/NSDate+Utils.swift
  11. +0 −3 SYNQueue/SYNQueue/SYNQueue.h
  12. +0 −3 SYNQueue/SYNQueue/SYNQueue.swift
  13. +0 −3 SYNQueue/SYNQueue/SYNQueueTask.swift
  14. +4 −3 SYNQueue/SYNQueue/Utils.swift
  15. +24 −0 SYNQueue/SYNQueueTests/ConsoleLogger.swift
  16. +1 −1 SYNQueue/SYNQueueTests/Info.plist
  17. +59 −0 SYNQueue/SYNQueueTests/NSUserDefaultsSerializer.swift
  18. +89 −10 SYNQueue/SYNQueueTests/SYNQueueTests.swift
  19. +0 −8 SYNQueueDemo/SYNQueueDemo.xcodeproj/project.pbxproj
  20. +0 −3 SYNQueueDemo/SYNQueueDemo/AppDelegate.swift
  21. +1 −1 SYNQueueDemo/SYNQueueDemo/Base.lproj/LaunchScreen.xib
  22. +0 −3 SYNQueueDemo/SYNQueueDemo/ConsoleLogger.swift
  23. +1 −1 SYNQueueDemo/SYNQueueDemo/Info.plist
  24. +0 −3 SYNQueueDemo/SYNQueueDemo/NSUserDefaultsSerializer.swift
  25. +0 −3 SYNQueueDemo/SYNQueueDemo/SettingsViewController.swift
  26. +0 −3 SYNQueueDemo/SYNQueueDemo/TaskCell.swift
  27. +0 −3 SYNQueueDemo/SYNQueueDemo/Utils.swift
  28. +0 −3 SYNQueueDemo/SYNQueueDemo/ViewController.swift
  29. +1 −1 SYNQueueDemo/SYNQueueDemoTests/Info.plist
  30. +0 −3 SYNQueueDemo/SYNQueueDemoTests/SYNQueueDemoTests.swift
@@ -0,0 +1,7 @@
language: objective-c
osx_image: xcode7
xcode_workspace: SYNQueue.xcworkspace
xcode_scheme: SYNQueueTests

script:
- xctool test -workspace SYNQueue.xcworkspace -scheme SYNQueueTests -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
@@ -5,7 +5,8 @@
<em>A simple yet powerful queueing system for iOS (with persistence).</em>
<br>
<br>
<img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat">
<img title="Carthage compatible" src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat">
<img title="Build status" src="https://travis-ci.org/THREDOpenSource/SYNQueue.svg">
</div>

##Overview
@@ -8,12 +8,15 @@

/* Begin PBXBuildFile section */
9F6202311B333AAF0026CE2C /* SYNQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F6202301B333AAF0026CE2C /* SYNQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
9F6202371B333AAF0026CE2C /* SYNQueue.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F62022B1B333AAF0026CE2C /* SYNQueue.framework */; };
9F62023E1B333AAF0026CE2C /* SYNQueueTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F62023D1B333AAF0026CE2C /* SYNQueueTests.swift */; };
9FD63F871B333B81001BD09A /* SYNQueueTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FD63F861B333B81001BD09A /* SYNQueueTask.swift */; };
9FD63FBD1B3342C6001BD09A /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FD63FBC1B3342C6001BD09A /* Utils.swift */; };
9FD63FBF1B334316001BD09A /* NSDate+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FD63FBE1B334316001BD09A /* NSDate+Utils.swift */; };
9FD63FC11B335579001BD09A /* SYNQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FD63FC01B335579001BD09A /* SYNQueue.swift */; };
DCD110DA1BBA166B003AF0F0 /* ConsoleLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD110D81BBA166B003AF0F0 /* ConsoleLogger.swift */; settings = {ASSET_TAGS = (); }; };
DCD110DB1BBA166B003AF0F0 /* NSUserDefaultsSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD110D91BBA166B003AF0F0 /* NSUserDefaultsSerializer.swift */; settings = {ASSET_TAGS = (); }; };
DCD110E01BBA2F1E003AF0F0 /* SYNQueue.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F62022B1B333AAF0026CE2C /* SYNQueue.framework */; };
DCD110E21BBA2FB0003AF0F0 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD110E11BBA2FB0003AF0F0 /* Utils.swift */; settings = {ASSET_TAGS = (); }; };
DCD110E31BBA2FBC003AF0F0 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD110E11BBA2FB0003AF0F0 /* Utils.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
@@ -34,9 +37,11 @@
9F62023C1B333AAF0026CE2C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9F62023D1B333AAF0026CE2C /* SYNQueueTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SYNQueueTests.swift; sourceTree = "<group>"; };
9FD63F861B333B81001BD09A /* SYNQueueTask.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SYNQueueTask.swift; sourceTree = "<group>"; };
9FD63FBC1B3342C6001BD09A /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
9FD63FBE1B334316001BD09A /* NSDate+Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSDate+Utils.swift"; sourceTree = "<group>"; };
9FD63FC01B335579001BD09A /* SYNQueue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SYNQueue.swift; sourceTree = "<group>"; };
DCD110D81BBA166B003AF0F0 /* ConsoleLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConsoleLogger.swift; sourceTree = "<group>"; };
DCD110D91BBA166B003AF0F0 /* NSUserDefaultsSerializer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSUserDefaultsSerializer.swift; sourceTree = "<group>"; };
DCD110E11BBA2FB0003AF0F0 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
@@ -51,7 +56,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9F6202371B333AAF0026CE2C /* SYNQueue.framework in Frameworks */,
DCD110E01BBA2F1E003AF0F0 /* SYNQueue.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -84,7 +89,7 @@
9F6202301B333AAF0026CE2C /* SYNQueue.h */,
9FD63FC01B335579001BD09A /* SYNQueue.swift */,
9FD63F861B333B81001BD09A /* SYNQueueTask.swift */,
9FD63FBC1B3342C6001BD09A /* Utils.swift */,
DCD110E11BBA2FB0003AF0F0 /* Utils.swift */,
);
path = SYNQueue;
sourceTree = "<group>";
@@ -109,6 +114,8 @@
9F62023B1B333AAF0026CE2C /* Supporting Files */ = {
isa = PBXGroup;
children = (
DCD110D81BBA166B003AF0F0 /* ConsoleLogger.swift */,
DCD110D91BBA166B003AF0F0 /* NSUserDefaultsSerializer.swift */,
9F62023C1B333AAF0026CE2C /* Info.plist */,
);
name = "Supporting Files";
@@ -226,14 +233,17 @@
9FD63FC11B335579001BD09A /* SYNQueue.swift in Sources */,
9FD63F871B333B81001BD09A /* SYNQueueTask.swift in Sources */,
9FD63FBF1B334316001BD09A /* NSDate+Utils.swift in Sources */,
9FD63FBD1B3342C6001BD09A /* Utils.swift in Sources */,
DCD110E21BBA2FB0003AF0F0 /* Utils.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9F6202321B333AAF0026CE2C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DCD110E31BBA2FBC003AF0F0 /* Utils.swift in Sources */,
DCD110DB1BBA166B003AF0F0 /* NSUserDefaultsSerializer.swift in Sources */,
DCD110DA1BBA166B003AF0F0 /* ConsoleLogger.swift in Sources */,
9F62023E1B333AAF0026CE2C /* SYNQueueTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -347,6 +357,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = SYNQueue/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -366,6 +377,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = SYNQueue/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -378,10 +390,7 @@
9F6202451B333AAF0026CE2C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
ENABLE_TESTABILITY = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -395,10 +404,7 @@
9F6202461B333AAF0026CE2C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
ENABLE_TESTABILITY = NO;
INFOPLIST_FILE = SYNQueueTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>classNames</key>
<dict>
<key>SYNQueueTests</key>
<dict>
<key>testEnqueuingPerformance()</key>
<dict>
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>0.00045437</real>
<key>baselineIntegrationDisplayName</key>
<string>Local Baseline</string>
</dict>
</dict>
</dict>
</dict>
</dict>
</plist>
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>runDestinationsByUUID</key>
<dict>
<key>24523CEE-5CA3-4AAB-A970-50D68B159D1F</key>
<dict>
<key>localComputer</key>
<dict>
<key>busSpeedInMHz</key>
<integer>100</integer>
<key>cpuCount</key>
<integer>1</integer>
<key>cpuKind</key>
<string>Intel Core i7</string>
<key>cpuSpeedInMHz</key>
<integer>1700</integer>
<key>logicalCPUCoresPerPackage</key>
<integer>4</integer>
<key>modelCode</key>
<string>MacBookAir6,2</string>
<key>physicalCPUCoresPerPackage</key>
<integer>2</integer>
<key>platformIdentifier</key>
<string>com.apple.platform.macosx</string>
</dict>
<key>targetArchitecture</key>
<string>i386</string>
<key>targetDevice</key>
<dict>
<key>modelCode</key>
<string>iPhone5,1</string>
<key>platformIdentifier</key>
<string>com.apple.platform.iphonesimulator</string>
</dict>
</dict>
</dict>
</dict>
</plist>
@@ -37,10 +37,11 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
@@ -62,15 +63,18 @@
ReferencedContainer = "container:SYNQueue.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
@@ -85,10 +89,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9F6202351B333AAF0026CE2C"
BuildableName = "SYNQueueTests.xctest"
BlueprintName = "SYNQueueTests"
ReferencedContainer = "container:SYNQueue.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.syntertainment.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>com.SYNQueue.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -2,9 +2,6 @@
// NSDate+Utils.swift
// SYNQueue
//
// Created by John Hurliman on 6/18/15.
// Copyright (c) 2015 Syntertainment. All rights reserved.
//
import Foundation

@@ -2,9 +2,6 @@
// SYNQueue.h
// SYNQueue
//
// Created by John Hurliman on 6/18/15.
// Copyright (c) 2015 Syntertainment. All rights reserved.
//

#import <Foundation/Foundation.h>

@@ -2,9 +2,6 @@
// SYNQueue.swift
// SYNQueue
//
// Created by John Hurliman on 6/18/15.
// Copyright (c) 2015 Syntertainment. All rights reserved.
//
import Foundation

@@ -2,9 +2,6 @@
// SYNQueueTask.swift
// SYNQueue
//
// Created by John Hurliman on 6/18/15.
// Copyright (c) 2015 Syntertainment. All rights reserved.
//
import Foundation

@@ -2,9 +2,6 @@
// Utils.swift
// SYNQueue
//
// Created by John Hurliman on 6/18/15.
// Copyright (c) 2015 Syntertainment. All rights reserved.
//
import Foundation

@@ -19,6 +16,10 @@ func synced(lock: AnyObject, closure: () -> ()) {
objc_sync_exit(lock)
}

func runOnMainThread(callback:dispatch_block_t) {
dispatch_async(dispatch_get_main_queue(), callback)
}

func toJSON(obj: AnyObject) throws -> String? {
let json = try NSJSONSerialization.dataWithJSONObject(obj, options: [])
return NSString(data: json, encoding: NSUTF8StringEncoding) as String?

0 comments on commit 292ff35

Please sign in to comment.
You can’t perform that action at this time.