Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 1dff12b
Author: Nick Logozzo <[email protected]>
Date:   Thu Dec 7 00:06:14 2023 -0500

    Update CMakeLists.txt

commit 75d5a56
Author: Nick Logozzo <[email protected]>
Date:   Wed Dec 6 23:39:53 2023 -0500

    Update networktests.cpp

commit a88932d
Author: Nick Logozzo <[email protected]>
Date:   Wed Dec 6 23:01:48 2023 -0500

    Update CMakeLists.txt

commit 8cef02e
Author: Nick Logozzo <[email protected]>
Date:   Wed Dec 6 22:59:31 2023 -0500

    Better Linux Build

commit 4dcd07b
Author: Nick Logozzo <[email protected]>
Date:   Wed Dec 6 22:41:03 2023 -0500

    Tests - Fix DisableNetCheck Test

commit bae69af
Author: Nick Logozzo <[email protected]>
Date:   Tue Dec 5 23:17:44 2023 -0500

    Try to link resolv again

commit d75186e
Author: Nick Logozzo <[email protected]>
Date:   Tue Dec 5 23:13:12 2023 -0500

    Linux - Build resolv

commit a369d41
Author: Nick Logozzo <[email protected]>
Date:   Tue Dec 5 23:12:38 2023 -0500

    Update networktests.cpp
  • Loading branch information
nlogozzo committed Dec 7, 2023
1 parent 0886668 commit ce5a0bf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include(GNUInstallDirs)

#libaura Library Setup
include_directories(${PROJECT_SOURCE_DIR}/include)
add_library (${PROJECT_NAME} SHARED
add_library (${PROJECT_NAME}
src/events/eventargs.cpp
src/helpers/stringhelpers.cpp
src/helpers/webhelpers.cpp
Expand Down Expand Up @@ -52,16 +52,16 @@ find_package(maddy REQUIRED)
find_package(SQLiteCpp REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC Intl::Intl JsonCpp::JsonCpp CURL::libcurl maddy::maddy SQLiteCpp)
if(LINUX)
set(CMAKE_REQUIRED_LIBRARIES resolv)
find_package(PkgConfig REQUIRED)
find_package(libsecret REQUIRED CONFIG)
find_package(libuuid REQUIRED CONFIG)
pkg_check_modules(glib-2.0 REQUIRED IMPORTED_TARGET glib-2.0)
pkg_check_modules(gio-2.0 REQUIRED IMPORTED_TARGET gio-2.0)
pkg_check_modules(gmodule-2.0 REQUIRED IMPORTED_TARGET gmodule-2.0)
pkg_check_modules(gobject-2.0 REQUIRED IMPORTED_TARGET gobject-2.0)
pkg_check_modules(gthread-2.0 REQUIRED IMPORTED_TARGET gthread-2.0)
pkg_search_module(UUID REQUIRED uuid)
target_include_directories(${PROJECT_NAME} PUBLIC ${UUID_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC resolv libsecret::libsecret PkgConfig::glib-2.0 PkgConfig::gio-2.0 PkgConfig::gmodule-2.0 PkgConfig::gobject-2.0 PkgConfig::gthread-2.0 ${UUID_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PUBLIC libsecret::libsecret libuuid::libuuid PkgConfig::glib-2.0 PkgConfig::gio-2.0 PkgConfig::gmodule-2.0 PkgConfig::gobject-2.0 PkgConfig::gthread-2.0)
endif()

#libaura Install
Expand All @@ -76,7 +76,6 @@ enable_testing()
add_executable(${PROJECT_NAME}_test
tests/eventtests.cpp
tests/main.cpp
tests/networktests.cpp
tests/stringtests.cpp
tests/versiontests.cpp
tests/webtests.cpp)
Expand Down
1 change: 1 addition & 0 deletions conanfile-linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ maddy/1.3.0
sqlcipher/4.5.1
sqlitecpp/3.3.1
libsecret/0.20.5
libuuid/1.0.3
glib/2.78.1
gtest/1.14.0

Expand Down
1 change: 1 addition & 0 deletions src/keyring/passwordgenerator.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "keyring/passwordgenerator.h"
#include <ctime>
#include <random>

namespace Nickvision::Aura::Keyring
Expand Down
11 changes: 8 additions & 3 deletions tests/networktests.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <gtest/gtest.h>
#include <cstdlib>
#include "network/networkmonitor.h"
#ifndef _WIN32
#include <stdlib.h>
#endif

using namespace Nickvision::Aura::Network;

Expand All @@ -16,8 +18,11 @@ TEST(NetworkTests, ConnectedGlobal)

TEST(NetworkTests, DisableNetCheck)
{
std::string disableNetCheck{ "AURA_DISABLE_NETCHECK=true" };
EXPECT_EQ(putenv(disableNetCheck.c_str()), 0);
#ifdef _WIN32
EXPECT_EQ(_putenv("AURA_DISABLE_NETCHECK=true"), 0);
#else
EXPECT_EQ(setenv("AURA_DISABLE_NETCHECK", "true", true), 0);
#endif
NetworkMonitor netmon;
netmon.stateChanged() += [](const NetworkStateChangedEventArgs& e)
{
Expand Down

0 comments on commit ce5a0bf

Please sign in to comment.