1. Adds a `libdevilution_so` target when tests are enabled. 2. Each test file is now a separate binary target linked against `libdevilutionx_so` (can now run tests in parallel). 3. Tests are now defined in a separate `test/CMakeLists.txt` file. 4. Building the tests is now controlled by the standard `BUILD_TESTING` option (defined by CTest). 5. Tests are now built by default. 6. On CI, test errors are now reported. Also: * `.clang-format`: Enable SortIncludes in tests * `path_test.cpp`: Fix -Wsign-compare
17 lines
457 B
C++
17 lines
457 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include "diablo.h"
|
|
#include "utils/paths.h"
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
// Disable error dialogs.
|
|
devilution::gbQuietMode = true;
|
|
|
|
// Let the tests find `devilutionx.mpq` or `assets/`.
|
|
devilution::paths::SetAssetsPath(devilution::paths::BasePath() + "../assets");
|
|
devilution::paths::SetBasePath(devilution::paths::BasePath() + "..");
|
|
|
|
testing::InitGoogleTest(&argc, argv);
|
|
return RUN_ALL_TESTS();
|
|
}
|