Sysprogs forums › Forums › VisualGDB › cannot run unit tests on remote linux target through VS test explorer
Tagged: gtest
- This topic has 5 replies, 2 voices, and was last updated 5 years, 9 months ago by dabramson.
-
AuthorPosts
-
January 15, 2019 at 20:34 #23482dabramsonParticipant
The test project, and shared object project that the test project references build successfully.
The tests appear correctly in Test Explorer.
I click “Run All” in test explorer and I get an error creating a temporary pipe…here is the output from the “Tests” output window.
[1/15/2019 2:31:51 PM Informational] ------ Discover test started ------
[1/15/2019 2:31:51 PM Informational] Loading C:\Clients\PxC\AXIOL\AxioLink\HelloWorldVgdb\HelloWorldVgdbMsBuild2\TestSharedObj_HelloWorldVgdbMsBuild2\VisualGDB\VisualGDBCache\TestSharedObj_HelloWorldVgdbMsBuild2-Debug\TestSharedObj_HelloWorldVgdbMsBuild2.vgdbtestcontainer...
[1/15/2019 2:31:57 PM Informational] Downloading /tmp/VisualGDB/c/Clients/PxC/AXIOL/AxioLink/HelloWorldVgdb/HelloWorldVgdbMsBuild2/TestSharedObj_HelloWorldVgdbMsBuild2/../VisualGDB/Debug/TestSharedObj_HelloWorldVgdbMsBuild2 to discover tests...
[1/15/2019 2:31:57 PM Informational] Test container loaded (lookup: 6 msec, fetch: 1698 msec, symbol list: 182 msec)
[1/15/2019 2:31:57 PM Informational] ========== Discover test finished: 3 found (0:00:06.546417) ==========
[1/15/2019 2:32:29 PM Informational] ------ Run test started ------
[1/15/2019 2:32:30 PM Informational] Running tests from C:\Clients\PxC\AXIOL\AxioLink\HelloWorldVgdb\HelloWorldVgdbMsBuild2\TestSharedObj_HelloWorldVgdbMsBuild2\VisualGDB\VisualGDBCache\TestSharedObj_HelloWorldVgdbMsBuild2-Debug\TestSharedObj_HelloWorldVgdbMsBuild2.vgdbtestcontainer...
[1/15/2019 2:32:32 PM Informational] Downloading /tmp/VisualGDB/c/Clients/PxC/AXIOL/AxioLink/HelloWorldVgdb/HelloWorldVgdbMsBuild2/TestSharedObj_HelloWorldVgdbMsBuild2/../VisualGDB/Debug/TestSharedObj_HelloWorldVgdbMsBuild2 to discover tests...
[1/15/2019 2:32:33 PM Informational] Test container loaded (lookup: 5 msec, fetch: 1477 msec, symbol list: 170 msec)
[1/15/2019 2:32:35 PM Error] Failed to create a temporary pipe for reading the test reports
[1/15/2019 2:32:35 PM Informational] System.Exception: Failed to create a temporary pipe for reading the test reports
[1/15/2019 2:32:35 PM Informational] at pe.b1()
[1/15/2019 2:32:35 PM Informational] at du.d1(hb1 a)
[1/15/2019 2:32:35 PM Informational] at VisualGDBTestExtensionShared.VisualGDBTestExecutor.RunTestsInSource(String source, Dictionary
2 selectedTests, IRunContext runContext, IFrameworkHandle frameworkHandle)
[1/15/2019 2:32:35 PM Informational] at VisualGDBTestExtensionShared.VisualGDBTestExecutor.RunTests(IEnumerable
1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
[1/15/2019 2:32:35 PM Error] An exception occurred while invoking executor 'executor://visualgdb/TestRunner': Failed to create a temporary pipe for reading the test reports
[1/15/2019 2:32:35 PM Informational] ========== Run test finished: 0 run (0:00:06.0520913) ==========
I can ssh directly to the test executable and run it on the target without a problem.
Also, after the pipe error the tests disappear from Test Explorer. They come back if I rebuild.
- This topic was modified 5 years, 9 months ago by dabramson.
January 15, 2019 at 21:49 #23484dabramsonParticipantI did a bit more digging and found this output in the VGDB diagnostics window when I ‘debug’ the tests in test explorer.
SSH [99]: executing command: "/opt/psi/BKMainApp/TestSharedObj_HelloWorldVgdbMsBuild2" --gtest_list_tests
SSH [99]: command exited with code 0 after 50 msec
TestSharedObj_HelloWorldVgdbMsBuild2 => 6 output lines
Discovered 3 tests using the advanced discoverer
SSH [100]: executing command: "mkfifo" "/tmp/01d673d5-eb13-41d1-999a-8c7eda47ea45"
SSH [100]: command exited with code 127 after 94 msec
Unexpected exception: Failed to create a temporary pipe for reading the test reports
------------------ System.Exception ------------------
System.Exception: Failed to create a temporary pipe for reading the test reports
at pe.b1()
at t91.m(k52 a)
at s52.y()
at yv.x_2()
at VisualGDB.GDBDebugEngine.q1(ba1 b, s1 a)
Unexpected exception: Failed to create a temporary pipe for reading the test reports
------------------ System.Exception ------------------
System.Exception: Failed to create a temporary pipe for reading the test reports
at pe.b1()
at t91.m(k52 a)
at s52.y()
at yv.x_2()
at VisualGDB.GDBDebugEngine.q1(ba1 b, s1 a)
SSH [101]: executing command: "rm" '/tmp/01d673d5-eb13-41d1-999a-8c7eda47ea45'
SSH [101]: command exited with code 1 after 49 msec
I’m guessing the that mkfifo not being present on the target is an issue. Can you confirm?
Also, can you tell me any other commands that running unit tests from test explorer will rely on? I’d like to try and get them added in one group if there are more as our guy that manages busybox for the target is only part-time.
Thanks,
Dave
- This reply was modified 5 years, 9 months ago by dabramson. Reason: additional related information requested
January 16, 2019 at 02:05 #23486supportKeymasterHi,
Most likely this happens due to the missing mkfifo executable, or missing permissions. Please try running mkfifo /tmp/01d673d5-eb13-41d1-999a-8c7eda47ea45 manually via SSH to see why it fails. As soon as you fix the underlying issue, you should be able to run tests as usual.
January 16, 2019 at 22:15 #23501dabramsonParticipantI added mkfifo to my system and things get further. I run all tests from test explorer, but all tests are skipped. It appears to be an incorrect formatting of the test names supplied to the –gtest_filter argument.
Here is what was passed by (I’m assuming) VGDB:
BasicCounterTests_ctor_WhenCalled.ResetsCount:BasicCounterTests_GetNextCount_WhenCalledRepeatedly.IncrementsCountForEachCall:BasicCounterTests_A_Failing.Test
The class name is BasicCounterTests and all test names have 2 underscores, but in the filter above there is a ‘.’ where the last underscore should be. If I run the tests manually on the target and put the ‘.’ after the classname and correct the test name (. becomes _) then all of the tests run as expected.
- This reply was modified 5 years, 9 months ago by dabramson.
January 18, 2019 at 04:41 #23525supportKeymasterHi,
Sorry about that, it indeed looks like our bug. Please try this build: http://sysprogs.com/files/tmp/VisualGDB-5.4.100.2751.msi
Please replace the <Linux> section inside the %LOCALAPPDATA%\VisualGDB\TestFrameworks\com.sysprogs.unittest.googletest\TestFramework.xml file with the following lines:
<Linux> <AdditionalSourceFiles /> <AdditionalHeaderFiles /> <AdditionalPreprocessorMacros /> <AdditionalLibraries> <string>pthread</string> </AdditionalLibraries> <InitializationLines> <string>testing::InitGoogleTest(&argc, argv);</string> <string>return RUN_ALL_TESTS();</string> </InitializationLines> <AdvancedTestDiscoverers> <TestDiscoverer xsi:type="OutputBasedTestDiscoverer"> <TargetDemangledNames>true</TargetDemangledNames> <CommandLineArguments>--gtest_list_tests</CommandLineArguments> <TestGroupRegex>^(|[^/]+/)([^ \t/]+)\.$</TestGroupRegex> <TestRegex>^[ \t]+([^ \t/]+)(|/[^ \t/]+)($| )</TestRegex> <UniqueNameFormat>{1}{2}_{4}{5}</UniqueNameFormat> <StructuredInternalNameFormat>{1}{2}.{4}{5}</StructuredInternalNameFormat> <UserFriendlyNameFormat>{1}{2}::{4}{5}</UserFriendlyNameFormat> <SecondaryIDFormat>{1}{2}::{4}{5}</SecondaryIDFormat> <ShortUserFriendlyNameFormat>{4}{5}</ShortUserFriendlyNameFormat> <LocationSymbolFormat>{2}_{4}_Test::TestBody()</LocationSymbolFormat> </TestDiscoverer> </AdvancedTestDiscoverers> <TestSelection xsi:type="ArgumentBasedTestSelection"> <GlobalArgumentTemplate>--gtest_filter=$(PerTestArguments)</GlobalArgumentTemplate> <PerTestArgumentTemplate>$(1).$(2)</PerTestArgumentTemplate> <PerTestArgumentSeparator>:</PerTestArgumentSeparator> <TestIDRegex>(.*)::(.*)</TestIDRegex> <IDType>SecondaryID</IDType> </TestSelection> <TestReportChannel xsi:type="PipeBasedTestChannelWithEnv"> <PipeTimestampVariableName>g_SysprogsTestReportTimestamp</PipeTimestampVariableName> <EnvironmentVariableName>SYSPROGS_TEST_REPORTING_PIPE</EnvironmentVariableName> </TestReportChannel> </Linux>
We will publish an official update to our googletest package after the next maintenance release (R2) in the next few days.
January 18, 2019 at 18:06 #23530dabramsonParticipantGtests are now running on my target and I see the results in Test Explorer. Thanks for the fix!
-
AuthorPosts
- You must be logged in to reply to this topic.