Tab Generation
ci / checks (push) Successful in 1h19m14s

This commit is contained in:
khodowany
2026-09-20 16:20:43 -05:00
parent 68ded4d8c8
commit cf7c0c010c
423 changed files with 1422 additions and 1332 deletions
+10 -10
View File
@@ -165,11 +165,11 @@ auto checksum(std::string const &bytes) -> std::string {
return result;
}
auto write_score(std::filesystem::path const &path, std::string key = "C") -> void {
auto write_score(std::filesystem::path const &path, std::string part = "Lead") -> void {
auto score = boost::json::parse(R"({"schema_version":3,"music":{"metadata":{"title":"Fixture","composer":"Composer",
"key_signature":"C","time_signature":"4/4"},"staves":[{"name":"Lead","measures":[{"voices":[]}]}]},
"presentation":{"width":976,"height":484,"pages":[]}})");
score.at("music").at("metadata").as_object()["key_signature"] = key;
score.at("music").at("staves").as_array().front().as_object()["name"] = part;
auto &pages = score.at("presentation").at("pages").as_array();
for (auto index = std::uint32_t{1}; index <= 2U; ++index) {
auto relative = path.stem().string() + ".pages/" + std::to_string(index) + ".png";
@@ -184,10 +184,10 @@ auto make_assets(vamp_zero::config const &config) -> void {
auto root = std::filesystem::path{config.runtime.assets_path};
write_score(root / "songs" / "first.json");
write_score(root / "songs" / "second.json");
for (auto key : vamp_zero::practice_key_names()) {
auto name = std::string{key};
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" / "001" / (name + ".json"), std::string{key});
write_score(root / "practice" / "001" / (name + ".json"), std::string{part_name});
}
BOOST_REQUIRE(vamp_test::build_catalogue(root, config.database.path));
}
@@ -363,7 +363,7 @@ BOOST_AUTO_TEST_CASE(readiness_reads_packaged_catalogue_without_hardware_or_hear
BOOST_REQUIRE(exercises);
BOOST_TEST(songs->parts.size() == 2U);
BOOST_REQUIRE_EQUAL(exercises->exercises.size(), 1U);
BOOST_TEST(exercises->exercises.front().variants.size() == 12U);
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;
@@ -374,8 +374,8 @@ BOOST_AUTO_TEST_CASE(readiness_reads_packaged_catalogue_without_hardware_or_hear
require_no_probe(config, true);
}
BOOST_AUTO_TEST_CASE(readiness_validates_later_pages_parts_and_practice_variants) {
for (std::char_t const *relative : {"songs/first.pages/2.png", "songs/second.pages/2.png", "practice/001/d.pages/2.png"}) {
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/001/electric.pages/2.png"}) {
auto root = temporary_directory{};
auto config = fixture_config(root.path);
make_assets(config);
@@ -394,8 +394,8 @@ 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/001/c.json";
write_score(path);
auto path = assets / "practice/001/acoustic.json";
write_score(path, "Acoustic");
auto score = boost::json::parse(read_file(path));
score.as_object()["playback"] = boost::json::parse(read_file(fixture / "score.json")).at("playback");
write_file(path, boost::json::serialize(score));