| 650 | } |
| 651 | |
| 652 | bool sendFilesForTest() |
| 653 | { |
| 654 | std::vector<std::string> forced_files; |
| 655 | const char* forced_libs_group = getenv("AUTOTESTER_LIBS_GROUP"); |
| 656 | const char* forced_libs_dir = getenv("AUTOTESTER_LIBS_DIR"); |
| 657 | |
| 658 | if (forced_libs_group) |
| 659 | { |
| 660 | if (file_exists(forced_libs_group)) |
| 661 | { |
| 662 | forced_files.emplace_back(forced_libs_group); |
| 663 | } else { |
| 664 | std::cerr << "[Error] Env var for libs group given, but no such file...?" << std::endl; |
| 665 | forced_libs_group = nullptr; |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | if (!forced_libs_group && forced_libs_dir) |
| 670 | { |
| 671 | forced_files = globVector(std::string(forced_libs_dir) + "/*.8xv"); |
| 672 | } |
| 673 | |
| 674 | if ((forced_libs_group || forced_libs_dir) && forced_files.empty()) |
| 675 | { |
| 676 | std::cerr << "[Error] Env var for libs-dir/group given, but no files found...?" << std::endl; |
| 677 | return false; |
| 678 | } else { |
| 679 | for (const auto& file : forced_files) |
| 680 | { |
| 681 | if (debugMode) |
| 682 | { |
| 683 | std::cout << "- Sending forced file " << file << "... "; |
| 684 | } |
| 685 | if (cemucore::emu_send_variable(file.c_str(), cemucore::LINK_FILE) != cemucore::LINK_GOOD) |
| 686 | { |
| 687 | if (debugMode) |
| 688 | { |
| 689 | std::cout << std::endl; |
| 690 | } |
| 691 | std::cerr << "[Error] Forced file couldn't be sent" << std::endl; |
| 692 | return false; |
| 693 | } |
| 694 | if (debugMode) |
| 695 | { |
| 696 | std::cout << "[OK]" << std::endl; |
| 697 | } |
| 698 | } |
| 699 | } |
| 700 | |
| 701 | for (const auto& file : config.transfer_files) |
| 702 | { |
| 703 | if (debugMode) |
| 704 | { |
| 705 | std::cout << "- Sending file " << file << "... "; |
| 706 | } |
| 707 | if (cemucore::emu_send_variable(file.c_str(), cemucore::LINK_FILE) != cemucore::LINK_GOOD) |
| 708 | { |
| 709 | if (debugMode) |
no test coverage detected