Replace boost::filesystem with std::filesystem
Our minimum C++ version is C++17, which has std::filesystem, so ditch the boost dependency and use the standard library instead. (this only affects temp file creation in the QA suite anyway).
This commit is contained in:
parent
ade29c8577
commit
c9eefa7ad7
|
@ -23,6 +23,8 @@
|
|||
|
||||
#include <pcbnew_utils/board_test_utils.h>
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include <wx/filename.h>
|
||||
#include <board.h>
|
||||
#include <board_design_settings.h>
|
||||
|
@ -35,12 +37,9 @@
|
|||
#include <tool/tool_manager.h>
|
||||
#include <zone_filler.h>
|
||||
|
||||
// For the temp directory logic: can be std::filesystem in C++17
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <board_commit.h>
|
||||
|
||||
|
||||
#define CHECK_ENUM_CLASS_EQUAL( L, R ) \
|
||||
BOOST_CHECK_EQUAL( static_cast<int>( L ), static_cast<int>( R ) )
|
||||
|
||||
|
@ -59,7 +58,7 @@ void BOARD_DUMPER::DumpBoardToFile( BOARD& aBoard, const std::string& aName ) co
|
|||
if( !m_dump_boards )
|
||||
return;
|
||||
|
||||
auto path = boost::filesystem::temp_directory_path() / aName;
|
||||
auto path = std::filesystem::temp_directory_path() / aName;
|
||||
path += ".kicad_pcb";
|
||||
|
||||
BOOST_TEST_MESSAGE( "Dumping board file: " << path.string() );
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
# or you may write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
find_package( Boost COMPONENTS unit_test_framework filesystem system REQUIRED )
|
||||
find_package( Boost COMPONENTS unit_test_framework system REQUIRED )
|
||||
|
||||
set( QA_UTIL_COMMON_SRC
|
||||
stdstream_line_reader.cpp
|
||||
|
@ -50,7 +50,6 @@ target_link_libraries( qa_utils
|
|||
common
|
||||
turtle
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${wxWidgets_LIBRARIES}
|
||||
${LIBBOOST_UNIT_TEST_LIB}
|
||||
|
|
|
@ -72,7 +72,6 @@ target_link_libraries( test_gal_pixel_alignment
|
|||
gal
|
||||
common
|
||||
${PCBNEW_IO_LIBRARIES}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
|
||||
${wxWidgets_LIBRARIES}
|
||||
|
|
|
@ -76,7 +76,6 @@ target_link_libraries( libeval_compiler_test
|
|||
${PCBNEW_IO_LIBRARIES}
|
||||
common
|
||||
pcbcommon
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
|
||||
${wxWidgets_LIBRARIES}
|
||||
|
|
|
@ -64,7 +64,6 @@ target_link_libraries( test_window
|
|||
gal
|
||||
common
|
||||
${PCBNEW_IO_LIBRARIES}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
|
||||
${wxWidgets_LIBRARIES}
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
*/
|
||||
|
||||
#include <bitset>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <board.h>
|
||||
#include <footprint.h>
|
||||
#include <pcb_group.h>
|
||||
|
@ -212,7 +212,7 @@ void testGroupsEqual( const GROUPS& groups1, const GROUPS& groups2 )
|
|||
void testSaveLoad( const std::vector<std::vector<ItemType>>& spec )
|
||||
{
|
||||
std::unique_ptr<BOARD> board1 = createBoard( spec );
|
||||
auto path = boost::filesystem::temp_directory_path() / "group_saveload_tst.kicad_pcb";
|
||||
auto path = std::filesystem::temp_directory_path() / "group_saveload_tst.kicad_pcb";
|
||||
::KI_TEST::DumpBoardToFile( *board1, path.string() );
|
||||
|
||||
std::unique_ptr<BOARD> board2 = ::KI_TEST::ReadBoardFromFileOrStream( path.string() );
|
||||
|
|
|
@ -21,10 +21,11 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include <qa_utils/wx_utils/unit_test_utils.h>
|
||||
#include <pcbnew_utils/board_test_utils.h>
|
||||
#include <pcbnew_utils/board_file_utils.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <board.h>
|
||||
#include <settings/settings_manager.h>
|
||||
|
||||
|
@ -52,7 +53,7 @@ BOOST_FIXTURE_TEST_CASE( RegressionSaveLoadTests, SAVE_LOAD_TEST_FIXTURE )
|
|||
"issue7267",
|
||||
"issue8003" };
|
||||
|
||||
auto savePath = boost::filesystem::temp_directory_path() / "group_saveload_tst.kicad_pcb";
|
||||
auto savePath = std::filesystem::temp_directory_path() / "group_saveload_tst.kicad_pcb";
|
||||
|
||||
for( const wxString& relPath : tests )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue