Test suite cleanups, convert Coord2D to Vector<T, 2>.

- The standard SimpleSuite setup now include flags to suppress printing
  the report in addition to silencing the test runs. This is useful in
  automated testing.
- Point2D and Polar2D in Coord2D have been converted from custom types
  to Vector<int, 2> and Vector<double, 2>, respectively.
This commit is contained in:
2023-10-20 19:05:55 -07:00
parent 68ed5e0aca
commit 4b1007123a
14 changed files with 409 additions and 143 deletions

View File

@@ -122,9 +122,11 @@ RotateRadians()
int
main(int argc, char *argv[])
{
auto noReport = false;
auto quiet = false;
auto flags = new scsl::Flags("test_orientation",
"This test validates various orientation-related components in scmp.");
flags->Register("-n", false, "don't print the report");
flags->Register("-q", false, "suppress test output");
auto parsed = flags->Parse(argc, argv);
@@ -134,6 +136,7 @@ main(int argc, char *argv[])
}
sctest::SimpleSuite suite;
flags->GetBool("-n", noReport);
flags->GetBool("-q", quiet);
if (quiet) {
suite.Silence();
@@ -147,6 +150,6 @@ main(int argc, char *argv[])
delete flags;
auto result = suite.Run();
std::cout << suite.GetReport() << "\n";
if (!noReport) { std::cout << suite.GetReport() << "\n"; }
return result ? 0 : 1;
}