Skip to content

Commit

Permalink
test: Add CoreServices "smoke test" to check if initialization works
Browse files Browse the repository at this point in the history
Before, CoreServices would cause a debug assertion when initializing it
without other stuff from `MixxxMainWindow`. This is just a smoke test to
verify that it's possible to initialize the `CoreServices` class on its
own, without `MixxxMainWindow.
  • Loading branch information
Holzhaus committed Jul 22, 2021
1 parent dc30c6b commit 9eba44f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,7 @@ add_executable(mixxx-test
src/test/controller_mapping_validation_test.cpp
src/test/controllerscriptenginelegacy_test.cpp
src/test/controlobjecttest.cpp
src/test/coreservicestest.cpp
src/test/coverartcache_test.cpp
src/test/coverartutils_test.cpp
src/test/cratestorage_test.cpp
Expand Down
36 changes: 36 additions & 0 deletions src/test/coreservicestest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include <gtest/gtest.h>

#include "coreservices.h"
#include "test/mixxxtest.h"
#include "util/cmdlineargs.h"

class CoreServicesTest : public MixxxTest {
};

// This test is disabled because it fails on CI for some unknown reason.
TEST_F(CoreServicesTest, DISABLED_TestInitialization) {
// Initialize the app
const int argc = 1;
CmdlineArgs cmdlineArgs;
char progName[] = "mixxxtest";
char safeMode[] = "--safe-mode";
char* argv[] = {progName, safeMode};
cmdlineArgs.parse(argc, argv);

const auto pCoreServices = std::make_unique<mixxx::CoreServices>(cmdlineArgs);
pCoreServices->initializeSettings();
pCoreServices->initializeKeyboard();
pCoreServices->initialize(application());

EXPECT_NE(pCoreServices->getControllerManager(), nullptr);
EXPECT_NE(pCoreServices->getEffectsManager(), nullptr);
EXPECT_NE(pCoreServices->getGuiTick(), nullptr);
EXPECT_NE(pCoreServices->getLV2Backend(), nullptr);
EXPECT_NE(pCoreServices->getLibrary(), nullptr);
EXPECT_NE(pCoreServices->getPlayerManager(), nullptr);
EXPECT_NE(pCoreServices->getScreensaverManager(), nullptr);
EXPECT_NE(pCoreServices->getSettingsManager(), nullptr);
EXPECT_NE(pCoreServices->getSoundManager(), nullptr);
EXPECT_NE(pCoreServices->getVinylControlManager(), nullptr);
EXPECT_NE(pCoreServices->getVisualsManager(), nullptr);
}

0 comments on commit 9eba44f

Please sign in to comment.