KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_jobs_runner.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <common.h>
#include <gestfich.h>
#include <jobs/job_special_execute.h>
#include <paths.h>
#include <project.h>
#include <settings/settings_manager.h>
#include <wx/process.h>
#include <wx/txtstrm.h>
#include <wx/filename.h>
#include <wx/dir.h>
#include <wx/file.h>
#include <wx/stdpaths.h>

Go to the source code of this file.

Functions

static int executeViaShell (const wxString &aCmd, wxString &aOutput)
 Drive the production ExecuteCommandThroughShell (the exact function jobsets use) and capture its stdout so the shell-wrapping behaviour is tested directly rather than through a copy.
 
 BOOST_AUTO_TEST_CASE (SimpleCommand)
 
 BOOST_AUTO_TEST_CASE (GlobExpansion)
 
 BOOST_AUTO_TEST_CASE (PipeSupport)
 
 BOOST_AUTO_TEST_CASE (ExitCodePropagation)
 
 BOOST_AUTO_TEST_CASE (CommandWithSingleQuotes)
 
 BOOST_AUTO_TEST_CASE (AbsolutePathWithSpaces)
 Regression for https://gitlab.com/kicad/code/kicad/-/issues/24226.
 
 BOOST_AUTO_TEST_CASE (ExecutableDirectoryOnPath)
 
 BOOST_AUTO_TEST_CASE (BundledPythonDirectory)
 
 BOOST_AUTO_TEST_CASE (ExecuteBuiltinVariables)
 
 BOOST_AUTO_TEST_CASE (BundledPythonLookup)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/10]

BOOST_AUTO_TEST_CASE ( AbsolutePathWithSpaces )

Regression for https://gitlab.com/kicad/code/kicad/-/issues/24226.

An absolute path containing spaces, quoted by the user, must reach the interpreter intact. The old array-form invocation on Windows let wxExecute backslash-escape the quotes and cmd.exe then mangled the path. Run an interpreter located at a spaced absolute path against a script that prints a sentinel and verify the sentinel comes back.

Definition at line 212 of file test_jobs_runner.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), executeViaShell(), and result.

◆ BOOST_AUTO_TEST_CASE() [2/10]

BOOST_AUTO_TEST_CASE ( BundledPythonDirectory )

◆ BOOST_AUTO_TEST_CASE() [3/10]

BOOST_AUTO_TEST_CASE ( BundledPythonLookup )

◆ BOOST_AUTO_TEST_CASE() [4/10]

BOOST_AUTO_TEST_CASE ( CommandWithSingleQuotes )

Definition at line 170 of file test_jobs_runner.cpp.

References BOOST_CHECK_EQUAL(), executeViaShell(), and result.

◆ BOOST_AUTO_TEST_CASE() [5/10]

BOOST_AUTO_TEST_CASE ( ExecutableDirectoryOnPath )

Definition at line 268 of file test_jobs_runner.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), executeViaShell(), and result.

◆ BOOST_AUTO_TEST_CASE() [6/10]

◆ BOOST_AUTO_TEST_CASE() [7/10]

BOOST_AUTO_TEST_CASE ( ExitCodePropagation )

Definition at line 152 of file test_jobs_runner.cpp.

References BOOST_CHECK_EQUAL(), executeViaShell(), and result.

◆ BOOST_AUTO_TEST_CASE() [8/10]

BOOST_AUTO_TEST_CASE ( GlobExpansion )

Definition at line 94 of file test_jobs_runner.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), executeViaShell(), and result.

◆ BOOST_AUTO_TEST_CASE() [9/10]

BOOST_AUTO_TEST_CASE ( PipeSupport )

Definition at line 136 of file test_jobs_runner.cpp.

References BOOST_CHECK(), BOOST_CHECK_EQUAL(), executeViaShell(), and result.

◆ BOOST_AUTO_TEST_CASE() [10/10]

BOOST_AUTO_TEST_CASE ( SimpleCommand )

Definition at line 81 of file test_jobs_runner.cpp.

References BOOST_CHECK(), BOOST_CHECK_EQUAL(), executeViaShell(), and result.

◆ executeViaShell()

static int executeViaShell ( const wxString & aCmd,
wxString & aOutput )
static

Drive the production ExecuteCommandThroughShell (the exact function jobsets use) and capture its stdout so the shell-wrapping behaviour is tested directly rather than through a copy.

Definition at line 50 of file test_jobs_runner.cpp.

References ExecuteCommandThroughShell(), executeViaShell(), process, and result.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and executeViaShell().