-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
conf: Move examples to become tests (#42)
* Add initial CoreGraphics Renderer code * chor: Update Examples * feat: Add patterns to QuartzRenderer and fix offset bug in QuartzRenderer and SVG Renderer * rfac: Add code for iOS * rfac: Update Package.swift to build in Linux * Add .swiftpm directory to gitignore * Move examples to a single, executable product * Actually, let's just straight-up move these to be tests * - Turn the examples in to actual test-cases (although they do not yet compare with the reference images, so always pass) - Clean up warnings (mostly turning 'var's in to 'let's) - Ensure output directory is created by the test-case setup function * Add test target to linux, fix casing for test target * Move CFreeType system dependency in to the package itself * Update README
- Loading branch information
1 parent
a0fe255
commit 852f4b3
Showing
146 changed files
with
1,927 additions
and
757 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import XCTest | ||
|
||
import swiftplotTests | ||
import SwiftPlotTests | ||
|
||
var tests = [XCTestCaseEntry]() | ||
tests += swiftplotTests.allTests() | ||
tests += SwiftPlotTests.__allTests() | ||
|
||
XCTMain(tests) |
37 changes: 37 additions & 0 deletions
37
Tests/SwiftPlotTests/BarChart/barchart-hatched-backwardslash.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import SwiftPlot | ||
import AGGRenderer | ||
import SVGRenderer | ||
#if canImport(QuartzRenderer) | ||
import QuartzRenderer | ||
#endif | ||
|
||
extension BarchartTests { | ||
|
||
func testBarchartHatchedBackslash() { | ||
|
||
let fileName = "_11_bar_chart_backward_slash_hatched" | ||
|
||
let x:[String] = ["2008","2009","2010","2011"] | ||
let y:[Float] = [320,-100,420,500] | ||
|
||
let agg_renderer = AGGRenderer() | ||
let svg_renderer = SVGRenderer() | ||
#if canImport(QuartzRenderer) | ||
let quartz_renderer = QuartzRenderer() | ||
#endif | ||
|
||
let barGraph = BarGraph<String,Float>(enableGrid: true) | ||
barGraph.addSeries(x, y, label: "Plot 1", color: .orange, hatchPattern: .backwardSlash) | ||
barGraph.plotTitle = PlotTitle("HATCHED BAR CHART") | ||
barGraph.plotLabel = PlotLabel(xLabel: "X-AXIS", yLabel: "Y-AXIS") | ||
|
||
barGraph.drawGraphAndOutput(fileName: self.aggOutputDirectory+fileName, | ||
renderer: agg_renderer) | ||
barGraph.drawGraphAndOutput(fileName: self.svgOutputDirectory+fileName, | ||
renderer: svg_renderer) | ||
#if canImport(QuartzRenderer) | ||
barGraph.drawGraphAndOutput(fileName: self.coreGraphicsOutputDirectory+fileName, | ||
renderer: quartz_renderer) | ||
#endif | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
Tests/SwiftPlotTests/BarChart/barchart-hatched-cross.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import SwiftPlot | ||
import AGGRenderer | ||
import SVGRenderer | ||
#if canImport(QuartzRenderer) | ||
import QuartzRenderer | ||
#endif | ||
|
||
extension BarchartTests { | ||
|
||
func testBarchartHatchedCross() { | ||
|
||
let fileName = "_15_bar_chart_cross_hatched" | ||
|
||
let x:[String] = ["2008","2009","2010","2011"] | ||
let y:[Float] = [320,-100,420,500] | ||
|
||
let agg_renderer = AGGRenderer() | ||
let svg_renderer = SVGRenderer() | ||
#if canImport(QuartzRenderer) | ||
let quartz_renderer = QuartzRenderer() | ||
#endif | ||
|
||
let barGraph = BarGraph<String,Float>(enableGrid: true) | ||
barGraph.addSeries(x, y, label: "Plot 1", color: .orange, hatchPattern: .cross) | ||
barGraph.plotTitle = PlotTitle("HATCHED BAR CHART") | ||
barGraph.plotLabel = PlotLabel(xLabel: "X-AXIS", yLabel: "Y-AXIS") | ||
|
||
barGraph.drawGraphAndOutput(fileName: self.aggOutputDirectory+fileName, | ||
renderer: agg_renderer) | ||
barGraph.drawGraphAndOutput(fileName: self.svgOutputDirectory+fileName, | ||
renderer: svg_renderer) | ||
#if canImport(QuartzRenderer) | ||
barGraph.drawGraphAndOutput(fileName: self.coreGraphicsOutputDirectory+fileName, | ||
renderer: quartz_renderer) | ||
#endif | ||
} | ||
} |
Oops, something went wrong.