CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
75 lines
2.8 KiB
C++
75 lines
2.8 KiB
C++
/* Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "args.h"
|
|
|
|
#include <cstdlib>
|
|
#include <cstdint>
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
inline void
|
|
parseCli(args::ArgumentParser &parser, int argc, char **argv)
|
|
{
|
|
try {
|
|
parser.ParseCLI(argc, argv);
|
|
}
|
|
catch (const args::Help &) {
|
|
std::cout << parser;
|
|
std::exit(EXIT_SUCCESS);
|
|
}
|
|
catch (const args::Error &error) {
|
|
std::cerr << error.what() << '\n' << parser;
|
|
std::exit(EXIT_FAILURE);
|
|
}
|
|
}
|
|
|
|
struct SystemTestOptions {
|
|
std::string ais_capable_dir;
|
|
uint32_t sleep_seconds;
|
|
bool allow_skip_fastpath{false};
|
|
void parseTestOptions(int argc, char **argv)
|
|
{
|
|
args::ArgumentParser parser{"System test options"};
|
|
[[maybe_unused]] args::HelpFlag help_arg(parser, "help", "Show this help message",
|
|
args::Matcher{'h', "help"});
|
|
args::ValueFlag<std::string> ais_capable_dir_arg(parser, "path", "Path to AIS capable directory",
|
|
args::Matcher{"ais-capable-dir"}, "/tmp",
|
|
args::Options::Single);
|
|
args::ValueFlag<uint32_t> sleep_on_exit_arg(parser, "seconds", "Sleep before returning to main",
|
|
args::Matcher{"sleep-on-exit"}, 0U,
|
|
args::Options::Single);
|
|
args::Flag allow_skip_fastpath_arg(
|
|
parser, "allow-skip-fastpath",
|
|
"Skip fastpath-only tests instead of failing when fastpath is unavailable",
|
|
args::Matcher{"allow-skip-fastpath"});
|
|
|
|
parseCli(parser, argc, argv);
|
|
|
|
ais_capable_dir = args::get(ais_capable_dir_arg);
|
|
sleep_seconds = args::get(sleep_on_exit_arg);
|
|
allow_skip_fastpath = args::get(allow_skip_fastpath_arg);
|
|
}
|
|
};
|
|
|
|
struct UnitTestOptions {
|
|
uint32_t sleep_seconds;
|
|
void parseTestOptions(int argc, char **argv)
|
|
{
|
|
args::ArgumentParser parser{"Unit test options"};
|
|
[[maybe_unused]] args::HelpFlag help_arg(parser, "help", "Show this help message",
|
|
args::Matcher{'h', "help"});
|
|
args::ValueFlag<uint32_t> sleep_on_exit_arg(parser, "seconds", "Sleep before returning to main",
|
|
args::Matcher{"sleep-on-exit"}, 0U,
|
|
args::Options::Single);
|
|
|
|
parseCli(parser, argc, argv);
|
|
|
|
sleep_seconds = args::get(sleep_on_exit_arg);
|
|
}
|
|
};
|