KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_api_jobs.cpp File Reference
#include <fstream>
#include <set>
#include <sstream>
#include <string>
#include <wx/filename.h>
#include <boost/test/unit_test.hpp>
#include <qa_utils/file_utils.h>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include "api_e2e_utils.h"
#include <api/board/board_jobs.pb.h>
#include <api/board/board_types.pb.h>
#include <api/schematic/schematic_jobs.pb.h>

Go to the source code of this file.

Functions

bool textFilesMatch (const wxString &aGoldenPath, const wxString &aGeneratedPath, int aSkipLines)
 Compare two text files line-by-line, optionally skipping the first aSkipLines lines of each file (to ignore timestamps / version headers).
 
static size_t countOccurrences (const std::string &aHaystack, const std::string &aNeedle)
 
static std::set< std::string > collectColours (const std::string &aSvg)
 Return every distinct #RRGGBB literal appearing in aSvg.
 
 BOOST_FIXTURE_TEST_CASE (ExportBoardSvg, API_SERVER_E2E_FIXTURE)
 
static bool pngDimensions (const wxString &aPath, uint32_t &aWidth, uint32_t &aHeight)
 
 BOOST_FIXTURE_TEST_CASE (ExportSchematicPng, API_SERVER_E2E_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (ExportBoardDrill, API_SERVER_E2E_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (ExportBoardPng, API_SERVER_E2E_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (ExportSchematicNetlist, API_SERVER_E2E_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (ExportSchematicBom, API_SERVER_E2E_FIXTURE)
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/6]

BOOST_FIXTURE_TEST_CASE ( ExportBoardDrill ,
API_SERVER_E2E_FIXTURE  )

◆ BOOST_FIXTURE_TEST_CASE() [2/6]

◆ BOOST_FIXTURE_TEST_CASE() [3/6]

◆ BOOST_FIXTURE_TEST_CASE() [4/6]

BOOST_FIXTURE_TEST_CASE ( ExportSchematicBom ,
API_SERVER_E2E_FIXTURE  )

◆ BOOST_FIXTURE_TEST_CASE() [5/6]

BOOST_FIXTURE_TEST_CASE ( ExportSchematicNetlist ,
API_SERVER_E2E_FIXTURE  )

◆ BOOST_FIXTURE_TEST_CASE() [6/6]

◆ collectColours()

static std::set< std::string > collectColours ( const std::string & aSvg)
static

Return every distinct #RRGGBB literal appearing in aSvg.

Definition at line 117 of file test_api_jobs.cpp.

Referenced by BOOST_FIXTURE_TEST_CASE().

◆ countOccurrences()

static size_t countOccurrences ( const std::string & aHaystack,
const std::string & aNeedle )
static

Definition at line 100 of file test_api_jobs.cpp.

Referenced by BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().

◆ pngDimensions()

static bool pngDimensions ( const wxString & aPath,
uint32_t & aWidth,
uint32_t & aHeight )
static

Definition at line 208 of file test_api_jobs.cpp.

Referenced by BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().

◆ textFilesMatch()

bool textFilesMatch ( const wxString & aGoldenPath,
const wxString & aGeneratedPath,
int aSkipLines )

Compare two text files line-by-line, optionally skipping the first aSkipLines lines of each file (to ignore timestamps / version headers).

Returns true if files are identical after the skipped prefix, false otherwise. On mismatch the first differing line pair is logged via BOOST_TEST_MESSAGE.

Definition at line 44 of file test_api_jobs.cpp.

References BOOST_TEST_MESSAGE().

Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().