KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_job_output_path.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include <boost/test/unit_test.hpp>
21
22#include <qa_utils/file_utils.h>
23
25
26#include <wx/filename.h>
27
28
29BOOST_AUTO_TEST_SUITE( JobOutputPath )
30
31
32// A jobset drill job keeps an absolute output directory like the file based jobs do
33BOOST_AUTO_TEST_CASE( DrillAbsoluteDirectoryIsKept )
34{
35 KI_TEST::SCOPED_TEMP_DIR projectRoot( wxS( "kicad_job_output_path_prj" ) );
36 KI_TEST::SCOPED_TEMP_DIR tempRoot( wxS( "kicad_job_output_path_tmp" ) );
37
38 wxString dataDir = wxFileName::DirName( wxString::FromUTF8( ( projectRoot.Path() / "data" ).string().c_str() ) )
39 .GetFullPath();
40
43
44 drill.SetConfiguredOutputPath( dataDir );
45 drill.SetTempOutputDirectory( wxString::FromUTF8( tempRoot.Path().string().c_str() ) );
46
47 BOOST_CHECK_EQUAL( drill.GetFullOutputPath( nullptr ), dataDir );
48}
49
50
void SetConfiguredOutputPath(const wxString &aPath)
Sets the configured output path for the job, this path is always saved to file.
Definition job.cpp:181
wxString GetFullOutputPath(PROJECT *aProject) const
Returns the full output path for the job, taking into account the configured output path,...
Definition job.cpp:174
bool GetOutputPathIsDirectory() const
Definition job.h:266
void SetTempOutputDirectory(const wxString &aBase)
Sets the temporary output directory for the job, this is used to prefix with a given output path when...
Definition job.cpp:86
const std::filesystem::path & Path() const
Get the path to the temporary directory as a std::filesystem::path.
Definition file_utils.h:61
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_REQUIRE(res.columns()==1)
BOOST_AUTO_TEST_SUITE_END()