MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / main

Function main

tests/cpu/UnitTestMain.cpp:46–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44#endif
45
46int main(int argc, const char ** argv)
47{
48 std::cerr << "\n OpenColorIO_Core_Unit_Tests \n\n";
49
50 // Make sure OptimizationFlags env variable is turned off during tests and
51 // restored at the end.
52 OCIOOptimizationFlagsEnvGuard flagsGuard("");
53
54
55#if !defined(NDEBUG) && defined(_WIN32)
56 // Disable the 'assert' dialog box in debug mode.
57 _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
58#endif
59
60 bool printHelp = false;
61 bool stopOnFirstError = false;
62
63 // Note that empty strings mean to run all the unit tests.
64 std::string filter, utestGroupAllowed, utestNameAllowed;
65#if defined(ENABLE_SIMD_USAGE)
66 bool no_accel = false;
67 bool sse2 = false;
68 bool avx = false;
69 bool avx2 = false;
70 bool avx512 = false;
71 bool f16c = false;
72#endif
73 ArgParse ap;
74 ap.options("\nCommand line arguments:\n",
75 "--help", &printHelp, "Print help message",
76 "--stop_on_error", &stopOnFirstError, "Stop on the first error",
77#if defined(ENABLE_SIMD_USAGE)
78 "--no_accel", &no_accel, "Disable ALL Accelerated features",
79 "--sse2", &sse2, "Enable SSE2 Accelerated features",
80 "--avx", &avx, "Enable AVX Accelerated features",
81 "--avx2", &avx2, "Enable AVX2 Accelerated features",
82 "--avx512", &avx512, "Enable AVX512 Accelerated features",
83 "--f16c", &f16c, "Enable F16C Accelerated features (only used with AVX/AVX2)",
84#endif
85 "--run_only %s", &filter, "Run only some unit tests\n"
86 "\tex: --run_only \"FileRules/clone\"\n"
87 "\tex: --run_only FileRules i.e. \"FileRules/*\"\n"
88 "\tex: --run_only /clone i.e. \"*/clone\"\n",
89 nullptr);
90
91 if (ap.parse(argc, argv) < 0)
92 {
93 std::cerr << ap.geterror() << std::endl;
94 ap.usage();
95 return 1;
96 }
97
98 if (printHelp)
99 {
100 ap.usage();
101 return 1;
102 }
103

Callers

nothing calls this directly

Calls 15

SplitFunction · 0.85
LowerFunction · 0.85
optionsMethod · 0.80
usageMethod · 0.80
hasSSE2Method · 0.80
hasAVXMethod · 0.80
hasAVX2Method · 0.80
hasAVX512Method · 0.80
hasF16CMethod · 0.80
TrimFunction · 0.50
parseMethod · 0.45
geterrorMethod · 0.45

Tested by

no test coverage detected