KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_jobs_runner.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <gestfich.h>
#include <wx/process.h>
#include <wx/txtstrm.h>
#include <wx/filename.h>
#include <wx/dir.h>
#include <wx/file.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.
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/6]

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 202 of file test_jobs_runner.cpp.

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

◆ BOOST_AUTO_TEST_CASE() [2/6]

BOOST_AUTO_TEST_CASE ( CommandWithSingleQuotes )

◆ BOOST_AUTO_TEST_CASE() [3/6]

BOOST_AUTO_TEST_CASE ( ExitCodePropagation )

Definition at line 144 of file test_jobs_runner.cpp.

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

◆ BOOST_AUTO_TEST_CASE() [4/6]

BOOST_AUTO_TEST_CASE ( GlobExpansion )

◆ BOOST_AUTO_TEST_CASE() [5/6]

BOOST_AUTO_TEST_CASE ( PipeSupport )

Definition at line 128 of file test_jobs_runner.cpp.

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

◆ BOOST_AUTO_TEST_CASE() [6/6]

BOOST_AUTO_TEST_CASE ( SimpleCommand )

Definition at line 73 of file test_jobs_runner.cpp.

References BOOST_CHECK_EQUAL(), executeViaShell(), output, 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 42 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(), and executeViaShell().