Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

work on test options #24 #23 #27

Merged
merged 1 commit into from
Apr 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .circleci/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ FROM matthewjamesbriggs/mxci:v001
ENV BASEDIR="/mx"
WORKDIR $BASEDIR
COPY . .
CMD cmake . && make -j12 && ./MxTest
CMD cmake -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=on . && make -j12 && ./MxTest
# CMD cmake --version
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ jobs:

- run:
name: Cmake
command: cmake .
command: |
[ "$(git rev-parse --abbrev-ref HEAD)" == "master" ] && \
cmake -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=on . || \
cmake -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=off .

- run:
name: Build
Expand Down
48 changes: 34 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
cmake_minimum_required(VERSION 2.8.12.2)
project(Mx)

option(MX_BUILD_TESTS "build or skip the test suite" OFF)

option(
MX_BUILD_CORE_TESTS
"build or skip the tests in the 'core' namespace, requires MX_BUILD_TESTS"
OFF
)

#set(CMAKE_BINARY_DIR "./Build")
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
Expand Down Expand Up @@ -55,19 +63,31 @@ file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/Sourcecode/mxtest/file/PathRoot.h
#endif"
)

find_package( Threads )

# MxTest
add_executable(MxTest ${SRC_MX_TEST_API} ${SRC_MX_TEST_CONTROL} ${SRC_MX_TEST_CORE} ${SRC_MX_TEST_FILE} ${SRC_MX_TEST_IMPL} ${SRC_MX_TEST_IMPORT} ${SRC_MX_TEST_UTILITY} ${SRC_MX_TEST_XML} ${SRC_CPUL})
source_group( "api" FILES ${SRC_MX_TEST_API} )
source_group( "control" FILES ${SRC_MX_TEST_CONTROL} )
source_group( "core" FILES ${SRC_MX_TEST_CORE} )
source_group( "file" FILES ${SRC_MX_TEST_FILE} )
source_group( "impl" FILES ${SRC_MX_TEST_IMPL} )
source_group( "import" FILES ${SRC_MX_TEST_IMPORT} )
source_group( "utility" FILES ${SRC_MX_TEST_UTILITY} )
source_group( "xml" FILES ${SRC_MX_TEST_XML} )
source_group( "cpul" FILES ${SRC_CPUL} )
target_link_libraries(MxTest Mx)
target_link_libraries(MxTest ${CMAKE_THREAD_LIBS_INIT})
set_property(TARGET MxTest PROPERTY CXX_STANDARD 14)
if(MX_BUILD_TESTS)
message("tests will be compiled")
if(MX_BUILD_CORE_TESTS)
message("core tests will be compiled")
# add_compile_definitions(MX_COMPILE_CORE_TESTS)
add_definitions(-DMX_COMPILE_CORE_TESTS)
else()
message("core tests will not be compiled")
endif()
find_package( Threads )
add_executable(MxTest ${SRC_MX_TEST_API} ${SRC_MX_TEST_CONTROL} ${SRC_MX_TEST_CORE} ${SRC_MX_TEST_FILE} ${SRC_MX_TEST_IMPL} ${SRC_MX_TEST_IMPORT} ${SRC_MX_TEST_UTILITY} ${SRC_MX_TEST_XML} ${SRC_CPUL})
source_group( "api" FILES ${SRC_MX_TEST_API} )
source_group( "control" FILES ${SRC_MX_TEST_CONTROL} )
source_group( "core" FILES ${SRC_MX_TEST_CORE} )
source_group( "file" FILES ${SRC_MX_TEST_FILE} )
source_group( "impl" FILES ${SRC_MX_TEST_IMPL} )
source_group( "import" FILES ${SRC_MX_TEST_IMPORT} )
source_group( "utility" FILES ${SRC_MX_TEST_UTILITY} )
source_group( "xml" FILES ${SRC_MX_TEST_XML} )
source_group( "cpul" FILES ${SRC_CPUL} )
target_link_libraries(MxTest Mx)
target_link_libraries(MxTest ${CMAKE_THREAD_LIBS_INIT})
set_property(TARGET MxTest PROPERTY CXX_STANDARD 14)
else()
message("tests will not be compiled")
endif()
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ MusicXML Class Library

- Author: Matthew James Briggs
- License: MIT
- Version: 0.3
- Version: 1.0
- Supported MusicXML Version: 3.0
- Language: C++14

-----------------------------------------

Master: [![CircleCI](https://circleci.com/gh/webern/MusicXML-Class-Library/tree/master.svg?style=svg)](https://circleci.com/gh/webern/MusicXML-Class-Library/tree/master)
Develop: [![CircleCI](https://circleci.com/gh/webern/MusicXML-Class-Library/tree/develop.svg?style=svg)](https://circleci.com/gh/webern/MusicXML-Class-Library/tree/develop)

## Introduction
This project is a C++ class library for working with MusicXML files. MusicXML filea are represented in a strongly-typed object-oriented class structure. MusicXML can be deserialized into the class structure and serialized from class structure to MusicXML.

Expand Down
2 changes: 1 addition & 1 deletion Sourcecode/mxtest/control/CompileControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#define MX_COMPILE_API_TESTS
#define MX_COMPILE_API_ROUNDTRIP
#define MX_COMPILE_CORE_TESTS
// #define MX_COMPILE_CORE_TESTS
#define MX_COMPILE_IMPL_TESTS
#define MX_COMPILE_IMPORT_TESTS
#define MX_COMPILE_NEW_DECIMAL_TESTS
Expand Down