Compile and run C++ client example in CI pipelines
This commit is contained in:
parent
5ef3dde552
commit
814e4374f2
|
@ -34,6 +34,7 @@ matrix:
|
|||
- make setup >> build.log 2>&1
|
||||
- make LibCarla >> build.log 2>&1
|
||||
- make PythonAPI >> build.log 2>&1
|
||||
- make examples >> build.log 2>&1
|
||||
- kill %1
|
||||
- make check ARGS="--all --gtest_args=--gtest_filter=-*_mt"
|
||||
after_failure:
|
||||
|
|
|
@ -20,7 +20,7 @@ clean:
|
|||
|
||||
run: build
|
||||
$(call log,Running C++ Client...)
|
||||
@$(BINDIR)/cpp_client
|
||||
@$(BINDIR)/cpp_client $(ARGS)
|
||||
|
||||
build: $(BINDIR)/cpp_client
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
#include <random>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <tuple>
|
||||
|
||||
#include <carla/client/ActorBlueprint.h>
|
||||
#include <carla/client/BlueprintLibrary.h>
|
||||
|
@ -47,12 +49,24 @@ static void SaveSemSegImageToDisk(const csd::Image &image) {
|
|||
ImageIO::WriteView(filename, view);
|
||||
}
|
||||
|
||||
int main() {
|
||||
static auto ParseArguments(int argc, const char *argv[]) {
|
||||
EXPECT_TRUE((argc == 1u) || (argc == 3u));
|
||||
using ResultType = std::tuple<std::string, uint16_t>;
|
||||
return argc == 3u ?
|
||||
ResultType{argv[1u], std::stoi(argv[2u])} :
|
||||
ResultType{"localhost", 2000u};
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
try {
|
||||
|
||||
std::string host;
|
||||
uint16_t port;
|
||||
std::tie(host, port) = ParseArguments(argc, argv);
|
||||
|
||||
std::mt19937_64 rng((std::random_device())());
|
||||
|
||||
auto client = cc::Client("localhost", 2000);
|
||||
auto client = cc::Client(host, port);
|
||||
client.SetTimeout(10s);
|
||||
|
||||
std::cout << "Client API version : " << client.GetClientVersion() << '\n';
|
||||
|
|
|
@ -22,6 +22,7 @@ pipeline {
|
|||
sh 'make LibCarla'
|
||||
sh 'make PythonAPI'
|
||||
sh 'make CarlaUE4Editor'
|
||||
sh 'make examples'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
@ -66,6 +67,7 @@ pipeline {
|
|||
steps {
|
||||
sh 'DISPLAY= ./Dist/*/LinuxNoEditor/CarlaUE4.sh --carla-rpc-port=3654 --carla-streaming-port=0 > CarlaUE4.log &'
|
||||
sh 'make smoke_tests ARGS="--xml"'
|
||||
sh 'make run-examples ARGS="localhost 3654"'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
|
|
@ -66,6 +66,12 @@ benchmark: LibCarla.release
|
|||
smoke_tests:
|
||||
@${CARLA_BUILD_TOOLS_FOLDER}/Check.sh --smoke-2 --smoke-3 $(ARGS)
|
||||
|
||||
examples:
|
||||
@for D in ${CARLA_EXAMPLES_FOLDER}/*; do [ -d "$${D}" ] && make -C $${D} build; done
|
||||
|
||||
run-examples:
|
||||
@for D in ${CARLA_EXAMPLES_FOLDER}/*; do [ -d "$${D}" ] && make -C $${D} run; done
|
||||
|
||||
CarlaUE4Editor: LibCarla.server.release
|
||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.sh --build
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ Use the following commands:
|
|||
takes a long time!
|
||||
|
||||
export-maps:
|
||||
|
||||
Export maps from /Game/Carla/ExportedMaps to the ExportedMaps folder
|
||||
at the root of the Carla project.
|
||||
|
||||
|
@ -65,6 +66,10 @@ for developers:
|
|||
|
||||
Run the benchmark tests for LibCarla.
|
||||
|
||||
(run-)examples:
|
||||
|
||||
Build (and run) the C++ client examples.
|
||||
|
||||
CarlaUE4Editor:
|
||||
|
||||
Build CarlaUE4 project, but do not launch the editor.
|
||||
|
|
|
@ -24,3 +24,4 @@ LIBCPP_TOOLCHAIN_FILE=${CARLA_BUILD_FOLDER}/LibCppToolChain.cmake
|
|||
CMAKE_CONFIG_FILE=${CARLA_BUILD_FOLDER}/CMakeLists.txt.in
|
||||
|
||||
LIBCARLA_TEST_CONTENT_FOLDER=${CARLA_BUILD_FOLDER}/test-content
|
||||
CARLA_EXAMPLES_FOLDER=${CURDIR}/Examples
|
||||
|
|
Loading…
Reference in New Issue