Skip to content

Commit

Permalink
Merge branch 'release/0.0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ruimaciel committed Jun 20, 2020
2 parents 6e20206 + f754c91 commit 86abbf9
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 91 deletions.
76 changes: 54 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.7)

project(msexpr
VERSION 0.0.1.0
VERSION 0.0.2.0
LANGUAGES C
)

configure_file(version.h.in
"${CMAKE_CURRENT_BINARY_DIR}/version.h" @ONLY
configure_file(src/version.h.in
"${CMAKE_CURRENT_BINARY_DIR}/include/msexpr/version.h" @ONLY
)
option(USES_RE2C "Uses re2c to regenerate the lexer files" OFF)
if(USES_RE2C)
Expand All @@ -23,33 +23,33 @@ if(USES_RE2C)
endif()

set(msexpr_INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/include/msexpr/sexpr.h
${CMAKE_CURRENT_SOURCE_DIR}/include/msexpr/serializers.h
${CMAKE_CURRENT_SOURCE_DIR}/include/msexpr/deserializers.h
${CMAKE_CURRENT_BINARY_DIR}/version.h
include/msexpr/sexpr.h
include/msexpr/serializers.h
include/msexpr/deserializers.h
${CMAKE_CURRENT_BINARY_DIR}/include/msexpr/version.h
)

set(msexpr_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/sexpr.c
${CMAKE_CURRENT_SOURCE_DIR}/src/sexpr_ops.c
${CMAKE_CURRENT_SOURCE_DIR}/src/sexpr_stack.c
${CMAKE_CURRENT_SOURCE_DIR}/src/serializers.c
${CMAKE_CURRENT_SOURCE_DIR}/src/deserializers.c
${CMAKE_CURRENT_SOURCE_DIR}/src/deserializer/token.c
${CMAKE_CURRENT_SOURCE_DIR}/src/deserializer/input.c
${CMAKE_CURRENT_SOURCE_DIR}/src/deserializer/rivest_canonical_lexer.c
src/sexpr.c
src/sexpr_ops.c
src/sexpr_stack.c
src/serializers.c
src/deserializers.c
src/deserializer/token.c
src/deserializer/input.c
src/deserializer/rivest_canonical_lexer.c
)

set(msexpr_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/src/sexpr_ops.h
${CMAKE_CURRENT_SOURCE_DIR}/src/sexpr_stack.h
${CMAKE_CURRENT_SOURCE_DIR}/src/deserializer/token.h
${CMAKE_CURRENT_SOURCE_DIR}/src/deserializer/input.h
${CMAKE_CURRENT_SOURCE_DIR}/src/deserializer/rivest_canonical_lexer.h
src/sexpr_ops.h
src/sexpr_stack.h
src/deserializer/token.h
src/deserializer/input.h
src/deserializer/rivest_canonical_lexer.h
)

set(msexpr_RE2C
${CMAKE_CURRENT_SOURCE_DIR}/src/deserializer/rivest_canonical_lexer.c.re2c
src/deserializer/rivest_canonical_lexer.c.re2c
)

add_library(${PROJECT_NAME} SHARED
Expand All @@ -63,12 +63,13 @@ target_include_directories(${PROJECT_NAME}
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)

set_target_properties(
${PROJECT_NAME} PROPERTIES
PUBLIC_HEADER "${msexpr_INCLUDES}"
C_STANDARD 90
C_STANDARD_REQUIRED ON
C_EXTENSIONS OFF
Expand All @@ -80,3 +81,34 @@ if (${ENABLE_TESTS})
enable_testing()
add_subdirectory(tests)
endif()

install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}
LIBRARY DESTINATION lib/${PROJECT_NAME}
PUBLIC_HEADER DESTINATION include/${PROJECT_NAME}
)


install(FILES
${CMAKE_CURRENT_BINARY_DIR}/include/msexpr/version.h
DESTINATION include/${PROJECT_NAME}
)

install(
EXPORT ${PROJECT_NAME}
DESTINATION lib/cmake/${PROJECT_NAME}
)

#Setup CPACK to generate installer
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_GENERATOR "DEB;TGZ;ZIP")
set(CPACK_DEBIAN_PACKAGE_NAME "msexpr")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Rui Maciel")
include(CPack)
3 changes: 1 addition & 2 deletions src/deserializers.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ struct msexpr_parse_result msexpr_parse_rivest_canonical(FILE *stream)
msexpr_token_stack_push(&stack, TOKEN_RIVEST_DOCUMENT);
token = rivest_canonical_lexer(stream, &input);

