diff --git a/engine/tests/conanfile_with_server.py b/engine/tests/conanfile_with_server.py deleted file mode 100644 index b194ba952..000000000 --- a/engine/tests/conanfile_with_server.py +++ /dev/null @@ -1,32 +0,0 @@ -# mypy: ignore-errors -# pylint: skip-file - -from pathlib import Path - -from conan import ConanFile - - -class CloeTest(ConanFile): - python_requires = "cloe-launch-profile/[>=0.20.0]@cloe/develop" - python_requires_extend = "cloe-launch-profile.Base" - - @property - def cloe_launch_env(self): - return { - "CLOE_ENGINE_WITH_SERVER": "0", - "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-mocks/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-noisy-sensor/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-speedometer/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-virtue/{self.version}@cloe/develop") diff --git a/engine/tests/conanfile_without_server.py b/engine/tests/conanfile_without_server.py deleted file mode 100644 index 0baebe875..000000000 --- a/engine/tests/conanfile_without_server.py +++ /dev/null @@ -1,35 +0,0 @@ -# mypy: ignore-errors -# pylint: skip-file - -from pathlib import Path - -from conan import ConanFile - - -class CloeTest(ConanFile): - python_requires = "cloe-launch-profile/[>=0.20.0]@cloe/develop" - python_requires_extend = "cloe-launch-profile.Base" - default_options = { - "cloe-engine:server": False, - } - - @property - def cloe_launch_env(self): - return { - "CLOE_ENGINE_WITH_SERVER": "0", - "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-mocks/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-noisy-sensor/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-speedometer/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-virtue/{self.version}@cloe/develop") diff --git a/engine/tests/config_nop_infinite.json b/engine/tests/config_nop_infinite.json deleted file mode 100644 index e29064ef0..000000000 --- a/engine/tests/config_nop_infinite.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "version": "4", - "include": [ - "controller_virtue.json", - "controller_basic.json" - ], - "simulators": [ - { - "binding": "nop" - } - ], - "vehicles": [ - { - "name": "default", - "from": { - "simulator": "nop", - "index": 0 - }, - "components": { - "cloe::speedometer": { - "binding": "speedometer", - "name": "default_speed", - "from": "cloe::gndtruth_ego_sensor" - }, - "cloe::default_world_sensor": { - "binding": "noisy_object_sensor", - "name": "noisy_object_sensor", - "from": "cloe::default_world_sensor", - "args": { - "noise": [ - { - "target": "translation", - "distribution": { - "binding": "normal", - "mean": 0.0, - "std_deviation": 0.3 - } - } - ] - } - } - } - } - ] -} diff --git a/engine/tests/config_nop_smoketest.json b/engine/tests/config_nop_smoketest.json deleted file mode 100644 index 238708186..000000000 --- a/engine/tests/config_nop_smoketest.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "4", - "include": [ - "config_nop_infinite.json" - ], - "server": { - "listen": false, - "listen_port": 23456 - }, - "triggers": [ - {"event": "virtue/failure", "action": "fail"}, - { - "label": "Vehicle default should never move with the nop binding.", - "event": "default_speed/kmph=>0.0", "action": "fail" - }, - {"event": "start", "action": "log=info: Running nop/basic smoketest."}, - {"event": "start", "action": "realtime_factor=-1"}, - {"event": "time=60", "action": "succeed"} - ] -} diff --git a/plugins/esmini/tests/conanfile_esmini.py b/plugins/esmini/tests/conanfile_esmini.py deleted file mode 100644 index f024b2934..000000000 --- a/plugins/esmini/tests/conanfile_esmini.py +++ /dev/null @@ -1,39 +0,0 @@ -# mypy: ignore-errors -# pylint: skip-file - -from pathlib import Path -from conan import ConanFile - - -class CloeTest(ConanFile): - python_requires = "cloe-launch-profile/[>=0.20.0]@cloe/develop" - python_requires_extend = "cloe-launch-profile.Base" - - default_options = { - "cloe-engine:server": True, - } - - @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-noisy-sensor/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-speedometer/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-gndtruth-extractor/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-virtue/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-esmini/{self.version}@cloe/develop") - self.requires("esmini-data/2.37.4@cloe/stable") - - # Overrides: - self.requires("zlib/1.2.13", override=True) diff --git a/plugins/esmini/tests/controller_virtue.json b/plugins/esmini/tests/controller_virtue.json deleted file mode 100644 index 15453a5fb..000000000 --- a/plugins/esmini/tests/controller_virtue.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": "4", - - "controllers": [ - { - "binding": "virtue", - "vehicle": "default" - } - ] -} diff --git a/plugins/gndtruth_extractor/tests/conanfile_default.py b/plugins/gndtruth_extractor/tests/conanfile_default.py deleted file mode 100644 index 456b73752..000000000 --- a/plugins/gndtruth_extractor/tests/conanfile_default.py +++ /dev/null @@ -1,32 +0,0 @@ -# mypy: ignore-errors -# pylint: skip-file - -from pathlib import Path -from conan import ConanFile - - -class CloeTest(ConanFile): - python_requires = "cloe-launch-profile/[>=0.20.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") diff --git a/plugins/minimator/tests/conanfile_default.py b/plugins/minimator/tests/conanfile_default.py deleted file mode 100644 index 175270414..000000000 --- a/plugins/minimator/tests/conanfile_default.py +++ /dev/null @@ -1,36 +0,0 @@ -# mypy: ignore-errors -# pylint: skip-file - -from pathlib import Path - -from conan import ConanFile - - -class CloeTest(ConanFile): - python_requires = "cloe-launch-profile/[>=0.20.0]@cloe/develop" - python_requires_extend = "cloe-launch-profile.Base" - - default_options = { - "cloe-engine:server": True, - } - - @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-clothoid-fit/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-minimator/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-noisy-sensor/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-speedometer/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-virtue/{self.version}@cloe/develop") diff --git a/plugins/virtue/tests/conanfile_default.py b/plugins/virtue/tests/conanfile_default.py deleted file mode 100644 index 175270414..000000000 --- a/plugins/virtue/tests/conanfile_default.py +++ /dev/null @@ -1,36 +0,0 @@ -# mypy: ignore-errors -# pylint: skip-file - -from pathlib import Path - -from conan import ConanFile - - -class CloeTest(ConanFile): - python_requires = "cloe-launch-profile/[>=0.20.0]@cloe/develop" - python_requires_extend = "cloe-launch-profile.Base" - - default_options = { - "cloe-engine:server": True, - } - - @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-clothoid-fit/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-minimator/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-noisy-sensor/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-speedometer/{self.version}@cloe/develop") - self.requires(f"cloe-plugin-virtue/{self.version}@cloe/develop") diff --git a/plugins/esmini/tests/config_esmini_aeb.json b/tests/config_esmini_aeb.json similarity index 100% rename from plugins/esmini/tests/config_esmini_aeb.json rename to tests/config_esmini_aeb.json diff --git a/plugins/esmini/tests/config_esmini_closed_loop.json b/tests/config_esmini_closed_loop.json similarity index 97% rename from plugins/esmini/tests/config_esmini_closed_loop.json rename to tests/config_esmini_closed_loop.json index 71452c373..b819f788e 100644 --- a/plugins/esmini/tests/config_esmini_closed_loop.json +++ b/tests/config_esmini_closed_loop.json @@ -27,7 +27,7 @@ { "label": "Ego vehicle should reach stand-still.", "event": "default_speed/kmph=<0.2", "action": "succeed" - } + } ] } } diff --git a/plugins/esmini/tests/config_esmini_cut_in.json b/tests/config_esmini_cut_in.json similarity index 100% rename from plugins/esmini/tests/config_esmini_cut_in.json rename to tests/config_esmini_cut_in.json diff --git a/plugins/esmini/tests/config_esmini_open_loop.json b/tests/config_esmini_open_loop.json similarity index 100% rename from plugins/esmini/tests/config_esmini_open_loop.json rename to tests/config_esmini_open_loop.json diff --git a/plugins/minimator/tests/config_minimator_infinite.json b/tests/config_minimator_infinite.json similarity index 97% rename from plugins/minimator/tests/config_minimator_infinite.json rename to tests/config_minimator_infinite.json index 51610dd51..8d6687e47 100644 --- a/plugins/minimator/tests/config_minimator_infinite.json +++ b/tests/config_minimator_infinite.json @@ -1,7 +1,7 @@ { "version": "4", "include": [ - "${CLOE_ROOT}/tests/controller_basic.json" + "just_controller_basic.json" ], "defaults": { "controllers": [ diff --git a/plugins/minimator/tests/config_minimator_multi_agent_infinite.json b/tests/config_minimator_multi_agent_infinite.json similarity index 100% rename from plugins/minimator/tests/config_minimator_multi_agent_infinite.json rename to tests/config_minimator_multi_agent_infinite.json diff --git a/plugins/minimator/tests/config_minimator_smoketest.json b/tests/config_minimator_smoketest.json similarity index 100% rename from plugins/minimator/tests/config_minimator_smoketest.json rename to tests/config_minimator_smoketest.json diff --git a/tests/config_nop_infinite.json b/tests/config_nop_infinite.json index e29064ef0..d58449bcc 100644 --- a/tests/config_nop_infinite.json +++ b/tests/config_nop_infinite.json @@ -1,8 +1,8 @@ { "version": "4", "include": [ - "controller_virtue.json", - "controller_basic.json" + "just_controller_virtue.json", + "just_controller_basic.json" ], "simulators": [ { diff --git a/tests/config_nop_smoketest.json b/tests/config_nop_smoketest.json index 7c5086bd1..238708186 100644 --- a/tests/config_nop_smoketest.json +++ b/tests/config_nop_smoketest.json @@ -1,15 +1,12 @@ { "version": "4", - "include": [ "config_nop_infinite.json" ], - "server": { "listen": false, "listen_port": 23456 }, - "triggers": [ {"event": "virtue/failure", "action": "fail"}, { diff --git a/tests/controller_basic.json b/tests/controller_basic.json deleted file mode 100644 index ffbb760ac..000000000 --- a/tests/controller_basic.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "version": "4", - - "controllers": [ - { - "binding": "basic", - "vehicle": "default" - } - ], - - "triggers": [ - { - "event": "start", - "action": { - "name": "bundle", - "actions": [ - "basic/hmi=!enable" - ] - } - }, - { "event": "next=1", "action": "basic/hmi=enable" }, - { "event": "time=5", "action": "basic/hmi=resume" }, - { "event": "time=5.5", "action": "basic/hmi=!resume" }, - { - "label": "Push and release basic/hmi=plus", - "event": "time=6", - "action": { - "name": "insert", - "triggers": [ - { "event": "next", "action": "basic/hmi=plus" }, - { "event": "next=1", "action": "basic/hmi=!plus" } - ] - } - } - ] -} diff --git a/plugins/esmini/tests/controller_basic_aeb.json b/tests/controller_basic_aeb.json similarity index 100% rename from plugins/esmini/tests/controller_basic_aeb.json rename to tests/controller_basic_aeb.json diff --git a/engine/tests/controller_basic.json b/tests/just_controller_basic.json similarity index 100% rename from engine/tests/controller_basic.json rename to tests/just_controller_basic.json diff --git a/engine/tests/controller_virtue.json b/tests/just_controller_virtue.json similarity index 100% rename from engine/tests/controller_virtue.json rename to tests/just_controller_virtue.json diff --git a/tests/debug_callgrind.json b/tests/option_debug_callgrind.json similarity index 100% rename from tests/debug_callgrind.json rename to tests/option_debug_callgrind.json diff --git a/tests/setup_bats.bash b/tests/setup_bats.bash index c9f04feaa..093440a72 100644 --- a/tests/setup_bats.bash +++ b/tests/setup_bats.bash @@ -1,5 +1,8 @@ #!/usr/bin/env bats +# All tests are run from within the tests/ directory. +cd "${BATS_TEST_DIRNAME}" + # The path to use whenever we need a temporary registry. Whenever we use this, we # probably want to specify the `--write-output` flag too, otherwise nothing will # be written to the registry. @@ -45,3 +48,15 @@ test_plugin_exists() { cloe-engine usage "${plugin}" &>/dev/null } + +require_program() { + if ! type $1 &>/dev/null; then + skip "required program not present: $1" + fi +} + +require_engine_with_server() { + if ! cloe-engine version | grep -F "server: true" &>/dev/null; then + skip "required engine option not set: server" + fi +} diff --git a/engine/tests/test_engine.bats b/tests/test_engine.bats similarity index 88% rename from engine/tests/test_engine.bats rename to tests/test_engine.bats index b25e155bc..1f1640387 100755 --- a/engine/tests/test_engine.bats +++ b/tests/test_engine.bats @@ -1,13 +1,7 @@ #!/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" - -check_engine_with_server() { - cloe-engine version | grep -F "server: true" &>/dev/null -} +load setup_bats +load setup_testname @test "$(testname 'Expect schema equality' 'test_engine_json_schema.json' '4d368665-b666-4289-8a7a-b76ca53db688')" { # Note: you will have to update the schema files every time you change the schema, @@ -16,25 +10,24 @@ check_engine_with_server() { # cloe-launch -vv exec conanfile.py -- usage -j > tests/test_engine_json_schema.json # # Then use git diff to check that the changes make sense and are what you expect. - if ! type diff &>/dev/null; then - skip "required program diff not present" - fi + require_program diff diff <(cloe-engine usage -j 2>/dev/null) test_engine_json_schema.json } @test "$(testname 'Expect stack equality' 'test_engine_nop_smoketest_dump.json' '3b23bb69-b249-49c8-8b4c-2fa993d8677e')" { - if ! type diff &>/dev/null; then - skip "required program diff not present" - fi + require_program diff # The plugin section and the registry section have path references, which # are not reproducible, so we need to rewrite them and delete these lines. # This does not negatively affect the validity of the test. reference_file=test_engine_nop_smoketest_dump.json diff <(cloe-engine dump config_nop_smoketest.json | - sed -r -e 's#"/.*\/.*.conan/data/([^/]+)/.*"#"/.../\1/.../"#' -e "\\#(${HOME-/root}|${CONAN_USER_HOME-/cloe_dev})/.*#d") \ - ${reference_file} + sed -r -e '#"/.*\/.*.conan/data/([^/]+)/.*"#d' \ + -e '\#\.\.\./cloe-engine/\.\.\.#d' \ + -e "\\#(${HOME-/root}|${CONAN_USER_HOME-/cloe_dev})/.*#d" \ + ) \ + ${reference_file} } @test "$(testname 'Expect check success' 'test_engine_smoketest.json' '20c3f11e-4a93-4066-b61e-d485be5c8979')" { @@ -71,12 +64,9 @@ check_engine_with_server() { } @test "$(testname 'Expect run success' 'test_engine_curl_succeed.json' 'f473cb96-7f2e-4ac1-801a-fd93343f6e24')" { - if ! type curl &>/dev/null; then - skip "required program curl not present" - fi - if ! check_engine_with_server; then - skip "server component disabled" - fi + require_program curl + require_engine_with_server + cloe-engine run test_engine_curl_succeed.json } @@ -158,8 +148,10 @@ check_engine_with_server() { } @test "$(testname 'Expect check failure' 'test_engine_unavailable_*.json' '6cf4ded3-8a57-4dee-afac-bb03a8068e41')" { - run cloe-engine -l info check -d test_engine_unavailable_*.json - test $status -eq $CLOE_EXIT_UNKNOWN + for file in test_engine_unavailable_*.json; do + run cloe-engine -l info check "$file" + test $status -eq $CLOE_EXIT_UNKNOWN + done } @test "$(testname 'Expect check failure' 'test_engine_include_nonexistent.json' 'bad115cc-0397-48e6-9a51-bdcfeaf6b024')" { @@ -186,17 +178,13 @@ check_engine_with_server() { } @test "$(testname 'Expect check success' 'test_engine_keep_alive.json' '254544dc-c17a-4a5c-8685-723ed1c758cf')" { - if ! type kill &>/dev/null; then - skip "required program kill not present" - fi + require_program kill cloe-engine check test_engine_keep_alive.json } @test "$(testname 'Expect run success' 'test_engine_keep_alive.json' '0c5ace05-f5ca-4615-9c14-62a75b69651a')" { - if ! type kill &>/dev/null; then - skip "required program kill not present" - fi + require_program kill cloe-engine run test_engine_keep_alive.json } @@ -248,12 +236,8 @@ check_engine_with_server() { } @test "$(testname 'Expect run success' 'test_engine_pause.json' '845e3c9b-2a6d-469a-93a7-67fe9531c81e')" { - if ! type curl &>/dev/null; then - skip "required program curl not present" - fi - if ! check_engine_with_server; then - skip "server component disabled" - fi + require_program curl + require_engine_with_server cloe-engine run test_engine_pause.json } @@ -290,12 +274,8 @@ check_engine_with_server() { } @test "$(testname 'Expect run syskill' 'test_engine_watchdog.json' '058ff9b7-98dc-4583-8e80-c70e9c5e1f4e')" { - if ! type curl &>/dev/null; then - skip "required program curl not present" - fi - if ! check_engine_with_server; then - skip "server component disabled" - fi + require_program curl + require_engine_with_server cloe-engine check test_engine_watchdog.json @@ -305,13 +285,13 @@ check_engine_with_server() { } @test "$(testname 'Expect check/run success' 'test_engine_smoketest.json [ts=5ms]' '1a31022c-e20c-4a9e-9373-ad54a3729442')" { - local timestep_stack="${CLOE_ROOT}/tests/option_timestep_5.json" + local timestep_stack="option_timestep_5.json" cloe-engine check test_engine_smoketest.json "${timestep_stack}" cloe-engine run test_engine_smoketest.json "${timestep_stack}" } @test "$(testname 'Expect check/run success' 'test_engine_smoketest.json [ts=60ms]' 'e7957fa0-1145-4458-b665-eec51c1f0da5')" { - local timestep_stack="${CLOE_ROOT}/tests/option_timestep_60.json" + local timestep_stack="option_timestep_60.json" cloe-engine check test_engine_smoketest.json "${timestep_stack}" cloe-engine run test_engine_smoketest.json "${timestep_stack}" } diff --git a/engine/tests/test_engine_bad_logging.json b/tests/test_engine_bad_logging.json similarity index 100% rename from engine/tests/test_engine_bad_logging.json rename to tests/test_engine_bad_logging.json diff --git a/engine/tests/test_engine_curl_succeed.json b/tests/test_engine_curl_succeed.json similarity index 77% rename from engine/tests/test_engine_curl_succeed.json rename to tests/test_engine_curl_succeed.json index e9fccb776..c07c75bb2 100644 --- a/engine/tests/test_engine_curl_succeed.json +++ b/tests/test_engine_curl_succeed.json @@ -16,15 +16,15 @@ {"event": "start", "action": "realtime_factor=-1"}, { "label": "Insert the stop trigger via curl to test the web server.", - "event": "time=10", + "event": "time=1", "action": { "name": "command", - "command": "echo '{\"event\": \"time=60\", \"action\": \"succeed\"}' | curl -d @- http://localhost:23456/api/triggers/input" + "command": "echo '{\"event\": \"time=2\", \"action\": \"succeed\"}' | curl -d @- http://localhost:23456/api/triggers/input" } }, { "label": "If we get this far, then the curl command didn't work.", - "event": "time=120", + "event": "time=3", "action": { "name": "bundle", "actions": [ diff --git a/engine/tests/test_engine_empty.json b/tests/test_engine_empty.json similarity index 100% rename from engine/tests/test_engine_empty.json rename to tests/test_engine_empty.json diff --git a/engine/tests/test_engine_fail_trigger.json b/tests/test_engine_fail_trigger.json similarity index 100% rename from engine/tests/test_engine_fail_trigger.json rename to tests/test_engine_fail_trigger.json diff --git a/engine/tests/test_engine_hook_failure.json b/tests/test_engine_hook_failure.json similarity index 100% rename from engine/tests/test_engine_hook_failure.json rename to tests/test_engine_hook_failure.json diff --git a/engine/tests/test_engine_hook_invalid.json b/tests/test_engine_hook_invalid.json similarity index 100% rename from engine/tests/test_engine_hook_invalid.json rename to tests/test_engine_hook_invalid.json diff --git a/engine/tests/test_engine_hook_noexec.json b/tests/test_engine_hook_noexec.json similarity index 100% rename from engine/tests/test_engine_hook_noexec.json rename to tests/test_engine_hook_noexec.json diff --git a/engine/tests/test_engine_hook_ok.json b/tests/test_engine_hook_ok.json similarity index 100% rename from engine/tests/test_engine_hook_ok.json rename to tests/test_engine_hook_ok.json diff --git a/engine/tests/test_engine_ignore.json b/tests/test_engine_ignore.json similarity index 100% rename from engine/tests/test_engine_ignore.json rename to tests/test_engine_ignore.json diff --git a/engine/tests/test_engine_include_nonexistent.json b/tests/test_engine_include_nonexistent.json similarity index 100% rename from engine/tests/test_engine_include_nonexistent.json rename to tests/test_engine_include_nonexistent.json diff --git a/engine/tests/test_engine_include_self.json b/tests/test_engine_include_self.json similarity index 100% rename from engine/tests/test_engine_include_self.json rename to tests/test_engine_include_self.json diff --git a/engine/tests/test_engine_incomplete.json b/tests/test_engine_incomplete.json similarity index 100% rename from engine/tests/test_engine_incomplete.json rename to tests/test_engine_incomplete.json diff --git a/engine/tests/test_engine_invalid_trigger.json b/tests/test_engine_invalid_trigger.json similarity index 100% rename from engine/tests/test_engine_invalid_trigger.json rename to tests/test_engine_invalid_trigger.json diff --git a/engine/tests/test_engine_json_schema.json b/tests/test_engine_json_schema.json similarity index 68% rename from engine/tests/test_engine_json_schema.json rename to tests/test_engine_json_schema.json index 3c1a90679..c2149ffdd 100644 --- a/engine/tests/test_engine_json_schema.json +++ b/tests/test_engine_json_schema.json @@ -252,6 +252,59 @@ ], "type": "object" }, + { + "additionalProperties": false, + "properties": { + "args": { + "additionalProperties": false, + "properties": { + "components": { + "description": "array of components to be extracted", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_file": { + "description": "file path to write groundtruth output to", + "type": "string" + }, + "output_type": { + "description": "type of output file to write", + "enum": [ + "json.bz2", + "json.gz", + "json.zip", + "json", + "msgpack.bz2", + "msgpack.gz", + "msgpack.zip", + "msgpack" + ], + "type": "string" + } + }, + "type": "object" + }, + "binding": { + "const": "gndtruth_extractor", + "description": "name of factory" + }, + "name": { + "description": "globally unique identifier for controller", + "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$", + "type": "string" + }, + "vehicle": { + "description": "vehicle controller is assigned to", + "type": "string" + } + }, + "required": [ + "binding" + ], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -1059,6 +1112,189 @@ "description": "simulator configuration", "items": { "oneOf": [ + { + "additionalProperties": false, + "properties": { + "args": { + "additionalProperties": false, + "properties": { + "headless": { + "description": "run esmini without viewer", + "type": "boolean" + }, + "scenario": { + "description": "absolute path to open scenario file", + "type": "string" + }, + "vehicles": { + "additionalProperties": { + "additionalProperties": false, + "properties": { + "closed_loop": { + "description": "control the esmini vehicle", + "type": "boolean" + }, + "filter_distance": { + "description": "filter distance for ground truth data", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + } + }, + "type": "object" + }, + "description": "vehicle configuration like sensors and component mapping", + "type": "object" + }, + "write_images": { + "description": "save an image for each step", + "type": "boolean" + } + }, + "type": "object" + }, + "binding": { + "const": "esmini", + "description": "name of factory" + }, + "name": { + "description": "globally unique identifier for simulator", + "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$", + "type": "string" + } + }, + "required": [ + "binding" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "args": { + "additionalProperties": false, + "properties": { + "vehicles": { + "additionalProperties": { + "additionalProperties": false, + "properties": { + "ego_sensor_mockup": { + "additionalProperties": false, + "description": "Ego sensor mockup configuration", + "properties": { + "ego_object": { + "additionalProperties": false, + "description": "Ego object configuration in world coordinates", + "properties": { + "position": { + "additionalProperties": false, + "description": "Object position coordinates (x,y,z)", + "properties": { + "x": { + "description": "Object position x axis", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "y": { + "description": "Object position y axis", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "z": { + "description": "Object position z axis", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + } + }, + "type": "object" + }, + "velocity": { + "description": "Object longitudinal velocity", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "object_sensor_mockup": { + "additionalProperties": false, + "description": "Object sensor mockup configuration", + "properties": { + "objects": { + "description": "Array of object configuration relative to ego vehicle", + "items": { + "additionalProperties": false, + "properties": { + "position": { + "additionalProperties": false, + "description": "Object position coordinates (x,y,z)", + "properties": { + "x": { + "description": "Object position x axis", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "y": { + "description": "Object position y axis", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "z": { + "description": "Object position z axis", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + } + }, + "type": "object" + }, + "velocity": { + "description": "Object longitudinal velocity", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "description": "list of vehicle names to make available", + "type": "object" + } + }, + "type": "object" + }, + "binding": { + "const": "minimator", + "description": "name of factory" + }, + "name": { + "description": "globally unique identifier for simulator", + "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$", + "type": "string" + } + }, + "required": [ + "binding" + ], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -1202,6 +1438,327 @@ "components": { "additionalProperties": { "oneOf": [ + { + "additionalProperties": false, + "properties": { + "args": { + "additionalProperties": false, + "properties": { + "enable": { + "description": "enable or disable component", + "type": "boolean" + }, + "frustum_culling": { + "description": "enable or disable frustum culling", + "type": "boolean" + } + }, + "type": "object" + }, + "binding": { + "const": "clothoid_fit", + "description": "name of factory" + }, + "from": { + "anyOf": [ + { + "description": "component input for binding", + "type": "string" + }, + { + "description": "component inputs for binding", + "items": { + "type": "string" + }, + "type": "array" + } + ] + }, + "name": { + "description": "globally unique identifier for component", + "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$", + "type": "string" + } + }, + "required": [ + "binding" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "args": { + "additionalProperties": false, + "properties": { + "frustum": { + "additionalProperties": false, + "description": "sensor frustum", + "properties": { + "clip_far": { + "description": "far clipping plane [m]", + "maximum": 1.7976931348623157e+308, + "minimum": 0.0, + "type": "number" + }, + "clip_near": { + "description": "near clipping plane [m]", + "maximum": 1.7976931348623157e+308, + "minimum": 0.0, + "type": "number" + }, + "fov_h": { + "description": "horizontal field of view [rad]", + "maximum": 6.283185307179586, + "minimum": 0.0, + "type": "number" + }, + "fov_v": { + "description": "vertical field of view [rad]", + "maximum": 6.283185307179586, + "minimum": 0.0, + "type": "number" + }, + "offset_h": { + "description": "horizontal field-of-view offset [rad]", + "maximum": 6.283185307179586, + "minimum": -6.283185307179586, + "type": "number" + }, + "offset_v": { + "description": "vertical field-of-view offset [rad]", + "maximum": 6.283185307179586, + "minimum": -6.283185307179586, + "type": "number" + } + }, + "type": "object" + }, + "reference_frame": { + "additionalProperties": false, + "description": "sensor frame of reference", + "properties": { + "pitch": { + "description": "pitch angle relative to ego reference frame [rad]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "roll": { + "description": "roll angle relative to ego reference frame [rad]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "x": { + "description": "x-position in ego reference frame [m]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "y": { + "description": "y-position in ego reference frame [m]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "yaw": { + "description": "yaw angle relative to ego reference frame [rad]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "z": { + "description": "z-position in ego reference frame [m]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + } + }, + "required": [ + "x", + "y", + "z", + "roll", + "pitch", + "yaw" + ], + "type": "object" + } + }, + "required": [ + "reference_frame", + "frustum" + ], + "type": "object" + }, + "binding": { + "const": "frustum_culling_lanes", + "description": "name of factory" + }, + "from": { + "anyOf": [ + { + "description": "component input for binding", + "type": "string" + }, + { + "description": "component inputs for binding", + "items": { + "type": "string" + }, + "type": "array" + } + ] + }, + "name": { + "description": "globally unique identifier for component", + "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$", + "type": "string" + } + }, + "required": [ + "binding" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "args": { + "additionalProperties": false, + "properties": { + "frustum": { + "additionalProperties": false, + "description": "sensor frustum", + "properties": { + "clip_far": { + "description": "far clipping plane [m]", + "maximum": 1.7976931348623157e+308, + "minimum": 0.0, + "type": "number" + }, + "clip_near": { + "description": "near clipping plane [m]", + "maximum": 1.7976931348623157e+308, + "minimum": 0.0, + "type": "number" + }, + "fov_h": { + "description": "horizontal field of view [rad]", + "maximum": 6.283185307179586, + "minimum": 0.0, + "type": "number" + }, + "fov_v": { + "description": "vertical field of view [rad]", + "maximum": 6.283185307179586, + "minimum": 0.0, + "type": "number" + }, + "offset_h": { + "description": "horizontal field-of-view offset [rad]", + "maximum": 6.283185307179586, + "minimum": -6.283185307179586, + "type": "number" + }, + "offset_v": { + "description": "vertical field-of-view offset [rad]", + "maximum": 6.283185307179586, + "minimum": -6.283185307179586, + "type": "number" + } + }, + "type": "object" + }, + "reference_frame": { + "additionalProperties": false, + "description": "sensor frame of reference", + "properties": { + "pitch": { + "description": "pitch angle relative to ego reference frame [rad]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "roll": { + "description": "roll angle relative to ego reference frame [rad]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "x": { + "description": "x-position in ego reference frame [m]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "y": { + "description": "y-position in ego reference frame [m]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "yaw": { + "description": "yaw angle relative to ego reference frame [rad]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + }, + "z": { + "description": "z-position in ego reference frame [m]", + "maximum": 1.7976931348623157e+308, + "minimum": -1.7976931348623157e+308, + "type": "number" + } + }, + "required": [ + "x", + "y", + "z", + "roll", + "pitch", + "yaw" + ], + "type": "object" + } + }, + "required": [ + "reference_frame", + "frustum" + ], + "type": "object" + }, + "binding": { + "const": "frustum_culling_objects", + "description": "name of factory" + }, + "from": { + "anyOf": [ + { + "description": "component input for binding", + "type": "string" + }, + { + "description": "component inputs for binding", + "items": { + "type": "string" + }, + "type": "array" + } + ] + }, + "name": { + "description": "globally unique identifier for component", + "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$", + "type": "string" + } + }, + "required": [ + "binding" + ], + "type": "object" + }, { "additionalProperties": false, "properties": { diff --git a/engine/tests/test_engine_keep_alive.json b/tests/test_engine_keep_alive.json similarity index 100% rename from engine/tests/test_engine_keep_alive.json rename to tests/test_engine_keep_alive.json diff --git a/engine/tests/test_engine_namespaced_smoketest.json b/tests/test_engine_namespaced_smoketest.json similarity index 100% rename from engine/tests/test_engine_namespaced_smoketest.json rename to tests/test_engine_namespaced_smoketest.json diff --git a/engine/tests/test_engine_no_binding.json b/tests/test_engine_no_binding.json similarity index 100% rename from engine/tests/test_engine_no_binding.json rename to tests/test_engine_no_binding.json diff --git a/engine/tests/test_engine_no_vehicle.json b/tests/test_engine_no_vehicle.json similarity index 100% rename from engine/tests/test_engine_no_vehicle.json rename to tests/test_engine_no_vehicle.json diff --git a/engine/tests/test_engine_nop_smoketest_dump.json b/tests/test_engine_nop_smoketest_dump.json similarity index 95% rename from engine/tests/test_engine_nop_smoketest_dump.json rename to tests/test_engine_nop_smoketest_dump.json index bec76a9d2..6632ef48e 100644 --- a/engine/tests/test_engine_nop_smoketest_dump.json +++ b/tests/test_engine_nop_smoketest_dump.json @@ -31,11 +31,6 @@ "path": "${CLOE_SIMULATION_UUID}" }, "plugin_path": [ - "/.../cloe-plugin-basic/.../", - "/.../cloe-plugin-mocks/.../", - "/.../cloe-plugin-noisy-sensor/.../", - "/.../cloe-plugin-speedometer/.../", - "/.../cloe-plugin-virtue/.../" ], "plugins": { "allow_clobber": true, diff --git a/engine/tests/test_engine_optional_trigger.json b/tests/test_engine_optional_trigger.json similarity index 100% rename from engine/tests/test_engine_optional_trigger.json rename to tests/test_engine_optional_trigger.json diff --git a/engine/tests/test_engine_pause.json b/tests/test_engine_pause.json similarity index 100% rename from engine/tests/test_engine_pause.json rename to tests/test_engine_pause.json diff --git a/engine/tests/test_engine_replica_smoketest.bats b/tests/test_engine_replica_smoketest.bats similarity index 93% rename from engine/tests/test_engine_replica_smoketest.bats rename to tests/test_engine_replica_smoketest.bats index c0d19d35f..89db3d87f 100755 --- a/engine/tests/test_engine_replica_smoketest.bats +++ b/tests/test_engine_replica_smoketest.bats @@ -4,10 +4,8 @@ # configuration of a simulation results in roughly the same output # again, i.e., the simulation is reproducible. -cd "${BATS_TEST_DIRNAME}" -export CLOE_ROOT="${BATS_TEST_DIRNAME}/../.." -load "${CLOE_ROOT}/tests/setup_bats.bash" -load "${CLOE_ROOT}/tests/setup_testname.bash" +load setup_bats +load setup_testname teardown() { # Remove the temporary registry. diff --git a/engine/tests/test_engine_replica_smoketest.json b/tests/test_engine_replica_smoketest.json similarity index 100% rename from engine/tests/test_engine_replica_smoketest.json rename to tests/test_engine_replica_smoketest.json diff --git a/engine/tests/test_engine_smoketest.json b/tests/test_engine_smoketest.json similarity index 100% rename from engine/tests/test_engine_smoketest.json rename to tests/test_engine_smoketest.json diff --git a/tests/test_engine_start_stop.json b/tests/test_engine_start_stop.json new file mode 100644 index 000000000..c1ba40578 --- /dev/null +++ b/tests/test_engine_start_stop.json @@ -0,0 +1,26 @@ +{ + "version": "4", + "controllers": [ + { + "binding": "basic", + "vehicle": "default" + } + ], + "simulators": [ + { + "binding": "nop" + } + ], + "vehicles": [ + { + "name": "default", + "from": { + "simulator": "nop", + "index": 0 + } + } + ], + "triggers": [ + { "event": "start", "action": "succeed" } + ] +} diff --git a/engine/tests/test_engine_sticky_trigger.json b/tests/test_engine_sticky_trigger.json similarity index 100% rename from engine/tests/test_engine_sticky_trigger.json rename to tests/test_engine_sticky_trigger.json diff --git a/engine/tests/test_engine_stuck_controller.json b/tests/test_engine_stuck_controller.json similarity index 100% rename from engine/tests/test_engine_stuck_controller.json rename to tests/test_engine_stuck_controller.json diff --git a/engine/tests/test_engine_stuck_controller_continue.json b/tests/test_engine_stuck_controller_continue.json similarity index 100% rename from engine/tests/test_engine_stuck_controller_continue.json rename to tests/test_engine_stuck_controller_continue.json diff --git a/engine/tests/test_engine_unavailable_component.json b/tests/test_engine_unavailable_component.json similarity index 100% rename from engine/tests/test_engine_unavailable_component.json rename to tests/test_engine_unavailable_component.json diff --git a/engine/tests/test_engine_unavailable_controller.json b/tests/test_engine_unavailable_controller.json similarity index 100% rename from engine/tests/test_engine_unavailable_controller.json rename to tests/test_engine_unavailable_controller.json diff --git a/engine/tests/test_engine_unavailable_simulator.json b/tests/test_engine_unavailable_simulator.json similarity index 100% rename from engine/tests/test_engine_unavailable_simulator.json rename to tests/test_engine_unavailable_simulator.json diff --git a/engine/tests/test_engine_unknown_vehicle.json b/tests/test_engine_unknown_vehicle.json similarity index 100% rename from engine/tests/test_engine_unknown_vehicle.json rename to tests/test_engine_unknown_vehicle.json diff --git a/engine/tests/test_engine_version_absent.json b/tests/test_engine_version_absent.json similarity index 100% rename from engine/tests/test_engine_version_absent.json rename to tests/test_engine_version_absent.json diff --git a/engine/tests/test_engine_version_wrong.json b/tests/test_engine_version_wrong.json similarity index 100% rename from engine/tests/test_engine_version_wrong.json rename to tests/test_engine_version_wrong.json diff --git a/engine/tests/test_engine_watchdog.json b/tests/test_engine_watchdog.json similarity index 100% rename from engine/tests/test_engine_watchdog.json rename to tests/test_engine_watchdog.json diff --git a/plugins/esmini/tests/test_esmini.bats b/tests/test_esmini.bats similarity index 80% rename from plugins/esmini/tests/test_esmini.bats rename to tests/test_esmini.bats index 2fa1fc4a5..64fcc8cca 100755 --- a/plugins/esmini/tests/test_esmini.bats +++ b/tests/test_esmini.bats @@ -1,9 +1,7 @@ #!/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" +load setup_bats +load setup_testname @test "$(testname 'Expect check success' 'test_esmini_open_loop.json' '05be11dc-1904-4f5e-bed7-531adf51a55c')" { cloe-engine check test_esmini_open_loop.json diff --git a/plugins/esmini/tests/test_esmini_closed_loop.json b/tests/test_esmini_closed_loop.json similarity index 100% rename from plugins/esmini/tests/test_esmini_closed_loop.json rename to tests/test_esmini_closed_loop.json diff --git a/plugins/esmini/tests/test_esmini_open_loop.json b/tests/test_esmini_open_loop.json similarity index 100% rename from plugins/esmini/tests/test_esmini_open_loop.json rename to tests/test_esmini_open_loop.json diff --git a/plugins/gndtruth_extractor/tests/test_gndtruth.bats b/tests/test_gndtruth.bats similarity index 93% rename from plugins/gndtruth_extractor/tests/test_gndtruth.bats rename to tests/test_gndtruth.bats index 582a5c50a..a5681b801 100755 --- a/plugins/gndtruth_extractor/tests/test_gndtruth.bats +++ b/tests/test_gndtruth.bats @@ -1,9 +1,7 @@ #!/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" +load setup_bats +load setup_testname # Usage: FILENAME=$(mktemp_gndtruth_out SUFFIX) # diff --git a/plugins/gndtruth_extractor/tests/config_minimator_smoketest.json b/tests/test_gndtruth_config.json similarity index 95% rename from plugins/gndtruth_extractor/tests/config_minimator_smoketest.json rename to tests/test_gndtruth_config.json index 7edadbd8c..b6eaba7d3 100644 --- a/plugins/gndtruth_extractor/tests/config_minimator_smoketest.json +++ b/tests/test_gndtruth_config.json @@ -1,7 +1,7 @@ { "version": "4", "include": [ - "${CLOE_ROOT}/tests/controller_basic.json" + "${CLOE_ROOT}/tests/just_controller_basic.json" ], "simulators": [ { diff --git a/plugins/gndtruth_extractor/tests/test_gndtruth_invalid_file.json b/tests/test_gndtruth_invalid_file.json similarity index 86% rename from plugins/gndtruth_extractor/tests/test_gndtruth_invalid_file.json rename to tests/test_gndtruth_invalid_file.json index 3b27211a7..0aa552d9d 100644 --- a/plugins/gndtruth_extractor/tests/test_gndtruth_invalid_file.json +++ b/tests/test_gndtruth_invalid_file.json @@ -1,7 +1,7 @@ { "version": "4", "include": [ - "config_minimator_smoketest.json" + "test_gndtruth_config.json" ], "controllers": [ { diff --git a/plugins/gndtruth_extractor/tests/test_gndtruth_smoketest.json b/tests/test_gndtruth_smoketest.json similarity index 96% rename from plugins/gndtruth_extractor/tests/test_gndtruth_smoketest.json rename to tests/test_gndtruth_smoketest.json index c57168a79..bc1df7e3b 100644 --- a/plugins/gndtruth_extractor/tests/test_gndtruth_smoketest.json +++ b/tests/test_gndtruth_smoketest.json @@ -1,7 +1,7 @@ { "version": "4", "include": [ - "config_minimator_smoketest.json" + "test_gndtruth_config.json" ], "controllers": [ { diff --git a/plugins/gndtruth_extractor/tests/test_gndtruth_smoketest_output.json b/tests/test_gndtruth_smoketest_output.json similarity index 100% rename from plugins/gndtruth_extractor/tests/test_gndtruth_smoketest_output.json rename to tests/test_gndtruth_smoketest_output.json diff --git a/plugins/gndtruth_extractor/tests/test_gndtruth_smoketest_output.msgpack b/tests/test_gndtruth_smoketest_output.msgpack similarity index 100% rename from plugins/gndtruth_extractor/tests/test_gndtruth_smoketest_output.msgpack rename to tests/test_gndtruth_smoketest_output.msgpack diff --git a/plugins/minimator/tests/test_minimator.bats b/tests/test_minimator.bats similarity index 79% rename from plugins/minimator/tests/test_minimator.bats rename to tests/test_minimator.bats index 8699ec68b..b1b6570f8 100755 --- a/plugins/minimator/tests/test_minimator.bats +++ b/tests/test_minimator.bats @@ -1,9 +1,7 @@ #!/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" +load setup_bats +load setup_testname @test "$(testname 'Expect check success' 'test_minimator_smoketest.json' 'c7a427e7-eb2b-4ae7-85ec-a35b7540d4aa')" { cloe-engine check test_minimator_smoketest.json @@ -14,13 +12,13 @@ load "${CLOE_ROOT}/tests/setup_testname.bash" } @test "$(testname 'Expect check/run success' 'test_minimator_smoketest.json [ts=5ms]' '57254185-5480-4859-b2a5-6c3a211a22e0')" { - local timestep_stack="${CLOE_ROOT}/tests/option_timestep_5.json" + local timestep_stack="option_timestep_5.json" cloe-engine check test_minimator_smoketest.json "${timestep_stack}" cloe-engine run test_minimator_smoketest.json "${timestep_stack}" } @test "$(testname 'Expect check/run success' 'test_minimator_smoketest.json [ts=60ms]' 'a0d4982f-8c02-4759-bc88-cc30a1ccbbf0')" { - local timestep_stack="${CLOE_ROOT}/tests/option_timestep_60.json" + local timestep_stack="option_timestep_60.json" cloe-engine check test_minimator_smoketest.json "${timestep_stack}" cloe-engine run test_minimator_smoketest.json "${timestep_stack}" } diff --git a/plugins/minimator/tests/test_minimator_multi_agent_smoketest.json b/tests/test_minimator_multi_agent_smoketest.json similarity index 93% rename from plugins/minimator/tests/test_minimator_multi_agent_smoketest.json rename to tests/test_minimator_multi_agent_smoketest.json index b3b2f9e19..26bda0f9f 100644 --- a/plugins/minimator/tests/test_minimator_multi_agent_smoketest.json +++ b/tests/test_minimator_multi_agent_smoketest.json @@ -2,7 +2,7 @@ "version": "4", "include": [ "config_minimator_multi_agent_infinite.json", - "${CLOE_ROOT}/tests/triggers_multi_agent.json" + "triggers_multi_agent.json" ], "server": { "listen": false, diff --git a/plugins/minimator/tests/test_minimator_smoketest.json b/tests/test_minimator_smoketest.json similarity index 100% rename from plugins/minimator/tests/test_minimator_smoketest.json rename to tests/test_minimator_smoketest.json diff --git a/plugins/virtue/tests/test_virtue.bats b/tests/test_virtue.bats similarity index 83% rename from plugins/virtue/tests/test_virtue.bats rename to tests/test_virtue.bats index b9f61b0a2..c4b654bdb 100755 --- a/plugins/virtue/tests/test_virtue.bats +++ b/tests/test_virtue.bats @@ -1,9 +1,7 @@ #!/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" +load setup_bats +load setup_testname @test "$(testname 'Expect check success' 'test_virtue_missing_lanes_fail.json' 'd9072cc3-62f3-4f11-bf9e-b514fea67e4b')" { cloe-engine check test_virtue_missing_lanes_fail.json diff --git a/plugins/virtue/tests/test_virtue_missing_lanes_fail.json b/tests/test_virtue_missing_lanes_fail.json similarity index 92% rename from plugins/virtue/tests/test_virtue_missing_lanes_fail.json rename to tests/test_virtue_missing_lanes_fail.json index fdfbf9297..60be5ba93 100644 --- a/plugins/virtue/tests/test_virtue_missing_lanes_fail.json +++ b/tests/test_virtue_missing_lanes_fail.json @@ -1,7 +1,7 @@ { "version": "4", "include": [ - "${CLOE_ROOT}/tests/config_nop_infinite.json" + "config_nop_infinite.json" ], "defaults": { "controllers": [ diff --git a/plugins/virtue/tests/test_virtue_missing_lanes_pass.json b/tests/test_virtue_missing_lanes_pass.json similarity index 84% rename from plugins/virtue/tests/test_virtue_missing_lanes_pass.json rename to tests/test_virtue_missing_lanes_pass.json index eb76d9f81..55d90d104 100644 --- a/plugins/virtue/tests/test_virtue_missing_lanes_pass.json +++ b/tests/test_virtue_missing_lanes_pass.json @@ -1,7 +1,7 @@ { "version": "4", "include": [ - "${CLOE_ROOT}/plugins/minimator/tests/config_minimator_infinite.json" + "config_minimator_infinite.json" ], "server": { "listen": false