tcunit / TcUnit

An unit testing framework for Beckhoff's TwinCAT 3
Other
258 stars 72 forks source link

Library SysDir, 3.5.8.0 (System) not installed, or no license found #177

Closed marcus-sonestedt closed 2 years ago

marcus-sonestedt commented 2 years ago

I get this both when using the compiled code with a test and when building TcUnit from source.

Google didn't give me much to go on trying to google for this, neither is this lib in the _Libraires folder in the downloaded source, but some other system libs are.

I'm using TwinCAT XAE Shell and TwinCAT Build 4024.22.

All help greatly appreciated! This seems to be a great project!

sagatowski commented 2 years ago

Hi Marcus!

I can't quite figure out the problem description. Have you activated trial licenses?

Do you have a screenshot?

What version of TcUnit are you running?

TcUnit 1.2 on 3.1.4024.22 works fine here.

marcus-sonestedt commented 2 years ago

Hi Jakob,

TcUnit: I used the 1.2 compiled library, but with code it was the latest master from Jan 7th c9c650f4a0adc0847d011d5df6984b790f12947c (freshly cloned submodule)

C:\Dev\CatFish\src\3rdparty\TcUnit [(c9c650f...) +0 ~1 -0 !]> git log -1
commit (HEAD) c9c650f4a0adc0847d011d5df6984b790f12947c 
Author: Jakob Sagatowski <jakob.sagatowski@outlook.com>
Date:   Fri Jan 7 19:20:09 2022 +0000

    Fixed some formatting.
    Upped log4net to 2.0.14 for the verifier.

image

Hm. License looks good, TC3 PLC, TC3 NC PTP , TC3 NCI. Now my PLC project with test compiles, but not the TcUnit source.

FahrJo commented 2 years ago

As far as I know this is a CODESYS lib which is not supported by Beckhoff and they also advise against using it and recommend their FBs instead (https://infosys.beckhoff.com/content/1031/tcplclibsystem/html/tcplclibsys_fileio_example.htm?id=4724517592797591316). I believe that it was shipped with early TwinCAT versions, but it may be that it is no longer included in newer TwinCAT versions.

sagatowski commented 2 years ago

Hi @marcusl ! I'm honestly not sure exactly why you've tried to add the SysDir manually?

I did this:

Did you follow this guide? https://tcunit.org/introduction-user-guide/

(Install from library file)

sagatowski commented 2 years ago

As far as I know this is a CODESYS lib which is not supported by Beckhoff and they also advise against using it and recommend their FBs instead (https://infosys.beckhoff.com/content/1031/tcplclibsystem/html/tcplclibsys_fileio_example.htm?id=4724517592797591316). I believe that it was shipped with early TwinCAT versions, but it may be that it is no longer included in newer TwinCAT versions.

The reason that it's using SysDir etc is in order for it to be compatible with counit.

(it's a fork of TcUnit)

marcus-sonestedt commented 2 years ago
Did you follow this guide?
https://tcunit.org/introduction-user-guide/

(Install from library file)

To the best of my ability. :) I will try again.

sagatowski commented 2 years ago
Did you follow this guide?
https://tcunit.org/introduction-user-guide/

(Install from library file)

To the best of my ability. :) I will try again.

Let me know if anything is unclear and I will try to make it more clear.

marcus-sonestedt commented 2 years ago

I probably got myself into a pickle first trying to add the TcUnit project from source, seeing the sysdir error, trying to fix it, and then it went downhill from there.

sagatowski commented 2 years ago

@marcusl Does it work now? In that case close the issue. You are welcome to star the project if you like it!

marcus-sonestedt commented 2 years ago

Starred! :) Give me a few moments, I will update/close issue one I have poked it a bit.

FahrJo commented 2 years ago

As far as I know this is a CODESYS lib which is not supported by Beckhoff and they also advise against using it and recommend their FBs instead (https://infosys.beckhoff.com/content/1031/tcplclibsystem/html/tcplclibsys_fileio_example.htm?id=4724517592797591316). I believe that it was shipped with early TwinCAT versions, but it may be that it is no longer included in newer TwinCAT versions.

The reason that it's using SysDir etc is in order for it to be compatible with counit.

(it's a fork of TcUnit)

I already wondered and wanted to suggest that I can update that at some time... Thanks for the clarification!

HAHermsen commented 2 years ago

Hi,

There are at two senario's possible: or you let TcUnit PLC code create a report internally, or you let the TcUnit-Runner (C#) create it. TcUnit defaults to the TcUnit-Runner option. Both options are open for TcUnit users which provides a scalable solution.

Regards

marcus-sonestedt commented 2 years ago

I have SysDir 3.5.12.0 but the error is about 3.5.8.0, which is what the tc library refers to. If works if I update But I see for your VM it auto-updated the ref to 3.5.12.0.

However, if I update the resolution to 3.5.12.0 it seems to work:

image

I also had to change the build target to "TwinCAT RT", this might've been the main issue.

Lastly, FYI, TcUnit does not compile cleanly with the SFC checks:

Build complete -- 0 errors, 0 warnings : ready for download!
Additional code checks ...
FB_AdsAssertMessageFormatter.LogAssertFailure(9) : error: SA0167: Temporary FunctionBlock instance: 'AdjustAssertFailureMessageToMax253CharLength'
FB_TestSuite.GetTestByPosition(2) : error: SA0167: Temporary FunctionBlock instance: 'GetTestByPosition'
FB_TestSuite.AreAllTestsFinished(4) : error: SA0167: Temporary FunctionBlock instance: 'GetCurTaskIndex'
FB_TestSuite.AssertArray3dEquals_REAL(34) : error: SA0167: Temporary FunctionBlock instance: 'FormatString'
C:\Dev\CatFish\src\3rdparty\TcUnit\TcUnit\TcUnit\POUs\FB_TestResults.TcPOU(20) : error: SA0167: Temporary FunctionBlock instance: 'TestToBeStored'
FB_StreamBuffer.Clear(6) : error: SA0027: Variable name 'Count' in 'Clear' already used for an object in Library 'tc2_utilities, 3.3.47.0 (beckhoff automation gmbh)'
FB_TestSuite.AreAllTestsFinished(4) : error: SA0027: Variable name 'GetCurTaskIndex' in 'AreAllTestsFinished' already used for an object in Library 'tc2_system, 3.4.24.0 (beckhoff automation gmbh)'
FB_TestSuite.AssertEquals(13) : error: SA0027: Variable name 'Count' in 'AssertEquals' already used for an object in Library 'tc2_utilities, 3.3.47.0 (beckhoff automation gmbh)'