Merge branch 'crush-dllmacros'
Tidy a bunch of includes, make it easier to add tests.
This commit is contained in:
commit
0238a7338a
@ -549,10 +549,11 @@ install(
|
|||||||
"${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
|
"${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
|
||||||
"${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake"
|
"${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake"
|
||||||
"${PROJECT_BINARY_DIR}/CalamaresUse.cmake"
|
"${PROJECT_BINARY_DIR}/CalamaresUse.cmake"
|
||||||
"CMakeModules/CalamaresAddPlugin.cmake"
|
|
||||||
"CMakeModules/CalamaresAddModuleSubdirectory.cmake"
|
|
||||||
"CMakeModules/CalamaresAddLibrary.cmake"
|
|
||||||
"CMakeModules/CalamaresAddBrandingSubdirectory.cmake"
|
"CMakeModules/CalamaresAddBrandingSubdirectory.cmake"
|
||||||
|
"CMakeModules/CalamaresAddLibrary.cmake"
|
||||||
|
"CMakeModules/CalamaresAddModuleSubdirectory.cmake"
|
||||||
|
"CMakeModules/CalamaresAddPlugin.cmake"
|
||||||
|
"CMakeModules/CalamaresAddTest.cmake"
|
||||||
"CMakeModules/CalamaresAddTranslations.cmake"
|
"CMakeModules/CalamaresAddTranslations.cmake"
|
||||||
"CMakeModules/CalamaresAutomoc.cmake"
|
"CMakeModules/CalamaresAutomoc.cmake"
|
||||||
"CMakeModules/CMakeColors.cmake"
|
"CMakeModules/CMakeColors.cmake"
|
||||||
|
58
CMakeModules/CalamaresAddTest.cmake
Normal file
58
CMakeModules/CalamaresAddTest.cmake
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
# === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
|
#
|
||||||
|
# Calamares is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Calamares is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0+
|
||||||
|
# License-Filename: LICENSE
|
||||||
|
#
|
||||||
|
###
|
||||||
|
#
|
||||||
|
# Support functions for building Calamares tests.
|
||||||
|
# This extends KDE's ECM tests with some custom patterns.
|
||||||
|
#
|
||||||
|
# calamares_add_test(
|
||||||
|
# <NAME>
|
||||||
|
# [GUI]
|
||||||
|
# SOURCES <FILE..>
|
||||||
|
# )
|
||||||
|
|
||||||
|
include( CMakeParseArguments )
|
||||||
|
include( CalamaresAutomoc )
|
||||||
|
|
||||||
|
function( calamares_add_test )
|
||||||
|
# parse arguments (name needs to be saved before passing ARGN into the macro)
|
||||||
|
set( NAME ${ARGV0} )
|
||||||
|
set( options GUI )
|
||||||
|
set( multiValueArgs SOURCES LIBRARIES )
|
||||||
|
cmake_parse_arguments( TEST "${options}" "" "${multiValueArgs}" ${ARGN} )
|
||||||
|
set( TEST_NAME ${NAME} )
|
||||||
|
|
||||||
|
if( ECM_FOUND AND BUILD_TESTING )
|
||||||
|
ecm_add_test(
|
||||||
|
${TEST_SOURCES}
|
||||||
|
TEST_NAME
|
||||||
|
${TEST_NAME}
|
||||||
|
LINK_LIBRARIES
|
||||||
|
calamares
|
||||||
|
${TEST_LIBRARIES}
|
||||||
|
Qt5::Core
|
||||||
|
Qt5::Test
|
||||||
|
)
|
||||||
|
calamares_automoc( ${TEST_NAME} )
|
||||||
|
target_compile_definitions( ${TEST_NAME} PRIVATE -DBUILD_AS_TEST )
|
||||||
|
if( TEST_GUI )
|
||||||
|
target_link_libraries( ${TEST_NAME} calamaresui Qt5::Gui )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
@ -4,6 +4,8 @@
|
|||||||
# YAMLCPP_FOUND, if false, do not try to link to yaml-cpp
|
# YAMLCPP_FOUND, if false, do not try to link to yaml-cpp
|
||||||
# YAMLCPP_LIBRARY, where to find yaml-cpp
|
# YAMLCPP_LIBRARY, where to find yaml-cpp
|
||||||
# YAMLCPP_INCLUDE_DIR, where to find yaml.h
|
# YAMLCPP_INCLUDE_DIR, where to find yaml.h
|
||||||
|
# There is also one IMPORTED library target,
|
||||||
|
# yamlcpp
|
||||||
#
|
#
|
||||||
# By default, the dynamic libraries of yaml-cpp will be found. To find the static ones instead,
|
# By default, the dynamic libraries of yaml-cpp will be found. To find the static ones instead,
|
||||||
# you must set the YAMLCPP_STATIC_LIBRARY variable to TRUE before calling find_package(YamlCpp ...).
|
# you must set the YAMLCPP_STATIC_LIBRARY variable to TRUE before calling find_package(YamlCpp ...).
|
||||||
@ -48,3 +50,12 @@ find_library(YAMLCPP_LIBRARY
|
|||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(YAMLCPP DEFAULT_MSG YAMLCPP_INCLUDE_DIR YAMLCPP_LIBRARY)
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(YAMLCPP DEFAULT_MSG YAMLCPP_INCLUDE_DIR YAMLCPP_LIBRARY)
|
||||||
mark_as_advanced(YAMLCPP_INCLUDE_DIR YAMLCPP_LIBRARY)
|
mark_as_advanced(YAMLCPP_INCLUDE_DIR YAMLCPP_LIBRARY)
|
||||||
|
|
||||||
|
# Add an imported target
|
||||||
|
if( YAMLCPP_LIBRARY )
|
||||||
|
add_library( yamlcpp UNKNOWN IMPORTED )
|
||||||
|
set_property( TARGET yamlcpp PROPERTY IMPORTED_LOCATION ${YAMLCPP_LIBRARY} )
|
||||||
|
if ( YAMLCPP_INCLUDE_DIR )
|
||||||
|
set_property( TARGET yamlcpp PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${YAMLCPP_INCLUDE_DIR} )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
@ -2,6 +2,7 @@ include( CalamaresAddPlugin )
|
|||||||
include( CalamaresAddModuleSubdirectory )
|
include( CalamaresAddModuleSubdirectory )
|
||||||
include( CalamaresAddLibrary )
|
include( CalamaresAddLibrary )
|
||||||
include( CalamaresAddBrandingSubdirectory )
|
include( CalamaresAddBrandingSubdirectory )
|
||||||
|
include( CalamaresAddTest )
|
||||||
|
|
||||||
# library
|
# library
|
||||||
add_subdirectory( libcalamares )
|
add_subdirectory( libcalamares )
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
add_definitions( -DUIDLLEXPORT_PRO )
|
|
||||||
|
|
||||||
set( calamaresSources
|
set( calamaresSources
|
||||||
main.cpp
|
main.cpp
|
||||||
CalamaresApplication.cpp
|
CalamaresApplication.cpp
|
||||||
|
@ -74,7 +74,6 @@ mark_thirdparty_code( ${kdsagSources} )
|
|||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${YAMLCPP_INCLUDE_DIR}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
### OPTIONAL Python support
|
### OPTIONAL Python support
|
||||||
@ -126,7 +125,7 @@ target_link_libraries( calamares
|
|||||||
LINK_PRIVATE
|
LINK_PRIVATE
|
||||||
${OPTIONAL_PRIVATE_LIBRARIES}
|
${OPTIONAL_PRIVATE_LIBRARIES}
|
||||||
LINK_PUBLIC
|
LINK_PUBLIC
|
||||||
${YAMLCPP_LIBRARY}
|
yamlcpp
|
||||||
Qt5::Core
|
Qt5::Core
|
||||||
KF5::CoreAddons
|
KF5::CoreAddons
|
||||||
${OPTIONAL_PUBLIC_LIBRARIES}
|
${OPTIONAL_PUBLIC_LIBRARIES}
|
||||||
@ -159,85 +158,51 @@ install( FILES ${utilsHeaders} DESTINATION include/libcalam
|
|||||||
### TESTING
|
### TESTING
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
if ( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
|
||||||
utils/Tests.cpp
|
|
||||||
TEST_NAME
|
|
||||||
libcalamarestest
|
libcalamarestest
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
calamares
|
utils/Tests.cpp
|
||||||
Qt5::Core
|
)
|
||||||
Qt5::Test
|
|
||||||
)
|
|
||||||
calamares_automoc( libcalamarestest )
|
|
||||||
|
|
||||||
ecm_add_test(
|
calamares_add_test(
|
||||||
utils/TestPaths.cpp
|
|
||||||
TEST_NAME
|
|
||||||
libcalamarestestpaths
|
libcalamarestestpaths
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
calamares
|
utils/TestPaths.cpp
|
||||||
Qt5::Core
|
)
|
||||||
Qt5::Test
|
|
||||||
)
|
|
||||||
calamares_automoc( libcalamarestestpaths )
|
|
||||||
|
|
||||||
|
calamares_add_test(
|
||||||
ecm_add_test(
|
geoiptest
|
||||||
|
SOURCES
|
||||||
geoip/GeoIPTests.cpp
|
geoip/GeoIPTests.cpp
|
||||||
${geoip_src}
|
${geoip_src}
|
||||||
TEST_NAME
|
)
|
||||||
geoiptest
|
|
||||||
LINK_LIBRARIES
|
|
||||||
calamares
|
|
||||||
Qt5::Test
|
|
||||||
${YAMLCPP_LIBRARY}
|
|
||||||
)
|
|
||||||
calamares_automoc( geoiptest )
|
|
||||||
|
|
||||||
ecm_add_test(
|
calamares_add_test(
|
||||||
partition/Tests.cpp
|
|
||||||
TEST_NAME
|
|
||||||
libcalamarespartitiontest
|
libcalamarespartitiontest
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
calamares
|
partition/Tests.cpp
|
||||||
Qt5::Test
|
)
|
||||||
)
|
|
||||||
calamares_automoc( libcalamarespartitiontest )
|
|
||||||
|
|
||||||
ecm_add_test(
|
calamares_add_test(
|
||||||
locale/Tests.cpp
|
|
||||||
TEST_NAME
|
|
||||||
libcalamareslocaletest
|
libcalamareslocaletest
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
calamares
|
locale/Tests.cpp
|
||||||
Qt5::Test
|
)
|
||||||
)
|
|
||||||
calamares_automoc( libcalamareslocaletest )
|
|
||||||
|
|
||||||
ecm_add_test(
|
calamares_add_test(
|
||||||
network/Tests.cpp
|
|
||||||
TEST_NAME
|
|
||||||
libcalamaresnetworktest
|
libcalamaresnetworktest
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
calamares
|
network/Tests.cpp
|
||||||
Qt5::Test
|
)
|
||||||
)
|
|
||||||
calamares_automoc( libcalamaresnetworktest )
|
|
||||||
|
|
||||||
ecm_add_test(
|
calamares_add_test(
|
||||||
modulesystem/Tests.cpp
|
|
||||||
TEST_NAME
|
|
||||||
libcalamaresmodulesystemtest
|
libcalamaresmodulesystemtest
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
calamares
|
modulesystem/Tests.cpp
|
||||||
Qt5::Test
|
)
|
||||||
)
|
|
||||||
calamares_automoc( libcalamaresmodulesystemtest )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( BUILD_TESTING )
|
if( BUILD_TESTING )
|
||||||
add_executable( test_geoip geoip/test_geoip.cpp ${geoip_src} )
|
add_executable( test_geoip geoip/test_geoip.cpp ${geoip_src} )
|
||||||
target_link_libraries( test_geoip calamares Qt5::Network ${YAMLCPP_LIBRARY} )
|
target_link_libraries( test_geoip calamares Qt5::Network yamlcpp )
|
||||||
calamares_automoc( test_geoip )
|
calamares_automoc( test_geoip )
|
||||||
endif()
|
endif()
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Mark symbols exported from Calamares libraries with DLLEXPORT.
|
||||||
|
* These are the public API of the libraries.
|
||||||
|
*/
|
||||||
#ifndef DLLEXPORT
|
#ifndef DLLEXPORT
|
||||||
#if defined( DLLEXPORT_PRO )
|
#if defined( DLLEXPORT_PRO )
|
||||||
#define DLLEXPORT Q_DECL_EXPORT
|
#define DLLEXPORT Q_DECL_EXPORT
|
||||||
@ -29,4 +33,30 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Mark symbols exported from Calamares C++ plugins with PLUGINDLLEXPORT.
|
||||||
|
* These are the public API of the libraries (generally, the plugin
|
||||||
|
* entry point)
|
||||||
|
*/
|
||||||
|
#ifndef PLUGINDLLEXPORT
|
||||||
|
#if defined( PLUGINDLLEXPORT_PRO )
|
||||||
|
#define PLUGINDLLEXPORT Q_DECL_EXPORT
|
||||||
|
#else
|
||||||
|
#define PLUGINDLLEXPORT Q_DECL_IMPORT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For functions that should be static in production but also need to
|
||||||
|
* be tested, use STATICTEST as linkage specifier. When built as part
|
||||||
|
* of a test, the function will be given normal linkage.
|
||||||
|
*/
|
||||||
|
#ifndef STATICTEST
|
||||||
|
#if defined( BUILD_AS_TEST )
|
||||||
|
#define STATICTEST
|
||||||
|
#else
|
||||||
|
#define STATICTEST static
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
|
||||||
*
|
|
||||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
|
||||||
*
|
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Calamares is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef PLUGINDLLMACRO_H
|
|
||||||
#define PLUGINDLLMACRO_H
|
|
||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
|
||||||
|
|
||||||
#ifndef PLUGINDLLEXPORT
|
|
||||||
#if defined( PLUGINDLLEXPORT_PRO )
|
|
||||||
#define PLUGINDLLEXPORT Q_DECL_EXPORT
|
|
||||||
#else
|
|
||||||
#define PLUGINDLLEXPORT Q_DECL_IMPORT
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -22,7 +22,7 @@
|
|||||||
#ifndef BRANDING_H
|
#ifndef BRANDING_H
|
||||||
#define BRANDING_H
|
#define BRANDING_H
|
||||||
|
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include "utils/NamedSuffix.h"
|
#include "utils/NamedSuffix.h"
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ namespace Calamares
|
|||||||
|
|
||||||
class GlobalStorage;
|
class GlobalStorage;
|
||||||
|
|
||||||
class UIDLLEXPORT Branding : public QObject
|
class DLLEXPORT Branding : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -66,7 +66,7 @@ endif()
|
|||||||
|
|
||||||
calamares_add_library( calamaresui
|
calamares_add_library( calamaresui
|
||||||
SOURCES ${calamaresui_SOURCES}
|
SOURCES ${calamaresui_SOURCES}
|
||||||
EXPORT_MACRO UIDLLEXPORT_PRO
|
EXPORT_MACRO DLLEXPORT_PRO
|
||||||
LINK_PRIVATE_LIBRARIES
|
LINK_PRIVATE_LIBRARIES
|
||||||
${OPTIONAL_PYTHON_LIBRARIES}
|
${OPTIONAL_PYTHON_LIBRARIES}
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
|
||||||
*
|
|
||||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
|
||||||
*
|
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Calamares is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef UIDLLMACRO_H
|
|
||||||
#define UIDLLMACRO_H
|
|
||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
|
||||||
|
|
||||||
#ifndef UIDLLEXPORT
|
|
||||||
#if defined( UIDLLEXPORT_PRO )
|
|
||||||
#define UIDLLEXPORT Q_DECL_EXPORT
|
|
||||||
#else
|
|
||||||
#define UIDLLEXPORT Q_DECL_IMPORT
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -20,7 +20,7 @@
|
|||||||
#ifndef VIEWMANAGER_H
|
#ifndef VIEWMANAGER_H
|
||||||
#define VIEWMANAGER_H
|
#define VIEWMANAGER_H
|
||||||
|
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "viewpages/ViewStep.h"
|
#include "viewpages/ViewStep.h"
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@ -33,7 +33,7 @@ namespace Calamares
|
|||||||
* @brief The ViewManager class handles progression through view pages.
|
* @brief The ViewManager class handles progression through view pages.
|
||||||
* @note Singleton object, only use through ViewManager::instance().
|
* @note Singleton object, only use through ViewManager::instance().
|
||||||
*/
|
*/
|
||||||
class UIDLLEXPORT ViewManager : public QObject
|
class DLLEXPORT ViewManager : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -22,14 +22,14 @@
|
|||||||
#define CALAMARES_CPPJOBMODULE_H
|
#define CALAMARES_CPPJOBMODULE_H
|
||||||
|
|
||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
class QPluginLoader;
|
class QPluginLoader;
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
|
|
||||||
class UIDLLEXPORT CppJobModule : public Module
|
class DLLEXPORT CppJobModule : public Module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Type type() const override;
|
Type type() const override;
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "Job.h"
|
#include "Job.h"
|
||||||
#include "Requirement.h"
|
#include "Requirement.h"
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include "modulesystem/Descriptor.h"
|
#include "modulesystem/Descriptor.h"
|
||||||
#include "modulesystem/InstanceKey.h"
|
#include "modulesystem/InstanceKey.h"
|
||||||
@ -40,7 +40,7 @@ namespace Calamares
|
|||||||
* takes care of creating an object of the correct type starting from a module
|
* takes care of creating an object of the correct type starting from a module
|
||||||
* descriptor structure.
|
* descriptor structure.
|
||||||
*/
|
*/
|
||||||
class UIDLLEXPORT Module
|
class DLLEXPORT Module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -22,14 +22,14 @@
|
|||||||
|
|
||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
|
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
|
|
||||||
class UIDLLEXPORT ProcessJobModule : public Module
|
class DLLEXPORT ProcessJobModule : public Module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Type type() const override;
|
Type type() const override;
|
||||||
|
@ -21,12 +21,12 @@
|
|||||||
|
|
||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
|
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
|
|
||||||
class UIDLLEXPORT PythonJobModule : public Module
|
class DLLEXPORT PythonJobModule : public Module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Type type() const override;
|
Type type() const override;
|
||||||
|
@ -20,14 +20,14 @@
|
|||||||
#define CALAMARES_PYTHONQTVIEWMODULE_H
|
#define CALAMARES_PYTHONQTVIEWMODULE_H
|
||||||
|
|
||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
|
|
||||||
class ViewStep;
|
class ViewStep;
|
||||||
|
|
||||||
class UIDLLEXPORT PythonQtViewModule : public Module
|
class DLLEXPORT PythonQtViewModule : public Module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Type type() const override;
|
Type type() const override;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#define CALAMARES_VIEWMODULE_H
|
#define CALAMARES_VIEWMODULE_H
|
||||||
|
|
||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
class QPluginLoader;
|
class QPluginLoader;
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ namespace Calamares
|
|||||||
|
|
||||||
class ViewStep;
|
class ViewStep;
|
||||||
|
|
||||||
class UIDLLEXPORT ViewModule : public Module
|
class DLLEXPORT ViewModule : public Module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Type type() const override;
|
Type type() const override;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#ifndef CALAMARESUTILSGUI_H
|
#ifndef CALAMARESUTILSGUI_H
|
||||||
#define CALAMARESUTILSGUI_H
|
#define CALAMARESUTILSGUI_H
|
||||||
|
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
@ -83,7 +83,7 @@ enum ImageMode
|
|||||||
* @param size the target pixmap size (default: original SVG size).
|
* @param size the target pixmap size (default: original SVG size).
|
||||||
* @return the new pixmap.
|
* @return the new pixmap.
|
||||||
*/
|
*/
|
||||||
UIDLLEXPORT QPixmap defaultPixmap( ImageType type,
|
DLLEXPORT QPixmap defaultPixmap( ImageType type,
|
||||||
ImageMode mode = CalamaresUtils::Original,
|
ImageMode mode = CalamaresUtils::Original,
|
||||||
const QSize& size = QSize( 0, 0 ) );
|
const QSize& size = QSize( 0, 0 ) );
|
||||||
|
|
||||||
@ -95,27 +95,27 @@ UIDLLEXPORT QPixmap defaultPixmap( ImageType type,
|
|||||||
* @return the transformed pixmap.
|
* @return the transformed pixmap.
|
||||||
* This one is currently unused.
|
* This one is currently unused.
|
||||||
*/
|
*/
|
||||||
UIDLLEXPORT QPixmap createRoundedImage( const QPixmap& avatar, const QSize& size, float frameWidthPct = 0.20f );
|
DLLEXPORT QPixmap createRoundedImage( const QPixmap& avatar, const QSize& size, float frameWidthPct = 0.20f );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief unmarginLayout recursively walks the QLayout tree and removes all margins.
|
* @brief unmarginLayout recursively walks the QLayout tree and removes all margins.
|
||||||
* @param layout the layout to unmargin.
|
* @param layout the layout to unmargin.
|
||||||
*/
|
*/
|
||||||
UIDLLEXPORT void unmarginLayout( QLayout* layout );
|
DLLEXPORT void unmarginLayout( QLayout* layout );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief clearLayout recursively walks the QLayout tree and deletes all the child
|
* @brief clearLayout recursively walks the QLayout tree and deletes all the child
|
||||||
* widgets and layouts.
|
* widgets and layouts.
|
||||||
* @param layout the layout to clear.
|
* @param layout the layout to clear.
|
||||||
*/
|
*/
|
||||||
UIDLLEXPORT void clearLayout( QLayout* layout );
|
DLLEXPORT void clearLayout( QLayout* layout );
|
||||||
|
|
||||||
UIDLLEXPORT void setDefaultFontSize( int points );
|
DLLEXPORT void setDefaultFontSize( int points );
|
||||||
UIDLLEXPORT int defaultFontSize(); // in points
|
DLLEXPORT int defaultFontSize(); // in points
|
||||||
UIDLLEXPORT int defaultFontHeight(); // in pixels, DPI-specific
|
DLLEXPORT int defaultFontHeight(); // in pixels, DPI-specific
|
||||||
UIDLLEXPORT QFont defaultFont();
|
DLLEXPORT QFont defaultFont();
|
||||||
UIDLLEXPORT QFont largeFont();
|
DLLEXPORT QFont largeFont();
|
||||||
UIDLLEXPORT QSize defaultIconSize();
|
DLLEXPORT QSize defaultIconSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Size constants for the main Calamares window.
|
* @brief Size constants for the main Calamares window.
|
||||||
|
@ -28,10 +28,10 @@
|
|||||||
|
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
|
|
||||||
class UIDLLEXPORT ImageRegistry
|
class DLLEXPORT ImageRegistry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static ImageRegistry* instance();
|
static ImageRegistry* instance();
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#define VIEWSTEP_H
|
#define VIEWSTEP_H
|
||||||
|
|
||||||
#include "Job.h"
|
#include "Job.h"
|
||||||
#include "UiDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include "modulesystem/InstanceKey.h"
|
#include "modulesystem/InstanceKey.h"
|
||||||
#include "modulesystem/Requirement.h"
|
#include "modulesystem/Requirement.h"
|
||||||
@ -45,7 +45,7 @@ namespace Calamares
|
|||||||
* (which shows all of the things which have been collected to be done in the
|
* (which shows all of the things which have been collected to be done in the
|
||||||
* next exec-step) through prettyStatus() and createSummaryWidget().
|
* next exec-step) through prettyStatus() and createSummaryWidget().
|
||||||
*/
|
*/
|
||||||
class UIDLLEXPORT ViewStep : public QObject
|
class DLLEXPORT ViewStep : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -12,7 +12,7 @@ include_directories(
|
|||||||
|
|
||||||
if( BUILD_TESTING )
|
if( BUILD_TESTING )
|
||||||
add_executable( test_conf test_conf.cpp )
|
add_executable( test_conf test_conf.cpp )
|
||||||
target_link_libraries( test_conf ${YAMLCPP_LIBRARY} Qt5::Core )
|
target_link_libraries( test_conf yamlcpp Qt5::Core )
|
||||||
target_include_directories( test_conf PUBLIC ${YAMLCPP_INCLUDE_DIR} )
|
target_include_directories( test_conf PUBLIC ${YAMLCPP_INCLUDE_DIR} )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -8,18 +8,11 @@ calamares_add_plugin( contextualprocess
|
|||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
if( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
contextualprocesstest
|
||||||
|
SOURCES
|
||||||
Tests.cpp
|
Tests.cpp
|
||||||
ContextualProcessJob.cpp # Builds it a second time
|
ContextualProcessJob.cpp # Builds it a second time
|
||||||
TEST_NAME
|
LIBRARIES
|
||||||
contextualprocesstest
|
yamlcpp
|
||||||
LINK_LIBRARIES
|
)
|
||||||
${CALAMARES_LIBRARIES}
|
|
||||||
calamaresui
|
|
||||||
${YAMLCPP_LIBRARY}
|
|
||||||
Qt5::Core
|
|
||||||
Qt5::Test
|
|
||||||
)
|
|
||||||
calamares_automoc( contextualprocesstest )
|
|
||||||
endif()
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
#include "CppJob.h"
|
#include "CppJob.h"
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
class PLUGINDLLEXPORT DracutLuksCfgJob : public Calamares::CppJob
|
class PLUGINDLLEXPORT DracutLuksCfgJob : public Calamares::CppJob
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
class PLUGINDLLEXPORT DummyCppJob : public Calamares::CppJob
|
class PLUGINDLLEXPORT DummyCppJob : public Calamares::CppJob
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
#include "viewpages/ViewStep.h"
|
#include "viewpages/ViewStep.h"
|
||||||
|
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
class FinishedPage;
|
class FinishedPage;
|
||||||
|
|
||||||
|
@ -30,21 +30,15 @@ if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND
|
|||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
if( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
|
||||||
Tests.cpp
|
|
||||||
TEST_NAME
|
|
||||||
fsresizertest
|
fsresizertest
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
${CALAMARES_LIBRARIES}
|
Tests.cpp
|
||||||
calamares
|
LIBRARIES
|
||||||
calamares_job_fsresizer # From above
|
calamares_job_fsresizer # From above
|
||||||
${YAMLCPP_LIBRARY}
|
yamlcpp
|
||||||
Qt5::Core
|
|
||||||
Qt5::Test
|
|
||||||
)
|
)
|
||||||
set_target_properties( fsresizertest PROPERTIES AUTOMOC TRUE )
|
if( TARGET fsresizertest )
|
||||||
target_include_directories( fsresizertest PRIVATE /usr/local/include )
|
|
||||||
target_compile_definitions( fsresizertest PRIVATE ${_partition_defs} )
|
target_compile_definitions( fsresizertest PRIVATE ${_partition_defs} )
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "partition/PartitionSize.h"
|
#include "partition/PartitionSize.h"
|
||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
class CoreBackend; // From KPMCore
|
class CoreBackend; // From KPMCore
|
||||||
class Device; // From KPMCore
|
class Device; // From KPMCore
|
||||||
|
@ -32,18 +32,11 @@ if ( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 )
|
|||||||
target_compile_definitions( calamares_job_hostinfo PRIVATE WITH_KOSRelease )
|
target_compile_definitions( calamares_job_hostinfo PRIVATE WITH_KOSRelease )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
|
||||||
Tests.cpp
|
|
||||||
HostInfoJob.cpp # Builds it a second time
|
|
||||||
TEST_NAME
|
|
||||||
hostinfotest
|
hostinfotest
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
${CALAMARES_LIBRARIES}
|
Tests.cpp
|
||||||
calamaresui
|
HostInfoJob.cpp
|
||||||
${YAMLCPP_LIBRARY}
|
LIBRARIES
|
||||||
Qt5::Core
|
yamlcpp
|
||||||
Qt5::Test
|
)
|
||||||
)
|
|
||||||
calamares_automoc( hostinfotest )
|
|
||||||
endif()
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#define HOSTINFOJOB_H
|
#define HOSTINFOJOB_H
|
||||||
|
|
||||||
#include "CppJob.h"
|
#include "CppJob.h"
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -8,18 +8,11 @@ calamares_add_plugin( initcpio
|
|||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
if( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
|
||||||
Tests.cpp
|
|
||||||
TEST_NAME
|
|
||||||
initcpiotest
|
initcpiotest
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
${CALAMARES_LIBRARIES}
|
Tests.cpp
|
||||||
calamares
|
LIBRARIES
|
||||||
calamares_job_initcpio # From above
|
calamares_job_initcpio # From above
|
||||||
${YAMLCPP_LIBRARY}
|
yamlcpp
|
||||||
Qt5::Core
|
)
|
||||||
Qt5::Test
|
|
||||||
)
|
|
||||||
calamares_automoc( initcpiotest )
|
|
||||||
endif()
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#define INITCPIOJOB_H
|
#define INITCPIOJOB_H
|
||||||
|
|
||||||
#include "CppJob.h"
|
#include "CppJob.h"
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -8,18 +8,11 @@ calamares_add_plugin( initramfs
|
|||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
if( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
|
||||||
Tests.cpp
|
|
||||||
TEST_NAME
|
|
||||||
initramfstest
|
initramfstest
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
${CALAMARES_LIBRARIES}
|
Tests.cpp
|
||||||
calamares
|
LIBRARIES
|
||||||
calamares_job_initramfs # From above
|
calamares_job_initramfs # From above
|
||||||
${YAMLCPP_LIBRARY}
|
yamlcpp
|
||||||
Qt5::Core
|
)
|
||||||
Qt5::Test
|
|
||||||
)
|
|
||||||
calamares_automoc( initramfstest )
|
|
||||||
endif()
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#define INITRAMFSJOB_H
|
#define INITRAMFSJOB_H
|
||||||
|
|
||||||
#include "CppJob.h"
|
#include "CppJob.h"
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
class InteractiveTerminalPage;
|
class InteractiveTerminalPage;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
class KeyboardPage;
|
class KeyboardPage;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#ifndef LICENSEPAGEPLUGIN_H
|
#ifndef LICENSEPAGEPLUGIN_H
|
||||||
#define LICENSEPAGEPLUGIN_H
|
#define LICENSEPAGEPLUGIN_H
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
|
@ -27,19 +27,13 @@ calamares_add_plugin( locale
|
|||||||
calamaresui
|
calamaresui
|
||||||
Qt5::Network
|
Qt5::Network
|
||||||
${geoip_libs}
|
${geoip_libs}
|
||||||
${YAMLCPP_LIBRARY}
|
yamlcpp
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
if( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
localetest
|
||||||
|
SOURCES
|
||||||
Tests.cpp
|
Tests.cpp
|
||||||
LocaleConfiguration.cpp
|
LocaleConfiguration.cpp
|
||||||
TEST_NAME
|
)
|
||||||
localetest
|
|
||||||
LINK_LIBRARIES
|
|
||||||
calamares
|
|
||||||
Qt5::Test
|
|
||||||
)
|
|
||||||
calamares_automoc( localetest )
|
|
||||||
endif()
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
#include "viewpages/ViewStep.h"
|
#include "viewpages/ViewStep.h"
|
||||||
|
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#define LUKSBOOTKEYFILEJOB_H
|
#define LUKSBOOTKEYFILEJOB_H
|
||||||
|
|
||||||
#include "CppJob.h"
|
#include "CppJob.h"
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -9,17 +9,10 @@ calamares_add_plugin( machineid
|
|||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
if ( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
machineidtest
|
||||||
|
SOURCES
|
||||||
Tests.cpp
|
Tests.cpp
|
||||||
MachineIdJob.cpp
|
MachineIdJob.cpp
|
||||||
Workers.cpp
|
Workers.cpp
|
||||||
TEST_NAME
|
)
|
||||||
machineidtest
|
|
||||||
LINK_LIBRARIES
|
|
||||||
calamares
|
|
||||||
Qt5::Core
|
|
||||||
Qt5::Test
|
|
||||||
)
|
|
||||||
calamares_automoc( machineidtest )
|
|
||||||
endif()
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
class PLUGINDLLEXPORT MachineIdJob : public Calamares::CppJob
|
class PLUGINDLLEXPORT MachineIdJob : public Calamares::CppJob
|
||||||
{
|
{
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
|
// Internals of Workers.cpp
|
||||||
|
extern int getUrandomPoolSize();
|
||||||
|
|
||||||
class MachineIdTests : public QObject
|
class MachineIdTests : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -93,10 +96,10 @@ MachineIdTests::testPoolSize()
|
|||||||
{
|
{
|
||||||
#ifdef Q_OS_FREEBSD
|
#ifdef Q_OS_FREEBSD
|
||||||
// It hardly makes sense, but also the /proc entry is missing
|
// It hardly makes sense, but also the /proc entry is missing
|
||||||
QCOMPARE( MachineId::getUrandomPoolSize(), 512 );
|
QCOMPARE( getUrandomPoolSize(), 512 );
|
||||||
#else
|
#else
|
||||||
// Based on a sample size of 1, Netrunner
|
// Based on a sample size of 1, Netrunner
|
||||||
QCOMPARE( MachineId::getUrandomPoolSize(), 4096 );
|
QCOMPARE( getUrandomPoolSize(), 4096 );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,34 @@
|
|||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
|
/// @brief Returns a recommended size for the entropy pool (in bytes)
|
||||||
|
STATICTEST int
|
||||||
|
getUrandomPoolSize()
|
||||||
|
{
|
||||||
|
QFile f( "/proc/sys/kernel/random/poolsize" );
|
||||||
|
constexpr const int minimumPoolSize = 512;
|
||||||
|
int poolSize = minimumPoolSize;
|
||||||
|
|
||||||
|
if ( f.exists() && f.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
||||||
|
{
|
||||||
|
QByteArray v = f.read( 16 );
|
||||||
|
if ( v.length() > 2 )
|
||||||
|
{
|
||||||
|
if ( v.endsWith( '\n' ) )
|
||||||
|
{
|
||||||
|
v.chop( 1 );
|
||||||
|
}
|
||||||
|
bool ok = false;
|
||||||
|
poolSize = v.toInt( &ok );
|
||||||
|
if ( !ok )
|
||||||
|
{
|
||||||
|
poolSize = minimumPoolSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ( poolSize >= minimumPoolSize ) ? poolSize : minimumPoolSize;
|
||||||
|
}
|
||||||
|
|
||||||
namespace MachineId
|
namespace MachineId
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -59,33 +87,6 @@ copyFile( const QString& rootMountPoint, const QString& fileName )
|
|||||||
return Calamares::JobResult::ok();
|
return Calamares::JobResult::ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
getUrandomPoolSize()
|
|
||||||
{
|
|
||||||
QFile f( "/proc/sys/kernel/random/poolsize" );
|
|
||||||
constexpr const int minimumPoolSize = 512;
|
|
||||||
int poolSize = minimumPoolSize;
|
|
||||||
|
|
||||||
if ( f.exists() && f.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
|
||||||
{
|
|
||||||
QByteArray v = f.read( 16 );
|
|
||||||
if ( v.length() > 2 )
|
|
||||||
{
|
|
||||||
if ( v.endsWith( '\n' ) )
|
|
||||||
{
|
|
||||||
v.chop( 1 );
|
|
||||||
}
|
|
||||||
bool ok = false;
|
|
||||||
poolSize = v.toInt( &ok );
|
|
||||||
if ( !ok )
|
|
||||||
{
|
|
||||||
poolSize = minimumPoolSize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ( poolSize >= minimumPoolSize ) ? poolSize : minimumPoolSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
Calamares::JobResult
|
Calamares::JobResult
|
||||||
createNewEntropy( int poolSize, const QString& rootMountPoint, const QString& fileName )
|
createNewEntropy( int poolSize, const QString& rootMountPoint, const QString& fileName )
|
||||||
{
|
{
|
||||||
|
@ -48,9 +48,6 @@ enum class EntropyGeneration
|
|||||||
CopyFromHost
|
CopyFromHost
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @brief Returns a recommended size for the entropy pool (in bytes)
|
|
||||||
int getUrandomPoolSize();
|
|
||||||
|
|
||||||
/// @brief Creates a new entropy file @p fileName in the target system at @p rootMountPoint
|
/// @brief Creates a new entropy file @p fileName in the target system at @p rootMountPoint
|
||||||
Calamares::JobResult createNewEntropy( int poolSize, const QString& rootMountPoint, const QString& fileName );
|
Calamares::JobResult createNewEntropy( int poolSize, const QString& rootMountPoint, const QString& fileName );
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
|
||||||
|
|
||||||
calamares_add_plugin( netinstall
|
calamares_add_plugin( netinstall
|
||||||
TYPE viewmodule
|
TYPE viewmodule
|
||||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
@ -15,6 +13,6 @@ calamares_add_plugin( netinstall
|
|||||||
LINK_PRIVATE_LIBRARIES
|
LINK_PRIVATE_LIBRARIES
|
||||||
calamaresui
|
calamaresui
|
||||||
Qt5::Network
|
Qt5::Network
|
||||||
${YAMLCPP_LIBRARY}
|
yamlcpp
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#ifndef NOTESQMLVIEWSTEP_H
|
#ifndef NOTESQMLVIEWSTEP_H
|
||||||
#define NOTESQMLVIEWSTEP_H
|
#define NOTESQMLVIEWSTEP_H
|
||||||
|
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "locale/TranslatableConfiguration.h"
|
#include "locale/TranslatableConfiguration.h"
|
||||||
#include "utils/CalamaresUtilsSystem.h"
|
#include "utils/CalamaresUtilsSystem.h"
|
||||||
#include "utils/Variant.h"
|
#include "utils/Variant.h"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
@ -53,18 +53,12 @@ calamares_add_plugin( packagechooser
|
|||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
if( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
|
||||||
Tests.cpp
|
|
||||||
TEST_NAME
|
|
||||||
packagechoosertest
|
packagechoosertest
|
||||||
LINK_LIBRARIES
|
GUI
|
||||||
${CALAMARES_LIBRARIES}
|
SOURCES
|
||||||
|
Tests.cpp
|
||||||
|
LIBRARIES
|
||||||
calamares_viewmodule_packagechooser
|
calamares_viewmodule_packagechooser
|
||||||
Qt5::Core
|
|
||||||
Qt5::Test
|
|
||||||
Qt5::Gui
|
|
||||||
${_extra_libraries}
|
${_extra_libraries}
|
||||||
)
|
)
|
||||||
calamares_automoc( packagechoosertest)
|
|
||||||
endif()
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#ifndef PACKAGECHOOSERVIEWSTEP_H
|
#ifndef PACKAGECHOOSERVIEWSTEP_H
|
||||||
#define PACKAGECHOOSERVIEWSTEP_H
|
#define PACKAGECHOOSERVIEWSTEP_H
|
||||||
|
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "locale/TranslatableConfiguration.h"
|
#include "locale/TranslatableConfiguration.h"
|
||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
#include "viewpages/ViewStep.h"
|
#include "viewpages/ViewStep.h"
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
#include "core/PartitionActions.h"
|
#include "core/PartitionActions.h"
|
||||||
|
|
||||||
|
@ -21,16 +21,12 @@ include_directories(
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
if( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test( ${partitionjobtests_SRCS}
|
partitionjobtests
|
||||||
TEST_NAME partitionjobtests
|
SOURCES ${partitionjobtests_SRCS}
|
||||||
LINK_LIBRARIES
|
LIBRARIES
|
||||||
${CALAMARES_LIBRARIES}
|
|
||||||
kpmcore
|
kpmcore
|
||||||
Qt5::Core
|
)
|
||||||
Qt5::Test
|
if( TARGET partitionjobtests )
|
||||||
)
|
|
||||||
|
|
||||||
set_target_properties( partitionjobtests PROPERTIES AUTOMOC TRUE )
|
|
||||||
target_compile_definitions( partitionjobtests PRIVATE ${_partition_defs} )
|
target_compile_definitions( partitionjobtests PRIVATE ${_partition_defs} )
|
||||||
endif()
|
endif()
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
#include "CppJob.h"
|
#include "CppJob.h"
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
|
|
||||||
|
@ -8,17 +8,10 @@ calamares_add_plugin( shellprocess
|
|||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
if( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
|
||||||
Tests.cpp
|
|
||||||
TEST_NAME
|
|
||||||
shellprocesstest
|
shellprocesstest
|
||||||
LINK_LIBRARIES
|
SOURCES
|
||||||
${CALAMARES_LIBRARIES}
|
Tests.cpp
|
||||||
calamaresui
|
LIBRARIES
|
||||||
${YAMLCPP_LIBRARY}
|
yamlcpp
|
||||||
Qt5::Core
|
)
|
||||||
Qt5::Test
|
|
||||||
)
|
|
||||||
calamares_automoc( shellprocesstest )
|
|
||||||
endif()
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#define SHELLPROCESSJOB_H
|
#define SHELLPROCESSJOB_H
|
||||||
|
|
||||||
#include "CppJob.h"
|
#include "CppJob.h"
|
||||||
#include "PluginDllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include "utils/CommandList.h"
|
#include "utils/CommandList.h"
|
||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
class SummaryPage;
|
class SummaryPage;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "TrackingType.h"
|
#include "TrackingType.h"
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
|
@ -39,17 +39,11 @@ calamares_add_plugin( users
|
|||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
if( ECM_FOUND AND BUILD_TESTING )
|
calamares_add_test(
|
||||||
ecm_add_test(
|
passwordtest
|
||||||
|
SOURCES
|
||||||
PasswordTests.cpp
|
PasswordTests.cpp
|
||||||
SetPasswordJob.cpp
|
SetPasswordJob.cpp
|
||||||
TEST_NAME
|
LIBRARIES
|
||||||
passwordtest
|
|
||||||
LINK_LIBRARIES
|
|
||||||
${CALAMARES_LIBRARIES}
|
|
||||||
Qt5::Core
|
|
||||||
Qt5::Test
|
|
||||||
${CRYPT_LIBRARIES}
|
${CRYPT_LIBRARIES}
|
||||||
)
|
)
|
||||||
calamares_automoc( passwordtest )
|
|
||||||
endif()
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <utils/PluginFactory.h>
|
#include <utils/PluginFactory.h>
|
||||||
#include <viewpages/ViewStep.h>
|
#include <viewpages/ViewStep.h>
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
#include "viewpages/ViewStep.h"
|
#include "viewpages/ViewStep.h"
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <DllMacro.h>
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
Loading…
Reference in New Issue
Block a user