詹金斯与谷歌测试失败通过
问题描述:
我试图在批处理脚本运行谷歌测试在詹金斯运行测试,而测试都通过,詹金斯的工作状态是失败。詹金斯与谷歌测试失败通过
这里是我使用的批次:
@echo off
setlocal ENABLEDELAYEDEXPANSION
call "C:\Program Files (x86)\Maxim Integrated\eclipse\eclipsec.exe" --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import ".\Loader" -data ./ -cleanBuild "Loader/UnitTest" && (
call .\Loader\UnitTest\Loader.exe
echo Loader status = !ERRORLEVEL!
)
echo !ERRORLEVEL!
这里是AllTest.cpp在main()的存在:
#include "gtest/gtest.h"
extern "C" void __gcov_flush();
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
int r = RUN_ALL_TESTS();
__gcov_flush();
return r;
}
我已经印有 “R” 在一些测试和它是正确的(0或1,如果一个测试失败) 即使我硬编码一个“42”值作为回报,它不起作用。我只有在删除RUN_ALL_TESTS()时才得到这个硬编码值。
而且通过欺骗这样的事件:
set ERRORLEVEL= 0
詹金斯仍吐失败的工作: -/
我缺少什么?
'set ERRORLEVEL = 0' will not work.This will just create envirnoment variable errorlevel which will be different than the exit code。尝试'exit/b 0' – npocmaka