Turning on Static Analysis (light edition), gives build errors.
Closed this issue · 1 comments
Describe the bug
Turning on Static Analysis (light edition), gives build errors.
To Reproduce
Turn on Static Analysis (light edition).
Save project.
Call TcUnit-Runner on the project
Expected behavior
Execute test cases as defined in the Test_PLC task
Screenshots
Jenkins output:
00:00:03.035 The filepath to the visual studio solution file is: "C:\Jenkins_home\workspace<REDACTED><REDACTED>.sln"
00:00:03.177 2022-08-16 08:59:07 - TcUnit-Runner build: 0.9.3.0
00:00:03.179 2022-08-16 08:59:07 - TcUnit-Runner build date: 2020-12-22
00:00:03.179 2022-08-16 08:59:07 - Visual Studio solution path: C:\Jenkins_home\workspace<REDACTED><REDACTED>.sln
00:00:03.179 2022-08-16 08:59:07 -
00:00:03.181 2022-08-16 08:59:07 - In TwinCAT project file, found TwinCAT version 3.1.4024.32
00:00:03.182 2022-08-16 08:59:07 - In Visual Studio solution file, found visual studio version 15.0
00:00:03.190 2022-08-16 08:59:07 - Version is pinned: True
00:00:03.195 2022-08-16 08:59:07 - Trying to load the Visual Studio Development Tools Environment (DTE) version 'TcXaeShell.DTE.15.0' ...
00:00:06.032 2022-08-16 08:59:10 - ...SUCCESSFUL!
00:00:07.477 2022-08-16 08:59:11 - The pinned TwinCAT version is available
00:00:12.930 2022-08-16 08:59:17 - Using the TwinCAT remote manager to load TwinCAT version '3.1.4024.32'...
00:00:26.200 2022-08-16 08:59:30 - Setting task 'Test_Task' enable and autostart, and all other tasks (if existing) to disable and non-autostart
00:00:56.551 2022-08-16 09:00:00 - Description: SA0027: Variable name 'Param' in 'FB__Test' already used for an object in Library 'tc2_system, 3.4.25.0 (beckhoff automation gmbh)'
00:00:56.551 2022-08-16 09:00:00 - ErrorLevel: vsBuildErrorLevelHigh
00:00:57.248 2022-08-16 09:00:01 - Filename: C:\Jenkins_home\workspace<REDACTED>\S_aStruct.TcDUT
00:00:57.255 2022-08-16 09:00:01 - ERROR: Build errors in project
Software versions
Latest of TcUnit-Runner and TcUnit library.
TwinCAT 3.1.4024.32
Run environment
Jenkins, windows 10, real machine
Additional context
TcUnit works fine, to do the same tests
** Possible solution **
Tried to create a pull request but I could not figure it out.
Change line 290 in program.cs:
else if (item.ErrorLevel == vsBuildErrorLevel.vsBuildErrorLevelHigh)
else if (item.ErrorLevel == vsBuildErrorLevel.vsBuildErrorLevelHigh && !item.Description.ToString().StartsWith("SA"))
This project is archived. Replacement for it is in the works.