Skip to content

Commit

Permalink
Add another relative path for radiantcore in tests
Browse files Browse the repository at this point in the history
Running drtest directly from the build directory without installing to the
prefix (as dpkg-buildpackage does) requires a third search path for the
radiantcore module. This one is calculated relative to the drtest binary rather
than any compiled-in path.
  • Loading branch information
Matthew Mott committed May 3, 2021
1 parent 6eb1609 commit afef8ae
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/TestContext.h
Expand Up @@ -111,15 +111,21 @@ class TestContext :

#ifdef TEST_BASE_PATH
// Look for a radiantcore module in the actual radiantcore/ source
// directory. This will not be valid for out-of-source builds.
// directory. This will not be valid for out-of-source builds, but is
// required for in-source builds.
fs::path libraryPath(TEST_BASE_PATH);
libraryPath /= "../radiantcore/";

paths.push_back(libraryPath.string());

// Look for a radiantcore module relative to the executable (drtest).
// This will be needed if running drtest directly from the build
// directory, without installing to a prefix (which dpkg-buildpackage
// does).
paths.push_back(getApplicationPath() + "../radiantcore/");
#endif

// Also look for modules in the module install destination directory
// (for out-of-source builds)
// (for out-of-source builds installed to the final prefix).
auto libBasePath = os::standardPathWithSlash(getLibraryBasePath());

// Don't load modules from the plugins/ folder, as these are relying on
Expand Down

0 comments on commit afef8ae

Please sign in to comment.