我想使用Google-Test进行单元测试,但所有测试文件均以vcast格式编写,因此为了使我选择使用python的自动化,编写了将vcast转换为gtest的脚本
vcast文件的示例:
-- VectorCAST 6.4b (01/11/16)
-- Test Case Script
--
-- Environment : TESTSUITE
-- Unit(s) Under Test: ADA_WORDS ASKI BAG_TEST_HELP CONDITIONS FL_TIME FORKER LB_TEST_HELP LOCKS NAV_TYPES OPER_DEF REFLECT_TESTER TYPES
--
-- Script Features
TEST.SCRIPT_FEATURE:MULTIPLE_UUT_SUPPORT
TEST.SCRIPT_FEATURE:MIXED_CASE_NAMES
TEST.SCRIPT_FEATURE:ADA_DIRECT_ARRAY_INDEXING
--
-- Unit: ADA_WORDS
-- Subprogram: IS_DELIMITER
-- Test Case: IS_DELIMITER.001
TEST.UNIT:ADA_WORDS
TEST.SUBPROGRAM:IS_DELIMITER
TEST.NEW
TEST.NAME:IS_DELIMITER.001
TEST.VALUE:ADA_WORDS.<<GLOBAL>>.cb:cTrue
TEST.EXPECTED:ADA_WORDS.<<GLOBAL>>.cb:cFalse
TEST.END
-- Test Case: BASIS-PATH-001-TEMPLATE
TEST.UNIT:ADA_WORDS
TEST.SUBPROGRAM:IS_DELIMITER
TEST.NEW
TEST.NAME:BASIS-PATH-001-TEMPLATE
TEST.BASIS_PATH:1 of 2
TEST.NOTES:
This is an automatically generated test case.
Test Path 1
(1) case C ==> '&' | ''' | '(' | ')' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' | '>' | '|'
Test Case Generation Notes:
Conflict: A branch uses an unsupported enumeral (C) in branch 1
Conflict: Cannot determine any comparisons (ADA_WORDS.IS_DELIMITER.C)
TEST.END_NOTES:
TEST.END
我的输出是:
#include<iostream>
// GoogleTEST 6.4b (03/04/2020)
// Test Case Script
//
// Environment : TESTSUITE
// Unit(s) Under Test: ADA_WORDS ASKI BAG_TEST_HELP CONDITIONS FL_TIME FORKER LB_TEST_HELP LOCKS NAV_TYPES OPER_DEF REFLECT_TESTER TYPES
//
// Script Features
//
// Unit: ADA_WORDS
#include "ADA_WORDS.h"
#include "ADA_WORDS.cpp"
// Subprogram: IS_DELIMITER
// Test Case: IS_DELIMITER.001
TEST(IS_DELIMITER_001, gtest_IS_DELIMITER_001) {
cb = 1;
IS_DELIMITER();
EXPECT_EQ(cb,0);
}
// Test Case: BASIS-PATH-001-TEMPLATE
TEST(BASIS-PATH-001-TEMPLATE, gtest_BASIS-PATH-001-TEMPLATE) {
IS_DELIMITER();
}
对于第一个测试用例,所有行都已转换我的问题是关于第二个 如何转换TEST.BASIS_PATH:1(共2个),TEST.NOTES:以及它们在googleTest中的等效项
谢谢