summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/freerdp
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2026-01-22 14:12:25 +0100
committerKhem Raj <raj.khem@gmail.com>2026-01-22 22:01:05 -0800
commit7c65b0bccbd17f1d5b56235e008f0d6a0f00aa06 (patch)
treed7a42836ff750ccd103eeb8c8676de29b2687381 /meta-oe/recipes-support/freerdp
parentb7bd06e9b4ff1bf55b5ba8943c2547ec8ff6dba7 (diff)
downloadmeta-openembedded-7c65b0bccbd17f1d5b56235e008f0d6a0f00aa06.tar.gz
freerdp: add ptest support
The test suite takes about 50s to execute. Sample output: root@qemux86-64:~# ptest-runner START: ptest-runner 2026-01-22T12:58 BEGIN: /usr/lib/freerdp/ptest PASS: TestClient TestClientRdpFile PASS: TestClient TestClientChannels PASS: TestClient TestClientCmdLine [...many lines...] PASS: TestWtsApi TestWtsApiSessionNotification PASS: TestWtsApi TestWtsApiShutdownSystem PASS: TestWtsApi TestWtsApiWaitSystemEvent DURATION: 48 END: /usr/lib/freerdp/ptest 2026-01-22T12:59 STOP: ptest-runner TOTAL: 1 FAIL: 0 Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/freerdp')
-rw-r--r--meta-oe/recipes-support/freerdp/freerdp/run-ptest85
-rw-r--r--meta-oe/recipes-support/freerdp/freerdp_2.11.7.bb22
2 files changed, 106 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/freerdp/freerdp/run-ptest b/meta-oe/recipes-support/freerdp/freerdp/run-ptest
new file mode 100644
index 0000000000..423a780eb1
--- /dev/null
+++ b/meta-oe/recipes-support/freerdp/freerdp/run-ptest
@@ -0,0 +1,85 @@
1#!/bin/sh
2
3#The key is the test binary name, and the value is the list of arguments to
4#use with the given binary. Each argument is a testcase to execute.
5
6#These test cases were determined by running the actual test binary
7#which lists all available test cases. Couldn't find a way to just simply
8#run all. Also, BusyBox seems to have no associative array support, so
9#plain variables are used with eval.
10
11TestAsn="TestAsn1Module TestAsn1Encoder TestAsn1Decoder TestAsn1Encode TestAsn1Decode TestAsn1String \
12 TestAsn1Integer TestAsn1Compare TestAsn1BerEnc TestAsn1BerDec TestAsn1DerEnc TestAsn1DerDec"
13TestClient="TestClientRdpFile TestClientChannels TestClientCmdLine"
14TestClipboard="TestClipboardFormats"
15TestCommon="TestCommonAssistance"
16TestCore="TestVersion TestSettings"
17TestCredUI="TestCredUIParseUserName TestCredUIConfirmCredentials TestCredUIPromptForCredentials TestCredUICmdLinePromptForCredentials"
18TestCrt="TestTypes TestFormatSpecifiers TestAlignment TestString TestUnicodeConversion"
19TestCrypto="TestCryptoHash TestCryptoRand TestCryptoCipher TestCryptoProtectData TestCryptoProtectMemory TestCryptoCertEnumCertificatesInStore"
20TestDsParse="TestDsMakeSpn TestDsCrackNames"
21TestEnvironment="TestEnvironmentGetEnvironmentStrings TestEnvironmentSetEnvironmentVariable TestEnvironmentMergeEnvironmentStrings TestEnvironmentGetSetEB"
22TestError="TestErrorSetLastError"
23TestFile="TestFileCreateFile TestFileDeleteFile TestFileReadFile TestSetFileAttributes TestFileWriteFile \
24 TestFilePatternMatch TestFileFindFirstFile TestFileFindFirstFileEx TestFileFindNextFile TestFileGetStdHandle"
25TestFreeRDPCodec="TestFreeRDPRegion TestFreeRDPCodecMppc TestFreeRDPCodecNCrush TestFreeRDPCodecXCrush \
26 TestFreeRDPCodecZGfx TestFreeRDPCodecPlanar TestFreeRDPCodecClear TestFreeRDPCodecInterleaved \
27 TestFreeRDPCodecProgressive TestFreeRDPCodecRemoteFX"
28TestFreeRDPCrypto="TestKnownHosts TestBase64 Test_x509_cert_info"
29TestFreeRDPUtils="TestRingBuffer"
30TestGdi="TestGdiRop3 TestGdiLine TestGdiRegion TestGdiRect TestGdiBitBlt TestGdiCreate TestGdiEllipse TestGdiClip"
31TestInterlocked="TestInterlockedAccess TestInterlockedSList TestInterlockedDList"
32TestIo="TestIoDevice TestIoGetOverlappedResult"
33TestLibrary="TestLibraryLoadLibrary TestLibraryGetProcAddress TestLibraryGetModuleFileName"
34TestLocale="TestLocaleFormatMessage"
35TestMemory="TestMemoryCreateFileMapping"
36TestNt="TestNtCreateFile TestNtCurrentTeb"
37TestPath="TestPathCchAddBackslash TestPathCchRemoveBackslash TestPathCchAddBackslashEx TestPathCchRemoveBackslashEx \
38 TestPathCchAddExtension TestPathCchAppend TestPathCchAppendEx TestPathCchCanonicalize TestPathCchCanonicalizeEx \
39 TestPathAllocCanonicalize TestPathCchCombine TestPathCchCombineEx TestPathAllocCombine TestPathCchFindExtension \
40 TestPathCchRenameExtension TestPathCchRemoveExtension TestPathCchIsRoot TestPathIsUNCEx TestPathCchSkipRoot \
41 TestPathCchStripToRoot TestPathCchStripPrefix TestPathCchRemoveFileSpec TestPathShell TestPathMakePath"
42TestPipe="TestPipeCreatePipe TestPipeCreateNamedPipe TestPipeCreateNamedPipeOverlapped"
43TestPool="TestPoolIO TestPoolSynch TestPoolThread TestPoolTimer TestPoolWork"
44TestPrimitives="TestPrimitivesAdd TestPrimitivesAlphaComp TestPrimitivesAndOr TestPrimitivesColors TestPrimitivesCopy \
45 TestPrimitivesSet TestPrimitivesShift TestPrimitivesSign TestPrimitivesYUV TestPrimitivesYCbCr TestPrimitivesYCoCg"
46TestRdTk="TestRdTkNinePatch"
47TestSecurity="TestSecurityToken"
48TestSmartCard="TestSmartCardListReaders"
49TestSspi="TestQuerySecurityPackageInfo TestEnumerateSecurityPackages TestInitializeSecurityContext TestAcquireCredentialsHandle TestCredSSP TestNTLM"
50TestSynch="TestSynchInit TestSynchEvent TestSynchMutex TestSynchBarrier TestSynchCritical TestSynchSemaphore \
51 TestSynchThread TestSynchMultipleThreads TestSynchTimerQueue TestSynchWaitableTimer TestSynchWaitableTimerAPC TestSynchAPC"
52TestSysInfo="TestGetNativeSystemInfo TestCPUFeatures TestGetComputerName TestSystemTime TestLocalTime"
53TestThread="TestThreadCommandLineToArgv TestThreadCreateProcess TestThreadExitThread"
54TestWinPR="TestIntrinsics TestTypes"
55TestWinPRUtils="TestIni TestVersion TestImage TestBipBuffer TestBacktrace TestQueue TestPrint TestPubSub TestStream \
56 TestBitStream TestArrayList TestLinkedList TestListDictionary TestCmdLine TestWLog TestWLogCallback TestHashTable \
57 TestBufferPool TestStreamPool TestMessageQueue TestMessagePipe"
58TestWnd="TestWndCreateWindowEx TestWndWmCopyData"
59TestWtsApi="TestWtsApiEnumerateProcesses TestWtsApiEnumerateSessions TestWtsApiQuerySessionInformation \
60 TestWtsApiSessionNotification TestWtsApiShutdownSystem TestWtsApiWaitSystemEvent"
61
62run_test(){
63 binary=$1
64 tcs=$(eval "echo \$${binary}")
65 if [ -z "$tcs" -o "$tcs" = ".so" ]; then
66 return
67 fi
68
69 EXTRA_ARG=""
70 if [ "$binary" = "TestFile" ]; then
71 # This testcase needs an extra argument. TestFileArea is a folder
72 # where some test files are used by this test.
73 EXTRA_ARG="TestFileArea"
74 fi
75
76 for tc in $tcs; do
77 ./$binary $tc $EXTRA_ARG > ../${binary}_${tc}.out 2>&1 && echo PASS: $binary $tc || echo FAIL: $binary $tc
78 done
79}
80
81cd Testing
82
83for testbin in *; do
84 run_test $testbin
85done
diff --git a/meta-oe/recipes-support/freerdp/freerdp_2.11.7.bb b/meta-oe/recipes-support/freerdp/freerdp_2.11.7.bb
index a78724b925..50a1de8299 100644
--- a/meta-oe/recipes-support/freerdp/freerdp_2.11.7.bb
+++ b/meta-oe/recipes-support/freerdp/freerdp_2.11.7.bb
@@ -8,13 +8,16 @@ SECTION = "net"
8LICENSE = "Apache-2.0" 8LICENSE = "Apache-2.0"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" 9LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
10 10
11inherit pkgconfig cmake gitpkgv 11inherit pkgconfig cmake gitpkgv ptest
12
13RDEPENDS:${PN}-ptest += "coreutils pcsc-lite-lib"
12 14
13PE = "1" 15PE = "1"
14PKGV = "${GITPKGVTAG}" 16PKGV = "${GITPKGVTAG}"
15 17
16SRCREV = "efa899d3deb8595a29fabb2a2251722f9d7e0d7f" 18SRCREV = "efa899d3deb8595a29fabb2a2251722f9d7e0d7f"
17SRC_URI = "git://github.com/FreeRDP/FreeRDP.git;branch=stable-2.0;protocol=https \ 19SRC_URI = "git://github.com/FreeRDP/FreeRDP.git;branch=stable-2.0;protocol=https \
20 file://run-ptest \
18 file://winpr-makecert-Build-with-install-RPATH.patch \ 21 file://winpr-makecert-Build-with-install-RPATH.patch \
19 file://0001-Fixed-compilation-warnings.patch \ 22 file://0001-Fixed-compilation-warnings.patch \
20 file://0001-Fix-const-qualifier-error.patch \ 23 file://0001-Fix-const-qualifier-error.patch \
@@ -37,6 +40,7 @@ EXTRA_OECMAKE += " \
37 40
38PACKAGECONFIG ??= " \ 41PACKAGECONFIG ??= " \
39 ${@bb.utils.filter('DISTRO_FEATURES', 'directfb pam pulseaudio wayland x11', d)}\ 42 ${@bb.utils.filter('DISTRO_FEATURES', 'directfb pam pulseaudio wayland x11', d)}\
43 ${@bb.utils.contains('PTEST_ENABLED', '1', 'test', '', d)} \
40 alsa gstreamer cups pcsc server \ 44 alsa gstreamer cups pcsc server \
41" 45"
42 46
@@ -51,6 +55,7 @@ PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER_1_0=ON,-DWITH_GSTREAMER_1_0=OFF,gst
51PACKAGECONFIG[cups] = "-DWITH_CUPS=ON,-DWITH_CUPS=OFF,cups" 55PACKAGECONFIG[cups] = "-DWITH_CUPS=ON,-DWITH_CUPS=OFF,cups"
52PACKAGECONFIG[server] = "-DWITH_SERVER=ON,-DWITH_SERVER=OFF" 56PACKAGECONFIG[server] = "-DWITH_SERVER=ON,-DWITH_SERVER=OFF"
53PACKAGECONFIG[alsa] = "-DWITH_ALSA=ON,-DWITH_ALSA=OFF,alsa-lib" 57PACKAGECONFIG[alsa] = "-DWITH_ALSA=ON,-DWITH_ALSA=OFF,alsa-lib"
58PACKAGECONFIG[test] = "-DBUILD_TESTING=ON,-DBUILD_TESTING=OFF"
54 59
55PACKAGES =+ "libfreerdp" 60PACKAGES =+ "libfreerdp"
56 61
@@ -59,6 +64,12 @@ FILES:libfreerdp = "${libdir}/lib*${SOLIBS}"
59 64
60PACKAGES_DYNAMIC += "^libfreerdp-plugin-.*" 65PACKAGES_DYNAMIC += "^libfreerdp-plugin-.*"
61 66
67do_configure:prepend() {
68 sed -i 's,CMAKE_CURRENT_SOURCE_DIR,"${PTEST_PATH}/test_data",' ${S}/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c
69 sed -i 's,\${CMAKE_CURRENT_SOURCE_DIR},"${PTEST_PATH}/test_data",' ${S}/libfreerdp/crypto/test/CMakeLists.txt
70 sed -i 's,\${CMAKE_CURRENT_SOURCE_DIR},${PTEST_PATH}/test_data,' ${S}/winpr/libwinpr/utils/test/CMakeLists.txt
71}
72
62do_configure:append() { 73do_configure:append() {
63 sed -i -e 's|${WORKDIR}||g' ${B}/buildflags.h 74 sed -i -e 's|${WORKDIR}||g' ${B}/buildflags.h
64} 75}
@@ -70,6 +81,15 @@ do_install:append () {
70 rm -rf ${D}${libdir}/freerdp 81 rm -rf ${D}${libdir}/freerdp
71} 82}
72 83
84do_install_ptest() {
85 install -d ${D}${PTEST_PATH}/test_data
86 cp -r ${B}/Testing ${D}${PTEST_PATH}
87 install -m 0644 ${S}/libfreerdp/codec/test/progressive.bmp ${D}${PTEST_PATH}/test_data/
88 install -m 0644 ${S}/libfreerdp/crypto/test/Test_x509_cert_info.pem ${D}${PTEST_PATH}/test_data/
89 install -m 0644 ${S}/winpr/libwinpr/utils/test/lodepng_32bit.png ${D}${PTEST_PATH}/test_data/
90 install -m 0644 ${S}/winpr/libwinpr/utils/test/lodepng_32bit.bmp ${D}${PTEST_PATH}/test_data/
91}
92
73python populate_packages:prepend () { 93python populate_packages:prepend () {
74 freerdp_root = d.expand('${libdir}/freerdp') 94 freerdp_root = d.expand('${libdir}/freerdp')
75 95