当前位置: 首页 > news >正文

档案网站建设的原则创建免费网站

档案网站建设的原则,创建免费网站,佛山市点精网络科技有限公司,退工在那个网站上做🍅 我是蚂蚁小兵,专注于车载诊断领域,尤其擅长于对CANoe工具的使用🍅 寻找组织 ,答疑解惑,摸鱼聊天,博客源码,点击加入👉【相亲相爱一家人】🍅 玩转CANoe&…
  • 🍅 我是蚂蚁小兵,专注于车载诊断领域,尤其擅长于对CANoe工具的使用
  • 🍅 寻找组织 ,答疑解惑,摸鱼聊天,博客源码,点击加入👉【相亲相爱一家人】
  • 🍅 玩转CANoe,博客目录大全,点击跳转👉

📘前言

  • 🍅 在做测试用例开发的时候,我们可能期望在执行测试用例之前,做一些变量初始化,复制,文本处理等前瞻性工作,

  • 🍅 有些小伙伴可能想通过on starton prestart 实现,但这是不理智的,在test units and test moduleson start 是不可用的,而 on prestart 初始化变量等是不可靠的。

  • 🍅 所以如果是XML test modules类型的测试用例,想要完成初始化的一些工作,使用XML调用 CAPL Test Function是一个不错的选择

CANoe中XML编程常用语法

  • 📘前言
  • 🌎CAPL Test Function
  • 🌎测试用例1(preparation标签下的无参数调用)
  • 🌎测试用例2(testcase标签下的带参数调用)
  • 🌎测试用例3(completion标签下的带参数调用)
  • 🌎总结

🌎CAPL Test Function

下图是Call CAPL Test Function的Help解释:

  • 1,XML test module 中的XML文件可以调用CAPL中的Test Function,且只能被XML调用。
  • 2,调用capl中的testfunctioncapltestfunction标签,且该标签无法独立使用,需被 或 或 标签包含使用。
    3,以最简单的例子 <capltestfunction name="test_01" title="call test function : test_01"></capltestfunction>
  • name的值必须和CAPL中的testfunction 一致。
  • title 的值可以任意填写
    4,testfunction 的函数是没有返回值的。
    5,capltestfunction是可以传参调用的,支持的参数有:float|int|string|signal|envvar|sysvar

在这里插入图片描述

🌎测试用例1(preparation标签下的无参数调用)

  • 1️⃣ 如下图的CAPL界面,创建了一个testfunction test_01()

在这里插入图片描述


  • 2️⃣ 创建的xml文件如下图,通过 capltestfunction 标签调用 capl脚本中创建的 test_01()函数

在这里插入图片描述

<testmodule title="XML Test Module" version="1.1"><description>XML Test Module</description><preparation><initialize title="Initialize test module" wait="200"><!-- <envvar name="">1</envvar> --></initialize><capltestfunction name="test_01" title="call test function : test_01"></capltestfunction></preparation><testgroup title="UDS">			<capltestcase name="TC_0001" /></testgroup><completion><initialize title="Adding testreport info" wait="500"><!-- <envvar name="">0</envvar> --></initialize></completion>
</testmodule>

  • 2️⃣ 例如,新建一个xml文件,命名为test.xml ,写入如下代码,新建一个XML Test Modele 节点,测试下,观察测试报告的输出
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<testmodule title="testmodel_tag" version="1.13"></testmodule>

  • 3️⃣ 根据输出报告可以看出 title=“testmodel_tag” ,输出的报告名字就是testmodel_tag

在这里插入图片描述


  • 3️⃣ 创建的Test Module测试节点。然后执行测试,根据结果可以看到XML成功调用了函数test_01
    在这里插入图片描述
    在这里插入图片描述

🌎测试用例2(testcase标签下的带参数调用)

  • 1️⃣ 如下图的CAPL界面,创建了一个testfunction test_02(int s)
    在这里插入图片描述

  • 2️⃣通过 testcase 标签调用 capl脚本中创建的 test_02()函数
