Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,30 @@ jobs:
path: ./Release/Linux/erpcgen/erpcgen
build-mac-gcc:
macos:
xcode: 13.2.1
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
resource_class: medium
steps:
- checkout
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh
- run: chmod u+x run_tests.sh && ./run_tests.sh
- store_artifacts:
path: ./Release/Darwin/erpcgen/erpcgen
build-mac-clang:
macos:
xcode: 13.2.1
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
resource_class: medium
steps:
- checkout
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh clang
- run: chmod u+x run_tests.sh && ./run_tests.sh clang
- store_artifacts:
path: ./Release/Darwin/erpcgen/erpcgen


workflows:
build-workflow:
jobs:
- build-linux-gcc
- build-linux-clang
# - build-mac-gcc # Mac is on going, or it can be hosted on company computer.
# - build-mac-clang

# VS Code Extension Version: 1.5.1
- build-mac-gcc
- build-mac-clang
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions erpcgen/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
CC = os.environ['CC']
else:
CC = 'gcc'
if 'CXX' in os.environ:
CXX = os.environ['CXX']
else:
CXX = 'g++'

# Number of test runs to keep.
RUN_KEEP_COUNT = 3
55 changes: 36 additions & 19 deletions erpcgen/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ class CCompiler(object):
def __init__(self, cwd=None, *args):
self._cwd = cwd
self._args = args
self._path = config.CC
self._pathCC = config.CC
self._pathCXX = config.CXX
self._includes = []
self._sources = []

Expand All @@ -269,24 +270,41 @@ def add_source(self, path):
self._sources.append(path)

def run(self, captureOutput=False):
def _run(cwd, captureOutput, pytestConfig, args, compilerType):
if pytestConfig and pytestConfig.getvalue("erpcgen_log_execs"):
print(f"Calling {compilerType} compiler:", " ".join(args))

cwd = str(cwd) if cwd is not None else None
if captureOutput:
return subprocess.check_output(args, cwd=cwd)
else:
subprocess.check_call(args, cwd=cwd)
return None

# Enable all warnings except for unused functions.
args = [self._path, "-c", "-Wall", "-Werror", "-Wno-unused-function"]
args += self._args
defaultArgs = ["-c", "-Wall", "-Werror", "-Wno-unused-function"]
defaultArgs += self._args
argsCC = [self._pathCC, "-std=gnu11"] + defaultArgs
argsCXX = [self._pathCXX, "-std=gnu++11"] + defaultArgs

incl = []
for i in self._includes:
args += ["-I", str(i)]
incl += ["-I", str(i)]

argsCXX += incl
argsCC += incl

for s in self._sources:
args.append(str(s))
if str(s).split(".")[-1] == "cpp":
argsCXX.append(str(s))
else:
argsCC.append(str(s))

if pytestConfig and pytestConfig.getvalue("erpcgen_log_execs"):
print("Calling C/C++ compiler:", " ".join(args))
output = [_run(self._cwd, captureOutput, pytestConfig, argsCC, "C")]
output.append(_run(self._cwd, captureOutput,
pytestConfig, argsCXX, "CXX"))

cwd = str(self._cwd) if self._cwd is not None else None
if captureOutput:
return subprocess.check_output(args, cwd=cwd)
else:
subprocess.check_call(args, cwd=cwd)
return output


class ErpcgenTestException(Exception):
Expand Down Expand Up @@ -755,15 +773,14 @@ def desc(self):


def verify_tools():
# Verify that erpcgen and the compiler are available.

def handle_err(e: Exception, toolName: str, expectedPath: str, envName: str):
def handle_err(e: Exception, toolName: str, expectedPathCC: str, envNameCC: str, expectedPathCXX: str, envNameCXX: str):
if isinstance(e, OSError):
if e.errno == errno.ENOENT:
print("Error: {} executable cannot be found.".format(toolName))
print("Expected {} path: {}".format(toolName, expectedPath))
print("To change the {} path, set the {} environment variable or create a config_local.py.".format(
toolName, envName))
print("Expected {} paths: {} and {}".format(
toolName, expectedPathCC, expectedPathCXX))
print("To change the {} path, set the {} and/or {} environment variable or create a config_local.py.".format(
toolName, envNameCC, envNameCXX))
print("See readme.txt for more information.")
else:
print("Fatal error: OS error when verifying {} is available. [errno {}]: {}".format(toolName,
Expand All @@ -784,7 +801,7 @@ def handle_err(e: Exception, toolName: str, expectedPath: str, envName: str):
try:
CCompiler(None, "--version").run(captureOutput=True)
except (OSError, subprocess.CalledProcessError) as e:
handle_err(e, "compiler", config.CC, "CC")
handle_err(e, "compiler", config.CC, "CC", config.CXX, "CXX")


verify_tools()
10 changes: 5 additions & 5 deletions install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Darwin*)
echo "Mac os detected."
brew update
echo "Installing dependencies."
brew install python3 bison flex -v -f 2>&1 && brew upgrade boost || true
curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" | sudo python3
sudo pip install tornado
sudo pip install --user nose
sudo pip install pytest --upgrade --ignore-installed six
brew install python3 boost bison flex -v -f 2>&1
sudo pip3 install tornado
sudo pip3 install --user nose
sudo pip3 install pytest --upgrade --ignore-installed six
sudo pip3 install pyyaml
;;
*)
echo "Unknown or currently unsupported os: ${unameOut}"
Expand Down
4 changes: 2 additions & 2 deletions mk/flags.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ else
MARCH ?= # -m32 or -m64
endif

CXXFLAGS += -std=gnu++11 -D LINUX -Wunused-variable -Wno-deprecated-register -Wno-narrowing -Werror $(MARCH)
CXXFLAGS += -std=gnu++11 -Wunused-variable -Wno-deprecated-register -Wno-narrowing -Werror $(MARCH)
#CXXFLAGS += -Wall -Wextra -Wshadow -pedantic-errors
CFLAGS += -std=gnu11 -D LINUX -D _GNU_SOURCE -Werror $(MARCH)
CFLAGS += -std=gnu11 -Werror $(MARCH)
YYFLAGS += -Wno-other # --debug --verbose
LLFLAGS +=
LDFLAGS += $(MARCH)
Expand Down
4 changes: 4 additions & 0 deletions test/common/unit_test_tcp_arbitrator_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "test_firstInterface.h"
#include "test_secondInterface.h"
#include "unit_test.h"
#include <chrono>
#include <thread>

#include <unistd.h>

Expand Down Expand Up @@ -111,6 +113,8 @@ int main(int argc, char **argv)

Log::info("Intit ERPC first (client) app...\n");

std::chrono::milliseconds duration(500);
std::this_thread::sleep_for(duration);
erpc_status_t err = g_transport.open();
if (err)
{
Expand Down