2021-03-03 15:42:55 -05:00
|
|
|
#include <filesystem>
|
|
|
|
|
|
|
|
#include "common/log/log.h"
|
2022-06-22 23:37:46 -04:00
|
|
|
#include "common/util/FileUtil.h"
|
2022-02-18 23:01:05 -05:00
|
|
|
#include "common/util/os.h"
|
2020-10-03 18:32:01 -04:00
|
|
|
|
2022-06-22 23:37:46 -04:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
2021-02-05 15:00:17 -05:00
|
|
|
// Running subsets of tests, see:
|
|
|
|
// -
|
|
|
|
// https://github.com/google/googletest/blob/620659ed92829a88ee34134c782bf5b5aa5a0a0c/googletest/docs/advanced.md#running-a-subset-of-the-tests
|
|
|
|
// This can set via:
|
|
|
|
// - --gtest_filter="" CLI arg
|
|
|
|
// - 'GTEST_FILTER' environment variable,
|
|
|
|
// - or below in code by adding `::testing::GTEST_FLAG(filter) = "Test_Cases1*";` below
|
|
|
|
//
|
|
|
|
// I've set things up so VS has a run configuration that runs all tests with "Draft" in the name
|
|
|
|
// to make it easier to test a subset of tests
|
|
|
|
|
2020-08-22 22:30:12 -04:00
|
|
|
int main(int argc, char** argv) {
|
2022-02-18 23:01:05 -05:00
|
|
|
// hopefully get a debug print on github actions
|
|
|
|
setup_cpu_info();
|
2022-04-15 18:01:47 -04:00
|
|
|
file_util::setup_project_path(std::nullopt);
|
2021-03-03 15:42:55 -05:00
|
|
|
lg::initialize();
|
2021-02-22 01:03:14 -05:00
|
|
|
|
2020-08-22 22:30:12 -04:00
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
2020-10-03 18:32:01 -04:00
|
|
|
|
2020-10-09 13:24:55 -04:00
|
|
|
// Re-init failed folder
|
|
|
|
std::string failedFolder = file_util::get_file_path({"test/goalc/source_generated/failed/"});
|
2020-10-03 18:32:01 -04:00
|
|
|
if (std::filesystem::exists(failedFolder)) {
|
2020-10-09 13:24:55 -04:00
|
|
|
std::filesystem::remove_all(failedFolder);
|
|
|
|
}
|
|
|
|
std::filesystem::create_directory(failedFolder);
|
2020-10-03 18:32:01 -04:00
|
|
|
|
2020-08-22 22:30:12 -04:00
|
|
|
return RUN_ALL_TESTS();
|
2021-02-22 01:03:14 -05:00
|
|
|
}
|