mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
1b67d1dc77
* fix utf-8 handling around env-vars * fix file opening errors related to unicode * add uncaught exception handler in `gk` to ensure something is logged * gracefully fail if window icon cant be loaded and work with unicode * linux fix and add changes to vendor file
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
|
|
|
|
#include "common/log/log.h"
|
|
#include "common/util/FileUtil.h"
|
|
#include "common/util/os.h"
|
|
#include <common/util/unicode_util.h>
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
// 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
|
|
|
|
int main(int argc, char** argv) {
|
|
fs::u8arguments u8guard(argc, argv);
|
|
if (!u8guard.valid()) {
|
|
std::cerr << "Bad encoding, needs UTF-8." << std::endl;
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
// hopefully get a debug print on github actions
|
|
setup_cpu_info();
|
|
file_util::setup_project_path(std::nullopt);
|
|
lg::initialize();
|
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
// Re-init failed folder
|
|
std::string failedFolder = file_util::get_file_path({"test/goalc/source_generated/failed/"});
|
|
if (fs::exists(failedFolder)) {
|
|
fs::remove_all(failedFolder);
|
|
}
|
|
fs::create_directory(failedFolder);
|
|
|
|
return RUN_ALL_TESTS();
|
|
}
|