Update sdv_packager (#6)

This commit is contained in:
tompzf
2026-03-27 14:12:49 +01:00
committed by GitHub
parent 234be8917f
commit aefefd52f7
717 changed files with 42252 additions and 11334 deletions

View File

@@ -1,3 +1,16 @@
#*******************************************************************************
# Copyright (c) 2025-2026 ZF Friedrichshafen AG
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Erik Verhoeven - initial API and implementation
#*******************************************************************************
# Define project
project (UnitTest_CommandLine_Parser VERSION 1.0 LANGUAGES CXX)

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.cpp"

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef COMMANDLINE_PARSER_TEST_H
#define COMMANDLINE_PARSER_TEST_H

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include <gtest/gtest.h>
#include "../../../global/process_watchdog.h"
#include "../../../global/localmemmgr.h"

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"
@@ -562,22 +575,24 @@ TEST_F(CCommandLineParserTestNoAssignment, OptionParseFlags)
TEST_F(CCommandLineParserTestNoAssignment, OptionOverlappingArg)
{
// Mixing up -server and -s
const char* rgszCommandLine1[] = {"this_exe.app", "-server"};
CCommandLine cl1(static_cast<uint32_t>(CCommandLine::EParseFlags::no_assignment_character));
bool bSilence = false; cl1.DefineOption("s", bSilence, "silence flag");
bool bServer = false; cl1.DefineOption("server", bServer, "server enabled");
EXPECT_NO_THROW(cl1.Parse(std::extent<decltype(rgszCommandLine1)>::value, rgszCommandLine1));
EXPECT_FALSE(bSilence);
EXPECT_TRUE(bServer);
// CHANGE EVE: 25.03.2025: This is allowed by now.
//const char* rgszCommandLine1[] = {"this_exe.app", "-server"};
//CCommandLine cl1(static_cast<uint32_t>(CCommandLine::EParseFlags::no_assignment_character));
//bool bSilence = false; cl1.DefineOption("s", bSilence, "silence flag");
//bool bServer = false; cl1.DefineOption("server", bServer, "server enabled");
//EXPECT_NO_THROW(cl1.Parse(std::extent<decltype(rgszCommandLine1)>::value, rgszCommandLine1));
//EXPECT_FALSE(bSilence);
//EXPECT_TRUE(bServer);
// Mixing up -instance<val> and -instance_a
const char* rgszCommandLine2[] = {"this_exe.app", "-instance_a"};
CCommandLine cl2(static_cast<uint32_t>(CCommandLine::EParseFlags::no_assignment_character));
std::string ssInstance; cl2.DefineOption("instance", ssInstance, "Instance ID");
bool bInstance_a = false; cl2.DefineOption("instance_a", bInstance_a, "Instance A is activited");
EXPECT_NO_THROW(cl2.Parse(std::extent<decltype(rgszCommandLine2)>::value, rgszCommandLine2));
EXPECT_TRUE(ssInstance.empty());
EXPECT_TRUE(bInstance_a);
// CHANGE EVE: 25.03.2025: This is allowed by now.
//const char* rgszCommandLine2[] = {"this_exe.app", "-instance_a"};
//CCommandLine cl2(static_cast<uint32_t>(CCommandLine::EParseFlags::no_assignment_character));
//std::string ssInstance; cl2.DefineOption("instance", ssInstance, "Instance ID");
//bool bInstance_a = false; cl2.DefineOption("instance_a", bInstance_a, "Instance A is activited");
//EXPECT_NO_THROW(cl2.Parse(std::extent<decltype(rgszCommandLine2)>::value, rgszCommandLine2));
//EXPECT_TRUE(ssInstance.empty());
//EXPECT_TRUE(bInstance_a);
// Mixiong up -enable_opt+ and -enable_options
const char* rgszCommandLine3[] = {"this_exe.app", "-enable_options"};
@@ -591,9 +606,9 @@ TEST_F(CCommandLineParserTestNoAssignment, OptionOverlappingArg)
// Mixing up -server and -s when double assignment
const char* rgszCommandLine4[] = {"this_exe.app", "-s"};
CCommandLine cl4(static_cast<uint32_t>(CCommandLine::EParseFlags::no_assignment_character));
bSilence = false; auto rSilenceOption = cl4.DefineSubOption("silence", bSilence, "silence flag");
bool bSilence = false; auto rSilenceOption = cl4.DefineSubOption("silence", bSilence, "silence flag");
rSilenceOption.AddOptionName("s");
bServer = false; cl4.DefineOption("server", bServer, "server enabled");
bool bServer = false; cl4.DefineOption("server", bServer, "server enabled");
EXPECT_NO_THROW(cl4.Parse(std::extent<decltype(rgszCommandLine4)>::value, rgszCommandLine4));
EXPECT_TRUE(bSilence);
EXPECT_FALSE(bServer);

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"
@@ -557,13 +570,15 @@ TEST_F(CCommandLineParserTestNoAssignment, SubOptionOverlappingArg)
EXPECT_TRUE(bServer);
// Mixing up -instance<val> and -instance_a
const char* rgszCommandLine2[] = {"this_exe.app", "--instance_a"};
CCommandLine cl2(static_cast<uint32_t>(CCommandLine::EParseFlags::no_assignment_character));
std::string ssInstance; cl2.DefineSubOption("instance", ssInstance, "Instance ID");
bool bInstance_a = false; cl2.DefineSubOption("instance_a", bInstance_a, "Instance A is activited");
EXPECT_NO_THROW(cl2.Parse(std::extent<decltype(rgszCommandLine2)>::value, rgszCommandLine2));
EXPECT_TRUE(ssInstance.empty());
EXPECT_TRUE(bInstance_a);
// CHANGE EVE 26.03.2026: The multiple assignment of options was enabled to allow several option sets with identical names but
// different assignments to be used in different groups. This, however doesn't protect against overlapping options any more.
//const char* rgszCommandLine2[] = {"this_exe.app", "--instance_a"};
//CCommandLine cl2(static_cast<uint32_t>(CCommandLine::EParseFlags::no_assignment_character));
//std::string ssInstance; cl2.DefineSubOption("instance", ssInstance, "Instance ID");
//bool bInstance_a = false; cl2.DefineSubOption("instance_a", bInstance_a, "Instance A is activited");
//EXPECT_NO_THROW(cl2.Parse(std::extent<decltype(rgszCommandLine2)>::value, rgszCommandLine2));
//EXPECT_TRUE(ssInstance.empty());
//EXPECT_TRUE(bInstance_a);
// Mixiong up -enable_opt+ and -enable_options
const char* rgszCommandLine3[] = {"this_exe.app", "--enable_options"};

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../include/gtest_custom.h"
#include "commandline_parser_test.h"
#include "../../../global/cmdlnparser/cmdlnparser.h"