2017-03-09 12 views
0

Jenkins Job에서 배치 스크립트를 실행 중입니다.선택 식에서 위치 3의 예상치 못한 토큰 ''

C:\Users\Administrator\AppData\Local\Apps\OpenCover\OpenCover.Console.exe "-target:C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" "-targetargs:C:\Test\src\Example.Tests\bin\Debug\example.Tests.dll --where "cat == Unit" -register:Administrator 

필자도 필터를 사용했지만 사용하지 않았습니다.

C:\Users\Administrator\AppData\Local\Apps\OpenCover\OpenCover.Console.exe "-target:C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" "-targetargs:C:\Test\src\Example.Tests\bin\Debug\example.Tests.dl -filter:"+[Unit]*" -register:Administrator 

이 배치 명령에는 where 조건 (--where "cat == Unit")이 있습니다. 이것을 실행할 때 오류가 발생합니다. 테스트 파일

C:\Test\src\Example.Tests\bin\Debug\example.Tests.dll 
    == 
    Unit 

Test Filters 
    Where: cat 

Unexpected token '' at position 3 in selection expression. 
Committing... 
No results, this could be for a number of reasons. The most common reasons are: 
    1) missing PDBs for the assemblies that match the filter please review the 
    output file and refer to the Usage guide (Usage.rtf) about filters. 
    2) the profiler may not be registered correctly, please refer to the Usage 
    guide and the -register switch. 

이 오류로 인해 나는 코드 적용을받을 수 없습니다입니다. 제발 제안하십시오. 나는 아래 링크를 찾았지만, 이것을 할 수 없습니다.

업데이트 된 오류 로그.

Incorrect Arguments: The argument 'cat == Unit' is not recognised 

Usage: 
    ["]-target:<target application>["] 
    [["]-targetdir:<target directory>["]] 
    [["]-searchdirs:<additional PDB directory>[;<additional PDB directory>][;<additional PDB directory>]["]] 
    [["]-targetargs:<arguments for the target process>["]] 
    [-register[:user]] 
    [["]-output:<path to file>["]] 
    [-mergeoutput 
    [["]-filter:<space separated filters>["]] 
    [["]-filterfile:<path to file>["]] 
    [-nodefaultfilters] 
    [-regex] 
    [-mergebyhash] 
    [-showunvisited] 
    [-returntargetcode[:<opencoverreturncodeoffset>]] 
    [-excludebyattribute:<filter>[;<filter>][;<filter>]] 
    [-excludebyfile:<filter>[;<filter>][;<filter>]] 
    [-coverbytest:<filter>[;<filter>][;<filter>]] 
    [["]-excludedirs:<excludedir>[;<excludedir>][;<excludedir>]["]] 
    [-hideskipped:File|Filter|Attribute|MissingPdb|All,[File|Filter|Attribute|MissingPdb|All]] 
    [-log:[Off|Fatal|Error|Warn|Info|Debug|Verbose|All]] 
    [-service[:byname]] 
    [-servicestarttimeout:<minutes+seconds e.g. 1m23s> 
    [-communicationtimeout:<integer, e.g. 10000> 
    [-threshold:<max count>] 
    [-enableperformancecounters] 
    [-skipautoprops] 
    [-oldStyle] 
or 
    -? 
or 
    -version 

For further information on the command line please visit the wiki 
    https://github.com/OpenCover/opencover/wiki/Usage 

Filters: 
    Filters are used to include and exclude assemblies and types in the 
    profiler coverage; see the Usage guide. If no other filters are supplied 
    via the -filter option then a default inclusive all filter +[*]* is 
    applied. 
Logging: 
    Logging is based on log4net logging levels and appenders - defaulting 
    to a ColouredConsoleAppender and INFO log level. 
Notes: 
    Enclose arguments in quotes "" when spaces are required see -targetargs. 
+0

'example.Tests.dll' 다음에 따옴표가 필요할까요? –

+0

dll을 인용 한 후에 작동하지 않았습니다. –

답변

2

이이 같은

"-targetargs:C:\Test\src\Example.Tests\bin\Debug\example.Tests.dl -filter:"+[Unit]*" 

뭔가 여기

샘플 스크립트입니다 난 당신이 배치 파일의 파워 쉘의 intstead을 시도하는 것이 좋습니다

"-targetargs:C:\Test\src\Example.Tests\bin\Debug\example.Tests.dll" -filter:"+[*Unit]*" 

을 더 잘 작동한다 넌센스처럼 보인다 : https://github.com/rpokrovskij/opencover4vs.ps1

솔루션 폴더에 넣고 첫 줄을 수정하십시오. 추가 변경없이 당신을 위해 잘되기를 바랍니다.