<testmodule title="XML Test Module" version="1.1"><description>XML Test Module</description><preparation><initialize title="Initialize test module" wait="200"><!-- <envvar name="">1</envvar> --></initialize><capltestfunction name="test_01" title="preparation标签下的无参数调用"></capltestfunction></preparation><testgroup title="UDS">			<capltestcase name="TC_0001" /><testcase title="TC_0002" ident="TC_0002">	<capltestfunction name="test_02" title="testcase标签下的带参数调用"><caplparam name="para1" type="int">0x01</caplparam></capltestfunction></testcase></testgroup><completion><initialize title="Adding testreport info" wait="500"><!-- <envvar name="">0</envvar> --></initialize></completion>
</testmodule>

  • 3️⃣ 输出结果,根据结果可以看到XML成功调用了函数test_02
    在这里插入图片描述

🌎测试用例3(completion标签下的带参数调用)

  • 1️⃣ 如下图的CAPL界面,创建了一个testfunction test_03(char s[])
/*@!Encoding:936*/
testfunction test_01()
{write("***************XML调用了 testfunction test_01***************");
}testfunction test_02(int s)
{write("***************XML调用了 testfunction test_02 ,接收参数:%d***************",s);
}testfunction test_03(char s[])
{write("***************XML调用了 testfunction test_03 ,接收参数:%s***************",s);
}testcase TC_0001()
{}

  • 2️⃣通过 completion 标签调用 capl脚本中创建的 test_03()函数
<testmodule title="XML Test Module" version="1.1"><description>XML Test Module</description><preparation><capltestfunction name="test_01" title="preparation标签下的无参数调用"></capltestfunction></preparation><testgroup title="UDS">			<capltestcase name="TC_0001" /><testcase title="TC_0002" ident="TC_0002">	<capltestfunction name="test_02" title="testcase标签下的带参数调用"><caplparam name="para1" type="int">0x01</caplparam></capltestfunction></testcase></testgroup><completion><capltestfunction name="test_03" title="completion标签下的带参数调用"><caplparam name="para1" type="string">hello</caplparam></capltestfunction></completion>
</testmodule>

  • 3️⃣ 输出结果,根据结果可以看到XML成功调用了函数test_03
    在这里插入图片描述

🌎总结

23

7

  • 🚩要有最朴素的生活,最遥远的梦想,即使明天天寒地冻,路遥马亡!

  • 🚩如果这篇博客对你有帮助,请 “点赞” “评论”“收藏”一键三连 哦!码字不易,大家的支持就是我坚持下去的动力。
    18
http://www.mnyf.cn/news/35275.html

相关文章:

  • wordpress在线客服插件seo网站排名后退
  • wordpress识图搜索代码全国seo搜索排名优化公司
  • 西安网站制作推广网络推广和网络营销的区别
  • phpcms网站打开空白seo结算系统
  • 电商网站获取流量的方法seo标题优化关键词怎么选
  • 物流网站首页图片饥饿营销的十大案例
  • 网站怎样制作 优帮云it培训班真的有用吗
  • 建设网站要用到什么语言三只松鼠网络营销策略
  • 为wordpress添加虚拟用户权限网站免费优化软件
  • WordPress和ftp区别优化大师电脑版
  • 手机网站在线客服长沙百度网站排名优化
  • 为什么资讯网站荣誉被收录全国最新疫情实时状况地图
  • 汕头市濠江区政府门户网站关键词优化软件有哪些
  • 东莞建站模板代理百度引擎搜索
  • 刚开始的网站开发公司网销怎么做
  • 中国免费建站网建立网站费用大概需要多少钱
  • 泉州网站建设 推广电商运营
  • wordpress侧边栏导航seo运营是什么意思
  • 义乌外贸公司网站网站建设维护
  • 和萝莉做的电影网站seo搜索引擎优化课程
  • 多用户商城app源码站长seo软件
  • 如何java做网站成都高端企业网站建设
  • 网站建设流程教程深圳白帽优化
  • 湖北网站建设公司引擎搜索下载
  • 商贸行业网站建设公司新网站seo外包
  • 怎么找专业的营销团队深圳百度首页优化
  • 郑州网站建设制作重庆seo快速优化
  • 小米开放平台百度小程序关键词优化
  • 电子商务网站建设毕业论文宁波网站推广公司报价
  • 上海做网站多少钱百度seo招聘