This repository has been archived by the owner on Nov 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preliminary Magick++ (ImageMagick7 support).
Note: ImageMagick binary must be installed. Magick++.h header will be found in the system include path under ImageMagick-7. Unfortunately sub-includes expect the the ImageMagick-7 folder to be a part of the compiler search list. Remedied with -I switch in root CMakeLists.txt file :(. Temporarily had to hard-code OS X/Linux system include path :(:(. Strict warnings disabled temporarily because tinyutf8 cannot compile under ultra-strict settings. Laxifying #pragmas having no effect. :(:(:(.
- Loading branch information
bRad
committed
Feb 4, 2017
1 parent
640dc92
commit 4958cd9
Showing
16 changed files
with
83 additions
and
51 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 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(THIRD_PARTY_SOURCE_FILES | ||
../3rdParty/tinyutf8/tinyutf8.cpp | ||
../3rdParty/tinyutf8/tinyutf8.h | ||
PARENT_SCOPE) |
Submodule ImageMagick
deleted from
eea078
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,2 +1,4 @@ | ||
add_subdirectory(CppGrapher) | ||
add_subdirectory(3rdParty) | ||
add_subdirectory(cpp-grapher) | ||
add_subdirectory(CppGrapher) | ||
add_subdirectory(Helpers) |
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,23 +1,17 @@ | ||
|
||
set(SOURCE_FILES | ||
CppGrapher.cpp | ||
CppGrapher.h | ||
Validation/Argument.cpp | ||
Validation/DataFile.cpp | ||
Graphing/Visualization.cpp | ||
../3rdParty/tinyutf8/tinyutf8.cpp | ||
../3rdParty/tinyutf8/tinyutf8.h | ||
../Helpers/Unicode.h | ||
) | ||
${THIRD_PARTY_SOURCE_FILES} | ||
${HELPERS_SOURCE_FILES}) | ||
|
||
add_library(CppGrapher ${SOURCE_FILES}) | ||
|
||
target_include_directories(CppGrapher | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/any/ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/ImageMagick/Magick++/lib/ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/Optional/ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/tinyutf8/ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/variant/ | ||
) | ||
target_include_directories(CppGrapher PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/ | ||
${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/any/ | ||
${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/Optional/ | ||
${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/tinyutf8/ | ||
${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/variant/) |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(GRAPHING_SOURCE_FILES | ||
Graphing/Visualization.cpp | ||
PARENT_SCOPE) | ||
|
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,4 @@ | ||
set(VALIDATION_SOURCE_FILES | ||
Validation/Argument.cpp | ||
Validation/DataFile.cpp | ||
PARENT_SCOPE) |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set(HELPERS_SOURCE_FILES | ||
../Helpers/AbbreviatedTypes.h | ||
../Helpers/Exceptions.h | ||
../Helpers/Filesystem.h | ||
../Helpers/Resources.h | ||
../Helpers/Unicode.h | ||
../Helpers/UserDefinedLiterals.h | ||
PARENT_SCOPE) |
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,15 +1,4 @@ | ||
set(SOURCE_FILES cpp-grapher.cpp) | ||
add_executable(cpp-grapher ${SOURCE_FILES}) | ||
|
||
target_include_directories(cpp-grapher | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../CppGrapher/ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/any/ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/Optional/ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/variant/ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/utf-8/ | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/tinyutf8/ | ||
) | ||
|
||
target_link_libraries (cpp-grapher PUBLIC CppGrapher) |
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,18 +1,19 @@ | ||
add_subdirectory(Runner) | ||
add_subdirectory(Unit) | ||
add_subdirectory(Integration) | ||
add_subdirectory(Performance) | ||
add_subdirectory(System) | ||
include_directories( | ||
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/Catch/include | ||
) | ||
add_subdirectory(Unit) | ||
|
||
set(SOURCE_FILES | ||
set(TEST_SOURCE_FILES | ||
${UNIT_TEST_SOURCE_FILES} | ||
${INTEGRATION_TEST_SOURCE_FILES} | ||
${PERFORMANCE_SOURCE_FILES} | ||
${SYSTEM_TEST_SOURCE_FILES} | ||
) | ||
add_executable(Tests ${SOURCE_FILES}) | ||
${TEST_RUNNER_SOURCE_FILES}) | ||
|
||
add_executable(Tests ${TEST_SOURCE_FILES}) | ||
|
||
target_include_directories(Tests PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/Catch/include/) | ||
|
||
target_link_libraries (Tests PUBLIC Runner CppGrapher) |
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,3 +1,6 @@ | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/Catch/include) | ||
set(SOURCE_FILES Runner.cpp) | ||
add_library(Runner ${SOURCE_FILES}) | ||
set(TEST_RUNNER_SOURCE_FILES Runner.cpp) | ||
add_library(Runner ${TEST_RUNNER_SOURCE_FILES}) | ||
target_include_directories(Runner PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/Catch/include) | ||
|
||
|
25 changes: 24 additions & 1 deletion
25
Sources/Tests/Unit/CppGrapher.Graphing.Visualization.UnitTests.cpp
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,10 +1,33 @@ | ||
#include <regex> | ||
#include "catch.hpp" | ||
#include "CppGrapher.h" | ||
#include "Helpers/Exceptions.h" | ||
#include "Helpers/Filesystem.h" | ||
#include "Magick++.h" | ||
|
||
SCENARIO("Graphics tests") | ||
{ | ||
GIVEN("an app instance") | ||
{ | ||
auto app = CppGrapher(); | ||
|
||
WHEN("fed a data file rendering a single pixel at the origin (0, 0)") | ||
{ | ||
auto filename = utf8_string( u8"cpp-grapher-test.one_pixel" ); | ||
auto fileContents = u8"pixel_one, 0 0"; | ||
auto fs = TemporaryFileStream( filename, fileContents ); | ||
auto args = std::vector<utf8_string> { u8"cpp-grapher_via-test-runner", filename }; | ||
|
||
//TODO suppress stdout output | ||
app.Main( args ); | ||
|
||
THEN("a bitmap should be rendered with one pixel set at (0, 0)") | ||
{ | ||
//TODO read image file | ||
//generate 0-pixel image file | ||
//diff images | ||
//assert (count non-black pixels == 1) | ||
} | ||
} | ||
} | ||
} | ||
|
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