Browse Source

Experiments with pipe tests

tags/v1.9.11
falkTX 6 years ago
parent
commit
d0d775a23d
2 changed files with 31 additions and 6 deletions
  1. +18
    -4
      source/tests/CarlaPipeUtils.cpp
  2. +13
    -2
      source/tests/Makefile

+ 18
- 4
source/tests/CarlaPipeUtils.cpp View File

@@ -1,6 +1,6 @@
/* /*
* Carla Utility Tests * Carla Utility Tests
* Copyright (C) 2013-2016 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2013-2018 Filipe Coelho <falktx@falktx.com>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
@@ -16,7 +16,7 @@
*/ */


#include "CarlaPipeUtils.hpp" #include "CarlaPipeUtils.hpp"
#include "juce_core/juce_core.h"
#include "../modules/water/files/File.h"


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


@@ -65,21 +65,30 @@ int main(int argc, const char* argv[])
p.unlockPipe(); p.unlockPipe();


carla_msleep(500); carla_msleep(500);

carla_stderr2("CLIENT idle start"); carla_stderr2("CLIENT idle start");
std::fflush(stdout); std::fflush(stdout);

p.idlePipe(); p.idlePipe();

carla_stderr2("CLIENT idle end"); carla_stderr2("CLIENT idle end");
std::fflush(stdout); std::fflush(stdout);

carla_msleep(500); carla_msleep(500);
} }
else else
{ {
carla_stdout("SERVER STARTED %i", argc); carla_stdout("SERVER STARTED %i", argc);
std::fflush(stdout);


using juce::File;
using juce::String;
using water::File;
using water::String;
String path = File(File::getSpecialLocation(File::currentExecutableFile)).getFullPathName(); String path = File(File::getSpecialLocation(File::currentExecutableFile)).getFullPathName();


#ifdef CARLA_OS_WINDOWS
path = "wine " + path;
#endif

CarlaPipeServer2 p; CarlaPipeServer2 p;
const bool ok = p.startPipeServer(path.toRawUTF8(), "/home/falktx/Videos", "/home/falktx"); const bool ok = p.startPipeServer(path.toRawUTF8(), "/home/falktx/Videos", "/home/falktx");
CARLA_SAFE_ASSERT_RETURN(ok,1); CARLA_SAFE_ASSERT_RETURN(ok,1);
@@ -89,9 +98,14 @@ int main(int argc, const char* argv[])
p.unlockPipe(); p.unlockPipe();


carla_msleep(500); carla_msleep(500);

carla_stderr2("SERVER idle start"); carla_stderr2("SERVER idle start");
std::fflush(stdout);

p.idlePipe(); p.idlePipe();
carla_stderr2("SERVER idle end"); carla_stderr2("SERVER idle end");
std::fflush(stdout);

carla_msleep(500); carla_msleep(500);
} }




+ 13
- 2
source/tests/Makefile View File

@@ -10,22 +10,33 @@ CLANG ?= clang
CXXLANG ?= clang++ CXXLANG ?= clang++


MODULEDIR=../../build/modules/Debug MODULEDIR=../../build/modules/Debug
MODULEDIR=../../build/modules/Release


WINECXX ?= wineg++ WINECXX ?= wineg++


# -------------------------------------------------------------- # --------------------------------------------------------------


BASE_FLAGS = -Wall -Wextra -Werror -pipe -DBUILDING_CARLA -DREAL_BUILD -DDEBUG -O0 -g
BASE_FLAGS = -Wall -Wextra -Werror -pipe -DBUILDING_CARLA -DREAL_BUILD
BASE_FLAGS += -I. -I../backend -I../includes -I../modules -I../utils BASE_FLAGS += -I. -I../backend -I../includes -I../modules -I../utils
BASE_FLAGS += -Wcast-align -Wmissing-declarations BASE_FLAGS += -Wcast-align -Wmissing-declarations
# BASE_FLAGS += -Wcast-qual -Wconversion -Wsign-conversion -Wundef # BASE_FLAGS += -Wcast-qual -Wconversion -Wsign-conversion -Wundef
BASE_FLAGS += -Wformat -Wformat-security -Wredundant-decls -Wshadow -Wstrict-overflow -fstrict-overflow -Wwrite-strings BASE_FLAGS += -Wformat -Wformat-security -Wredundant-decls -Wshadow -Wstrict-overflow -fstrict-overflow -Wwrite-strings
BASE_FLAGS += -Wpointer-arith -Wabi -Winit-self -Wuninitialized -Wunused-parameter BASE_FLAGS += -Wpointer-arith -Wabi -Winit-self -Wuninitialized -Wunused-parameter
# -Wfloat-equal # -Wfloat-equal

LINK_FLAGS =

ifneq ($(CC),clang-3.4) ifneq ($(CC),clang-3.4)
BASE_FLAGS += -Wlogical-op -Wunsafe-loop-optimizations BASE_FLAGS += -Wlogical-op -Wunsafe-loop-optimizations
endif endif


ifeq ($(DEBUG),true)
BASE_FLAGS += -DDEBUG -O0 -g
else
BASE_FLAGS += -O3 -ffast-math -mtune=generic -msse -msse2 -mfpmath=sse -fdata-sections -ffunction-sections
LINK_FLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif

# -------------------------------------------------------------- # --------------------------------------------------------------


ANSI_FLAGS = $(BASE_FLAGS) -DBUILD_ANSI_TEST ANSI_FLAGS = $(BASE_FLAGS) -DBUILD_ANSI_TEST
@@ -136,7 +147,7 @@ ifneq ($(WIN32),true)
endif endif


CarlaPipeUtils.exe: CarlaPipeUtils.cpp ../utils/CarlaPipeUtils.cpp CarlaPipeUtils.exe: CarlaPipeUtils.cpp ../utils/CarlaPipeUtils.cpp
$(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ $(MODULEDIR)/juce_core.a -lole32 -lshlwapi -lversion -lwsock32 -lwininet -lwinmm -lws2_32 -lpthread
$(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ $(MODULEDIR)/water.a -lole32 -lshlwapi -lversion -lwsock32 -lwininet -lwinmm -lws2_32 -lpthread -static


CarlaUtils1: CarlaUtils1.cpp ../utils/*.hpp CarlaUtils1: CarlaUtils1.cpp ../utils/*.hpp
$(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@


Loading…
Cancel
Save