-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gndtruth_extractor: Fix segfault on error opening file
- Loading branch information
Showing
5 changed files
with
97 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from pathlib import Path | ||
from conan import ConanFile | ||
|
||
|
||
class CloeTest(ConanFile): | ||
python_requires = "cloe-launch-profile/[~=0.19.0]@cloe/develop" | ||
python_requires_extend = "cloe-launch-profile.Base" | ||
|
||
default_options = { | ||
"cloe-engine:server": False, | ||
} | ||
|
||
@property | ||
def cloe_launch_env(self): | ||
return { | ||
"CLOE_LOG_LEVEL": "debug", | ||
"CLOE_STRICT_MODE": "1", | ||
"CLOE_WRITE_OUTPUT": "0", | ||
"CLOE_ROOT": Path(self.recipe_folder) / "../../..", | ||
} | ||
|
||
def set_version(self): | ||
self.version = self.project_version("../../../VERSION") | ||
|
||
def requirements(self): | ||
self.requires(f"cloe-engine/{self.version}@cloe/develop") | ||
self.requires(f"cloe-plugin-basic/{self.version}@cloe/develop") | ||
self.requires(f"cloe-plugin-minimator/{self.version}@cloe/develop") | ||
self.requires(f"cloe-plugin-gndtruth-extractor/{self.version}@cloe/develop") | ||
|
||
if self.options["cloe-engine"].server: | ||
self.requires("boost/[<1.70]", override=True) |
28 changes: 28 additions & 0 deletions
28
plugins/gndtruth_extractor/tests/config_minimator_smoketest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"version": "4", | ||
"include": [ | ||
"${CLOE_ROOT}/tests/controller_basic.json" | ||
], | ||
"simulators": [ | ||
{ | ||
"binding": "minimator" | ||
} | ||
], | ||
"vehicles": [ | ||
{ | ||
"name": "default", | ||
"from": { | ||
"simulator": "minimator", | ||
"index": 0 | ||
} | ||
} | ||
], | ||
"server": { | ||
"listen": false, | ||
"listen_port": 23456 | ||
}, | ||
"triggers": [ | ||
{"event": "start", "action": "realtime_factor=-1"}, | ||
{"event": "time=60", "action": "succeed"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bats | ||
|
||
cd "${BATS_TEST_DIRNAME}" | ||
export CLOE_ROOT="${BATS_TEST_DIRNAME}/../../.." | ||
load "${CLOE_ROOT}/tests/setup_bats.bash" | ||
load "${CLOE_ROOT}/tests/setup_testname.bash" | ||
|
||
@test "$(testname 'Expect run failure' 'test_gndtruth_invalid_file.json' '29e8ff3b-86f3-4320-ba69-05600df1f836')" { | ||
cloe-engine check test_gndtruth_invalid_file.json | ||
run cloe-engine run test_gndtruth_invalid_file.json | ||
assert_exit_failure $status | ||
test $status -eq $CLOE_EXIT_ABORTED | ||
} |
15 changes: 15 additions & 0 deletions
15
plugins/gndtruth_extractor/tests/test_gndtruth_invalid_file.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"version": "4", | ||
"include": [ | ||
"config_minimator_smoketest.json" | ||
], | ||
"controllers": [ | ||
{ | ||
"binding": "gndtruth_extractor", | ||
"vehicle": "default", | ||
"args": { | ||
"output_file": "/tmp/nonexistant/file/that/will/not/be/created.json.gz" | ||
} | ||
} | ||
] | ||
} |