mirror of
https://github.com/CLIUtils/CLI11.git
synced 2026-01-19 04:52:08 +00:00
try adding a test for failure with macos arm precompile (#1238)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
39
.github/workflows/tests.yml
vendored
39
.github/workflows/tests.yml
vendored
@@ -10,6 +10,9 @@ concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CTEST_OUTPUT_ON_FAILURE: "1"
|
||||
|
||||
@@ -126,7 +129,7 @@ jobs:
|
||||
- name: Build
|
||||
run: cmake --build build -j2
|
||||
|
||||
cuda12-build:
|
||||
cuda13-build:
|
||||
name: CUDA 13 build only
|
||||
runs-on: ubuntu-latest
|
||||
container: nvidia/cuda:13.0.0-devel-ubuntu22.04
|
||||
@@ -241,6 +244,40 @@ jobs:
|
||||
- name: Run tests
|
||||
run: ctest --output-on-failure -L Packaging
|
||||
working-directory: build
|
||||
|
||||
install-precompiled-macos:
|
||||
name: install tests precompiled macos
|
||||
runs-on: macos-15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Configure
|
||||
run: cmake -S . -B build -DCLI11_INSTALL_PACKAGE_TESTS=ON -DCLI11_ENABLE_EXTRA_VALIDATORS=ON -DCMAKE_INSTALL_PREFIX=/Users/runner/work/install -DCLI11_PRECOMPILED=ON -DCMAKE_CXX_STANDARD=20
|
||||
- name: Build
|
||||
run: cmake --build build -j2
|
||||
- name: install
|
||||
run: cmake --install build
|
||||
- name: Run tests
|
||||
run: ctest --output-on-failure -L Packaging
|
||||
working-directory: build
|
||||
|
||||
install-precompiled-macos-no-validators:
|
||||
name: install tests precompiled macos no validators
|
||||
runs-on: macos-15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Configure
|
||||
run: cmake -S . -B build -DCLI11_INSTALL_PACKAGE_TESTS=ON -DCLI11_ENABLE_EXTRA_VALIDATORS=OFF -DCMAKE_INSTALL_PREFIX=/Users/runner/work/install -DCLI11_PRECOMPILED=ON
|
||||
- name: Build
|
||||
run: cmake --build build -j2
|
||||
- name: install
|
||||
run: cmake --install build
|
||||
- name: Run tests
|
||||
run: ctest --output-on-failure -L Packaging
|
||||
working-directory: build
|
||||
|
||||
install-single_file:
|
||||
name: install tests single file
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#define CLI11_ENABLE_EXTRA_VALIDATORS 1
|
||||
|
||||
#pragma once
|
||||
#if (defined(CLI11_ENABLE_EXTRA_VALIDATORS) && CLI11_ENABLE_EXTRA_VALIDATORS == 1) || \
|
||||
(!defined(CLI11_DISABLE_EXTRA_VALIDATORS) || CLI11_DISABLE_EXTRA_VALIDATORS == 0)
|
||||
|
||||
@@ -325,6 +325,9 @@ CLI11_INLINE void Option::run_callback() {
|
||||
current_option_state_ = option_state::callback_run;
|
||||
if(callback_) {
|
||||
const results_t &send_results = proc_results_.empty() ? results_ : proc_results_;
|
||||
if(send_results.empty()) {
|
||||
return;
|
||||
}
|
||||
bool local_result = callback_(send_results);
|
||||
if(used_default_str) {
|
||||
// we only clear the results if the callback was actually used
|
||||
|
||||
@@ -362,7 +362,6 @@ if(CLI11_INSTALL_PACKAGE_TESTS)
|
||||
add_test(
|
||||
package-config-tests
|
||||
${CMAKE_CTEST_COMMAND}
|
||||
-C
|
||||
--build-and-test
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/package_config_tests"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/package_config_tests"
|
||||
|
||||
@@ -55,7 +55,7 @@ TEST_CASE("file_fail") {
|
||||
CLI::FuzzApp fuzzdata;
|
||||
auto app = fuzzdata.generateApp();
|
||||
|
||||
int index = GENERATE(range(1, 9));
|
||||
int index = GENERATE(range(1, 10));
|
||||
auto parseData = loadFailureFile("fuzz_file_fail", index);
|
||||
std::stringstream out(parseData);
|
||||
try {
|
||||
@@ -149,7 +149,7 @@ TEST_CASE("app_file_roundtrip") {
|
||||
result = fuzzdata2.compare(fuzzdata);
|
||||
}
|
||||
*/
|
||||
INFO("Failure in test case " << index)
|
||||
INFO("Failure in test case " << index);
|
||||
CHECK(result);
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ TEST_CASE("app_roundtrip_custom") {
|
||||
std::size_t pstring_start{0};
|
||||
pstring_start = fuzzdata.add_custom_options(app.get(), parseData);
|
||||
INFO("Failure in test case " << index << " file length=" << parseData.size() << " pstring start at "
|
||||
<< pstring_start)
|
||||
<< pstring_start);
|
||||
if(pstring_start > 0) {
|
||||
app->parse(parseData.substr(pstring_start));
|
||||
CHECK_NOTHROW(app->help("", CLI::AppFormatMode::All));
|
||||
@@ -392,7 +392,7 @@ TEST_CASE("app_roundtrip_parse_normal_fail") {
|
||||
CHECK(true);
|
||||
return;
|
||||
}
|
||||
INFO("Failure in test case " << index)
|
||||
INFO("Failure in test case " << index);
|
||||
try {
|
||||
if(pstring_start > 0) {
|
||||
app->parse(parseData.substr(pstring_start));
|
||||
|
||||
1
tests/fuzzFail/fuzz_file_fail9
Normal file
1
tests/fuzzFail/fuzz_file_fail9
Normal file
@@ -0,0 +1 @@
|
||||
vdtr9=[
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.14...4.0)
|
||||
cmake_minimum_required(VERSION 3.14...4.1)
|
||||
|
||||
project(CLI11-package-config-test)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user