Skip to content

Commit

Permalink
get tests working on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
goatshriek committed Dec 8, 2023
1 parent be6ddf9 commit ef3d14d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ string(CONCAT sqlite3_src_path_help_string
"statically with Stumpless, instead of the default dynamic linking."
)
set(SQLITE3_SRC_PATH ""
CACHE PATH ${sqlite3_src_path_help_string}
CACHE FILEPATH ${sqlite3_src_path_help_string}
)

string(CONCAT sqlite3_include_path_help_string
Expand All @@ -71,7 +71,7 @@ string(CONCAT sqlite3_include_path_help_string
"does not need to be specified."
)
set(SQLITE3_INCLUDE_PATH ""
CACHE PATH ${sqlite3_include_path_help_string}
CACHE FILEPATH ${sqlite3_include_path_help_string}
)

set(SQLITE3_DEFAULT_TABLE_NAME "logs"
Expand Down
12 changes: 12 additions & 0 deletions src/windows/stumpless.def
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,15 @@ EXPORTS
stumpless_prival_from_string @209
stumpless_get_severity_enum_from_buffer @210
stumpless_get_facility_enum_from_buffer @211
stumpless_close_sqlite3_target_and_db @212
stumpless_close_sqlite3_target_only @213
stumpless_create_default_sqlite3_table @214
stumpless_get_sqlite3_db @215
stumpless_get_sqlite3_insert_sql @216
stumpless_get_sqlite3_prepare @217
stumpless_open_sqlite3_target @218
stumpless_open_sqlite3_target_from_db @219
stumpless_open_sqlite3_target_with_options @220
stumpless_set_sqlite3_insert_sql @221
stumpless_set_sqlite3_prepare @222
stumpless_sqlite3_prepare @223
17 changes: 6 additions & 11 deletions test/function/target/sqlite3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,22 +513,17 @@ namespace {
sqlite3_finalize( result_stmt );
}

TEST_F( Sqlite3TargetTest, GetPrepare ) {
stumpless_sqlite3_prepare_func_t result;
TEST_F( Sqlite3TargetTest, GetPrepareWithAndWithoutNull ) {
stumpless_sqlite3_prepare_func_t non_null_result;
stumpless_sqlite3_prepare_func_t null_result;
void *data;

result = stumpless_get_sqlite3_prepare( target , &data );
EXPECT_EQ( result, stumpless_sqlite3_prepare );
non_null_result = stumpless_get_sqlite3_prepare( target , &data );
EXPECT_EQ( data, target->id );
EXPECT_NO_ERROR;
}

TEST_F( Sqlite3TargetTest, GetPrepareNullData ) {
stumpless_sqlite3_prepare_func_t result;

result = stumpless_get_sqlite3_prepare( target , NULL );
EXPECT_EQ( result, stumpless_sqlite3_prepare );
EXPECT_NO_ERROR;
null_result = stumpless_get_sqlite3_prepare( target , NULL );
EXPECT_EQ( null_result, non_null_result );
}

TEST_F( Sqlite3TargetTest, InvalidInsertSql ) {
Expand Down
1 change: 1 addition & 0 deletions tools/cmake/sqlite3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ endif()

if(SQLITE3_SRC_PATH)
add_library(sqlite3-src SHARED EXCLUDE_FROM_ALL "${SQLITE3_SRC_PATH}")
set_target_properties(sqlite3-src PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
target_compile_definitions(sqlite3-src PUBLIC "SQLITE_OMIT_LOAD_EXTENSION")
set(SQLITE3_LINK_NAME "sqlite3-src")
else()
Expand Down

0 comments on commit ef3d14d

Please sign in to comment.