KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_triangulation_benchmark.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <geometry/shape_poly_set.h>
#include <core/profile.h>
#include <nlohmann/json.hpp>
#include <algorithm>
#include <cmath>
#include <filesystem>
#include <fstream>
#include <map>
#include <numeric>
#include <sstream>
#include <string>
#include <vector>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (BenchmarkAllExtractedPolygons)
 
 if (!fs::exists(dataDir)||fs::is_empty(dataDir))
 
 for (const auto &entry :fs::directory_iterator(dataDir))
 
 for (const auto &polyFile :polyFiles)
 
std::ofstream jsonFile (jsonPath)
 

Variables

std::vector< fs::pathpolyFiles
 
int totalTriangles = 0
 
int totalSpikeyTri = 0
 
int totalZones = 0
 
double totalTimeUs = 0.0
 
double totalArea = 0.0
 
nlohmann::json boardsJson = nlohmann::json::array()
 
nlohmann::json globalJson = totalTriangles
 
nlohmann::json metadataJson = static_cast<int>( polyFiles.size() )
 
nlohmann::json jsonOutput = metadataJson
 
fs::path jsonPath = fs::path( dataDir ) / "triangulation_status.json"
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( BenchmarkAllExtractedPolygons )

◆ for() [1/2]

for ( const auto &entry :fs::directory_iteratordataDir)

Definition at line 733 of file test_triangulation_benchmark.cpp.

References polyFiles.

◆ for() [2/2]

for ( const auto &polyFile :polyFiles )

◆ if()

if ( ! fs::existsdataDir)||fs::is_empty(dataDir)

Definition at line 725 of file test_triangulation_benchmark.cpp.

References BOOST_TEST_MESSAGE().

◆ jsonFile()

std::ofstream jsonFile ( jsonPath )

Variable Documentation

◆ boardsJson

nlohmann::json boardsJson = nlohmann::json::array()

Definition at line 747 of file test_triangulation_benchmark.cpp.

Referenced by for().

◆ globalJson

globalJson["spikey_ratio"] = totalTriangles

Definition at line 792 of file test_triangulation_benchmark.cpp.

◆ jsonOutput

jsonOutput["boards"] = metadataJson

Definition at line 805 of file test_triangulation_benchmark.cpp.

Referenced by jsonFile().

◆ jsonPath

fs::path jsonPath = fs::path( dataDir ) / "triangulation_status.json"

Definition at line 810 of file test_triangulation_benchmark.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and jsonFile().

◆ metadataJson

metadataJson["zone_count"] = static_cast<int>( polyFiles.size() )

Definition at line 801 of file test_triangulation_benchmark.cpp.

◆ polyFiles

std::vector<fs::path> polyFiles

Definition at line 731 of file test_triangulation_benchmark.cpp.

◆ totalArea

◆ totalSpikeyTri

int totalSpikeyTri = 0

Definition at line 742 of file test_triangulation_benchmark.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and for().

◆ totalTimeUs

double totalTimeUs = 0.0

Definition at line 744 of file test_triangulation_benchmark.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and for().

◆ totalTriangles

int totalTriangles = 0

◆ totalZones

int totalZones = 0