while(stack.current_size > 0) /* */
/* while(token.token != TOKEN_RIVEST_EOF) /* */
while(stack.current_size > 0)
{
const enum TOKEN_RIVEST_NT top = msexpr_token_stack_top(&stack);

Expand Down
1 change: 0 additions & 1 deletion src/serializers.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ int msexpr_fprint_csexpr(FILE *stream, struct msexpr *sexpr)
return 0;
}


switch(sexpr->type)
{

Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ find_package(Threads REQUIRED)
find_package(check REQUIRED)
find_package(subunit REQUIRED)

message("")

include_directories(${PROJECT_SOURCE_DIR})

set(msexpr_test_SOURCES_PREFIX "check_msexpr_")
Expand Down
8 changes: 0 additions & 8 deletions tests/check_msexpr_sexpr.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ START_TEST(test_sexpr_GIVEN_pointer_to_input_atom_WHEN_cons_input_atom_as_cdr_TH
}
END_TEST

//START_TEST(test_sexpr_GIVEN_WHEN_THEN_)
//{
// /* Given */
// /* When */
// /* Then */
//}
//END_TEST

Suite * msexpr_suite(void)
{
Suite *s;
Expand Down
8 changes: 0 additions & 8 deletions tests/check_msexpr_sexpr_atom.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ START_TEST(test_sexpr_GIVEN_float_atom_WHEN_new_float_atom_THEN_output_valid_flo
}
END_TEST

//START_TEST(test_sexpr_GIVEN_WHEN_THEN_)
//{
// /* Given */
// /* When */
// /* Then */
//}
//END_TEST

Suite * msexpr_suite(void)
{
Suite *s;
Expand Down
8 changes: 0 additions & 8 deletions tests/check_msexpr_sexpr_atom_text.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ START_TEST(test_sexpr_GIVEN_text_atom_WHEN_new_text_atom_THEN_output_valid_text_
}
END_TEST

//START_TEST(test_sexpr_GIVEN_WHEN_THEN_)
//{
// /* Given */
// /* When */
// /* Then */
//}
//END_TEST

Suite * msexpr_suite(void)
{
Suite *s;
Expand Down
8 changes: 0 additions & 8 deletions tests/check_msexpr_sexpr_deserializers_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ START_TEST(test_sexpr_GIVEN_cursor_has_moved_WHEN_input_fill_THEN_input_becomes_
}
END_TEST

//START_TEST(test_sexpr_GIVEN_WHEN_THEN_)
//{
// /* Given */
// /* When */
// /* Then */
//}
//END_TEST

Suite * msexpr_suite(void)
{
Suite *s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,6 @@ START_TEST(test_GIVEN_string_with_nested_verbatim_string_WHEN_call_lexer_three_t
}
END_TEST

//START_TEST(test_sexpr_GIVEN_WHEN_THEN_)
//{
// /* Given */
// /* When */
// /* Then */
//}
//END_TEST

Suite * msexpr_suite(void)
{
Suite *s;
Expand Down
8 changes: 0 additions & 8 deletions tests/check_msexpr_sexpr_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ Suite * msexpr_suite(void)
return s;
}

//START_TEST(test_sexpr_GIVEN_WHEN_THEN_)
//{
// /* Given */
// /* When */
// /* Then */
//}
//END_TEST

int main(void)
{
int number_failed = 0;
Expand Down
8 changes: 0 additions & 8 deletions tests/check_msexpr_sexpr_serializers.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ START_TEST(test_sexpr_GIVEN_cons_cell_with_float_atom_and_null_WHEN_fprint_csexp
}
END_TEST

//START_TEST(test_sexpr_GIVEN_WHEN_THEN_)
//{
// /* Given */
// /* When */
// /* Then */
//}
//END_TEST

Suite * msexpr_suite(void)
{
Suite *s;
Expand Down
8 changes: 0 additions & 8 deletions tests/check_msexpr_sexpr_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,6 @@ START_TEST(test_sexpr_GIVEN_initialized_stack_WHEN_push_twice_and_popped_twice_T
}
END_TEST

//START_TEST(test_sexpr_GIVEN_WHEN_THEN_)
//{
// /* Given */
// /* When */
// /* Then */
//}
//END_TEST

Suite * msexpr_suite(void)
{
Suite *s;
Expand Down

0 comments on commit 86abbf9

Please sign in to comment.