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 26f2bf1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ jobs:
run: ${{ matrix.compiler_cache }} -s

- name: "Test"
run: ctest --timeout 45 ${{ matrix.ctest_args }}
run: ctest --timeout 60 ${{ matrix.ctest_args }}
working-directory: build
env:
# Render analyzer waveform tests to an offscreen buffer
Expand Down
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
35 changes: 35 additions & 0 deletions src/test/coreservicestest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <gtest/gtest.h>

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

class CoreServicesTest : public MixxxTest {
};

TEST_F(CoreServicesTest, 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 26f2bf1

Please sign in to comment.