File: test_utilities.h

package info (click to toggle)
graphviz 14.0.5-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 139,388 kB
  • sloc: ansic: 141,938; cpp: 11,957; python: 7,766; makefile: 4,043; yacc: 3,030; xml: 2,972; tcl: 2,495; sh: 1,388; objc: 1,159; java: 560; lex: 423; perl: 243; awk: 156; pascal: 139; php: 58; ruby: 49; cs: 31; sed: 1
file content (56 lines) | stat: -rw-r--r-- 2,029 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once

#include <filesystem>
#include <string.h>
#include <string>
#include <string_view>
#include <unordered_set>

/// node shapes

extern const std::unordered_set<std::string_view> all_node_shapes;
extern const std::unordered_set<std::string_view>
    node_shapes_consisting_of_ellipse;
extern const std::unordered_set<std::string_view>
    node_shapes_consisting_of_ellipse_and_polyline;
extern const std::unordered_set<std::string_view>
    node_shapes_consisting_of_path;
extern const std::unordered_set<std::string_view>
    node_shapes_consisting_of_polygon;
extern const std::unordered_set<std::string_view>
    node_shapes_consisting_of_polygon_and_polyline;
extern const std::unordered_set<std::string_view> node_shapes_without_svg_shape;

bool contains_ellipse_shape(std::string_view shape);
bool contains_multiple_shapes_with_different_fill(std::string_view shape);
bool contains_polygon_shape(std::string_view shape);
bool contains_polyline_shape(std::string_view shape);

bool is_polygon_shape(std::string_view shape);

/// arrow shapes
extern const std::unordered_set<std::string_view>
    primitive_polygon_arrow_shapes;
extern const std::unordered_set<std::string_view>
    primitive_polygon_and_polyline_arrow_shapes;
extern const std::unordered_set<std::string_view> all_primitive_arrow_shapes;
extern const std::unordered_set<std::string_view>
    primitive_arrow_shapes_without_closed_svg_shape;

/// arrow shape modifiers
extern const std::unordered_set<std::string_view> all_arrow_shape_modifiers;

/// rank directions
extern const std::unordered_set<std::string_view> all_rank_directions;

/// edge directions
extern const std::unordered_set<std::string_view> all_edge_directions;

/// misc utilities

/// get the base name of the test case file without file extension
#define AUTO_NAME() std::filesystem::path(__FILE__).stem().string()

void write_to_file(const std::filesystem::path &directory,
                   const std::filesystem::path &filename,
                   std::string_view text);