From 3af8d7c7ae05bf868591429ce2f9995e28a2984e Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 11 Jan 2021 18:57:07 +0000 Subject: [PATCH] Minor tweaks as used for testing --- Makefile | 2 +- data/carla-single | 9 +++++---- source/bridges-plugin/CarlaBridgePlugin.cpp | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 7d638989d..9d9db7739 100644 --- a/Makefile +++ b/Makefile @@ -440,6 +440,7 @@ stoat: install_main: # Create directories install -d $(DESTDIR)$(BINDIR) + install -d $(DESTDIR)$(DATADIR)/carla/resources ifeq ($(LINUX),true) install -d $(DESTDIR)$(LIBDIR)/carla/jack else @@ -465,7 +466,6 @@ ifeq ($(HAVE_PYQT),true) install -d $(DESTDIR)$(DATADIR)/icons/hicolor/256x256/apps install -d $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps install -d $(DESTDIR)$(DATADIR)/mime/packages - install -d $(DESTDIR)$(DATADIR)/carla/resources install -d $(DESTDIR)$(DATADIR)/carla/resources/translations install -d $(DESTDIR)$(DATADIR)/carla/modgui install -d $(DESTDIR)$(DATADIR)/carla/patchcanvas diff --git a/data/carla-single b/data/carla-single index 00905e579..6d25d9c57 100755 --- a/data/carla-single +++ b/data/carla-single @@ -76,6 +76,7 @@ if len(sys.argv) < 2: # Initialize variables to null ARCH = os.getenv("CARLA_BRIDGE_PLUGIN_BINARY_TYPE", "native") +TESTING = os.getenv("CARLA_BRIDGE_TESTING", None) FORMAT = "none" FILENAME = "" LABEL = "" @@ -164,7 +165,7 @@ if len(sys.argv) > arg: BRIDGE = os.path.join(CARLA_LIBDIR, "carla-bridge-" + ARCH) -if ARCH in ("win32", "win64"): +if ARCH in ("win32", "win64") or TESTING in ("win32", "win64"): BRIDGE = BRIDGE + ".exe" # -------------------------------------------------------------------------------------------------------- @@ -182,7 +183,7 @@ if not os.path.exists(CARLA_RESDIR): # Check for existing arch binary if not os.path.exists(BRIDGE): - print("Carla plugin bridge for the requested arch (%s) does not exist" % (ARCH,)) + print("Carla plugin bridge (%s) for the requested arch (%s) does not exist" % (os.path.basename(BRIDGE), ARCH,)) sys.exit(2) # -------------------------------------------------------------------------------------------------------- @@ -241,9 +242,9 @@ command = [] if os.getenv("CARLA_BRIDGE_PLUGIN_BINARY_TYPE") is not None: BRIDGE = os.path.join(CARLA_LIBDIR, "carla-bridge-native") -elif ARCH == "win32": +elif ARCH == "win32" or TESTING == "win32": command.append("wine") -elif ARCH == "win64": +elif ARCH == "win64" or TESTING == "win64": command.append("wine64") command.append(BRIDGE) diff --git a/source/bridges-plugin/CarlaBridgePlugin.cpp b/source/bridges-plugin/CarlaBridgePlugin.cpp index 6e6580e0f..d53b3601f 100644 --- a/source/bridges-plugin/CarlaBridgePlugin.cpp +++ b/source/bridges-plugin/CarlaBridgePlugin.cpp @@ -255,7 +255,9 @@ public: fUsingBridge = useBridge; fUsingExec = true; - if (! useBridge) + const bool testing = std::getenv("CARLA_BRIDGE_TESTING") != nullptr; + + if (! useBridge && ! testing) { const CarlaPluginInfo* const pInfo = carla_get_plugin_info(gHostHandle, 0); CARLA_SAFE_ASSERT_RETURN(pInfo != nullptr,); @@ -281,8 +283,6 @@ public: } gIsInitiated = true; - - const bool testing = std::getenv("CARLA_BRIDGE_TESTING") != nullptr; int64_t timeToEnd = 0; if (testing)