+3
-13
@@ -189,11 +189,6 @@ auto make_assets(vamp_zero::config const &config) -> void {
|
||||
auto root = std::filesystem::path{config.runtime.assets_path};
|
||||
write_score(root / "songs" / "first.json", root);
|
||||
write_score(root / "songs" / "second.json", root);
|
||||
for (auto part_name : vamp_zero::practice_part_names()) {
|
||||
auto name = std::string{part_name};
|
||||
name.front() = static_cast<std::char_t>(name.front() - 'A' + 'a');
|
||||
write_score(root / "practice" / "0001" / (name + ".json"), root, std::string{part_name});
|
||||
}
|
||||
BOOST_REQUIRE(vamp_test::build_catalog(root, config.database.path));
|
||||
}
|
||||
|
||||
@@ -359,16 +354,11 @@ BOOST_AUTO_TEST_CASE(readiness_reads_packaged_catalog_without_hardware_or_heartb
|
||||
BOOST_TEST(!std::filesystem::exists(config.runtime.heartbeat_path));
|
||||
require_no_probe(config);
|
||||
auto io = boost::asio::io_context{};
|
||||
auto performance = boost::asio::co_spawn(io, vamp_zero::async_load_performance_library(io.get_executor(), config.database, config.runtime.assets_path), boost::asio::use_future);
|
||||
auto practice = boost::asio::co_spawn(io, vamp_zero::async_load_practice_library(io.get_executor(), config.database, config.runtime.assets_path), boost::asio::use_future);
|
||||
auto performance = boost::asio::co_spawn(io, vamp_zero::async_load_catalog(io.get_executor(), config.database, config.runtime.assets_path), boost::asio::use_future);
|
||||
io.run();
|
||||
auto songs = performance.get();
|
||||
auto exercises = practice.get();
|
||||
BOOST_REQUIRE(songs);
|
||||
BOOST_REQUIRE(exercises);
|
||||
BOOST_TEST(songs->parts.size() == 2U);
|
||||
BOOST_REQUIRE_EQUAL(exercises->exercises.size(), 1U);
|
||||
BOOST_TEST(exercises->exercises.front().parts.size() == 3U);
|
||||
write_file(config.runtime.heartbeat_path, "existing heartbeat");
|
||||
auto heartbeat_time = std::filesystem::last_write_time(config.runtime.heartbeat_path);
|
||||
config.runtime.exit_after_startup = true;
|
||||
@@ -380,7 +370,7 @@ BOOST_AUTO_TEST_CASE(readiness_reads_packaged_catalog_without_hardware_or_heartb
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(readiness_validates_later_pages_and_parts) {
|
||||
for (std::char_t const *relative : {"songs/first.pages/2.png", "songs/second.pages/2.png", "practice/0001/electric.pages/2.png"}) {
|
||||
for (std::char_t const *relative : {"songs/first.pages/2.png", "songs/second.pages/2.png"}) {
|
||||
auto root = temporary_directory{};
|
||||
auto config = fixture_config(root.path);
|
||||
make_assets(config);
|
||||
@@ -422,7 +412,7 @@ BOOST_AUTO_TEST_CASE(readiness_validates_generated_audio_using_configured_asset_
|
||||
auto assets = std::filesystem::path{config.runtime.assets_path};
|
||||
auto fixture = std::filesystem::path{VAMP_TEST_PLAYBACK_ASSETS_DIR};
|
||||
std::filesystem::copy(fixture / "audio", assets / "audio", std::filesystem::copy_options::recursive);
|
||||
auto path = assets / "practice/0001/acoustic.json";
|
||||
auto path = assets / "songs/acoustic.json";
|
||||
write_score(path, assets, "Acoustic");
|
||||
auto score = boost::json::parse(read_file(path));
|
||||
score.as_object()["playback"] = boost::json::parse(read_file(fixture / "score.json")).at("playback");
|
||||
|
||||
Reference in New Issue
Block a user