mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-09-16 22:45:05 +00:00
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>
This commit is contained in:
parent
b7bd06e9b4
commit
7c65b0bccb
@ -72,6 +72,7 @@ PTESTS_FAST_META_OE:remove:riscv32 = "botan nodejs oprofile"
|
|||||||
|
|
||||||
PTESTS_SLOW_META_OE = "\
|
PTESTS_SLOW_META_OE = "\
|
||||||
c-ares \
|
c-ares \
|
||||||
|
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'freerdp', '', d)} \
|
||||||
fftw \
|
fftw \
|
||||||
libusb-compat \
|
libusb-compat \
|
||||||
mariadb \
|
mariadb \
|
||||||
|
|||||||
85
meta-oe/recipes-support/freerdp/freerdp/run-ptest
Normal file
85
meta-oe/recipes-support/freerdp/freerdp/run-ptest
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#The key is the test binary name, and the value is the list of arguments to
|
||||||
|
#use with the given binary. Each argument is a testcase to execute.
|
||||||
|
|
||||||
|
#These test cases were determined by running the actual test binary
|
||||||
|
#which lists all available test cases. Couldn't find a way to just simply
|
||||||
|
#run all. Also, BusyBox seems to have no associative array support, so
|
||||||
|
#plain variables are used with eval.
|
||||||
|
|
||||||
|
TestAsn="TestAsn1Module TestAsn1Encoder TestAsn1Decoder TestAsn1Encode TestAsn1Decode TestAsn1String \
|
||||||
|
TestAsn1Integer TestAsn1Compare TestAsn1BerEnc TestAsn1BerDec TestAsn1DerEnc TestAsn1DerDec"
|
||||||
|
TestClient="TestClientRdpFile TestClientChannels TestClientCmdLine"
|
||||||
|
TestClipboard="TestClipboardFormats"
|
||||||
|
TestCommon="TestCommonAssistance"
|
||||||
|
TestCore="TestVersion TestSettings"
|
||||||
|
TestCredUI="TestCredUIParseUserName TestCredUIConfirmCredentials TestCredUIPromptForCredentials TestCredUICmdLinePromptForCredentials"
|
||||||
|
TestCrt="TestTypes TestFormatSpecifiers TestAlignment TestString TestUnicodeConversion"
|
||||||
|
TestCrypto="TestCryptoHash TestCryptoRand TestCryptoCipher TestCryptoProtectData TestCryptoProtectMemory TestCryptoCertEnumCertificatesInStore"
|
||||||
|
TestDsParse="TestDsMakeSpn TestDsCrackNames"
|
||||||
|
TestEnvironment="TestEnvironmentGetEnvironmentStrings TestEnvironmentSetEnvironmentVariable TestEnvironmentMergeEnvironmentStrings TestEnvironmentGetSetEB"
|
||||||
|
TestError="TestErrorSetLastError"
|
||||||
|
TestFile="TestFileCreateFile TestFileDeleteFile TestFileReadFile TestSetFileAttributes TestFileWriteFile \
|
||||||
|
TestFilePatternMatch TestFileFindFirstFile TestFileFindFirstFileEx TestFileFindNextFile TestFileGetStdHandle"
|
||||||
|
TestFreeRDPCodec="TestFreeRDPRegion TestFreeRDPCodecMppc TestFreeRDPCodecNCrush TestFreeRDPCodecXCrush \
|
||||||
|
TestFreeRDPCodecZGfx TestFreeRDPCodecPlanar TestFreeRDPCodecClear TestFreeRDPCodecInterleaved \
|
||||||
|
TestFreeRDPCodecProgressive TestFreeRDPCodecRemoteFX"
|
||||||
|
TestFreeRDPCrypto="TestKnownHosts TestBase64 Test_x509_cert_info"
|
||||||
|
TestFreeRDPUtils="TestRingBuffer"
|
||||||
|
TestGdi="TestGdiRop3 TestGdiLine TestGdiRegion TestGdiRect TestGdiBitBlt TestGdiCreate TestGdiEllipse TestGdiClip"
|
||||||
|
TestInterlocked="TestInterlockedAccess TestInterlockedSList TestInterlockedDList"
|
||||||
|
TestIo="TestIoDevice TestIoGetOverlappedResult"
|
||||||
|
TestLibrary="TestLibraryLoadLibrary TestLibraryGetProcAddress TestLibraryGetModuleFileName"
|
||||||
|
TestLocale="TestLocaleFormatMessage"
|
||||||
|
TestMemory="TestMemoryCreateFileMapping"
|
||||||
|
TestNt="TestNtCreateFile TestNtCurrentTeb"
|
||||||
|
TestPath="TestPathCchAddBackslash TestPathCchRemoveBackslash TestPathCchAddBackslashEx TestPathCchRemoveBackslashEx \
|
||||||
|
TestPathCchAddExtension TestPathCchAppend TestPathCchAppendEx TestPathCchCanonicalize TestPathCchCanonicalizeEx \
|
||||||
|
TestPathAllocCanonicalize TestPathCchCombine TestPathCchCombineEx TestPathAllocCombine TestPathCchFindExtension \
|
||||||
|
TestPathCchRenameExtension TestPathCchRemoveExtension TestPathCchIsRoot TestPathIsUNCEx TestPathCchSkipRoot \
|
||||||
|
TestPathCchStripToRoot TestPathCchStripPrefix TestPathCchRemoveFileSpec TestPathShell TestPathMakePath"
|
||||||
|
TestPipe="TestPipeCreatePipe TestPipeCreateNamedPipe TestPipeCreateNamedPipeOverlapped"
|
||||||
|
TestPool="TestPoolIO TestPoolSynch TestPoolThread TestPoolTimer TestPoolWork"
|
||||||
|
TestPrimitives="TestPrimitivesAdd TestPrimitivesAlphaComp TestPrimitivesAndOr TestPrimitivesColors TestPrimitivesCopy \
|
||||||
|
TestPrimitivesSet TestPrimitivesShift TestPrimitivesSign TestPrimitivesYUV TestPrimitivesYCbCr TestPrimitivesYCoCg"
|
||||||
|
TestRdTk="TestRdTkNinePatch"
|
||||||
|
TestSecurity="TestSecurityToken"
|
||||||
|
TestSmartCard="TestSmartCardListReaders"
|
||||||
|
TestSspi="TestQuerySecurityPackageInfo TestEnumerateSecurityPackages TestInitializeSecurityContext TestAcquireCredentialsHandle TestCredSSP TestNTLM"
|
||||||
|
TestSynch="TestSynchInit TestSynchEvent TestSynchMutex TestSynchBarrier TestSynchCritical TestSynchSemaphore \
|
||||||
|
TestSynchThread TestSynchMultipleThreads TestSynchTimerQueue TestSynchWaitableTimer TestSynchWaitableTimerAPC TestSynchAPC"
|
||||||
|
TestSysInfo="TestGetNativeSystemInfo TestCPUFeatures TestGetComputerName TestSystemTime TestLocalTime"
|
||||||
|
TestThread="TestThreadCommandLineToArgv TestThreadCreateProcess TestThreadExitThread"
|
||||||
|
TestWinPR="TestIntrinsics TestTypes"
|
||||||
|
TestWinPRUtils="TestIni TestVersion TestImage TestBipBuffer TestBacktrace TestQueue TestPrint TestPubSub TestStream \
|
||||||
|
TestBitStream TestArrayList TestLinkedList TestListDictionary TestCmdLine TestWLog TestWLogCallback TestHashTable \
|
||||||
|
TestBufferPool TestStreamPool TestMessageQueue TestMessagePipe"
|
||||||
|
TestWnd="TestWndCreateWindowEx TestWndWmCopyData"
|
||||||
|
TestWtsApi="TestWtsApiEnumerateProcesses TestWtsApiEnumerateSessions TestWtsApiQuerySessionInformation \
|
||||||
|
TestWtsApiSessionNotification TestWtsApiShutdownSystem TestWtsApiWaitSystemEvent"
|
||||||
|
|
||||||
|
run_test(){
|
||||||
|
binary=$1
|
||||||
|
tcs=$(eval "echo \$${binary}")
|
||||||
|
if [ -z "$tcs" -o "$tcs" = ".so" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
EXTRA_ARG=""
|
||||||
|
if [ "$binary" = "TestFile" ]; then
|
||||||
|
# This testcase needs an extra argument. TestFileArea is a folder
|
||||||
|
# where some test files are used by this test.
|
||||||
|
EXTRA_ARG="TestFileArea"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for tc in $tcs; do
|
||||||
|
./$binary $tc $EXTRA_ARG > ../${binary}_${tc}.out 2>&1 && echo PASS: $binary $tc || echo FAIL: $binary $tc
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
cd Testing
|
||||||
|
|
||||||
|
for testbin in *; do
|
||||||
|
run_test $testbin
|
||||||
|
done
|
||||||
@ -8,13 +8,16 @@ SECTION = "net"
|
|||||||
LICENSE = "Apache-2.0"
|
LICENSE = "Apache-2.0"
|
||||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
|
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
|
||||||
|
|
||||||
inherit pkgconfig cmake gitpkgv
|
inherit pkgconfig cmake gitpkgv ptest
|
||||||
|
|
||||||
|
RDEPENDS:${PN}-ptest += "coreutils pcsc-lite-lib"
|
||||||
|
|
||||||
PE = "1"
|
PE = "1"
|
||||||
PKGV = "${GITPKGVTAG}"
|
PKGV = "${GITPKGVTAG}"
|
||||||
|
|
||||||
SRCREV = "efa899d3deb8595a29fabb2a2251722f9d7e0d7f"
|
SRCREV = "efa899d3deb8595a29fabb2a2251722f9d7e0d7f"
|
||||||
SRC_URI = "git://github.com/FreeRDP/FreeRDP.git;branch=stable-2.0;protocol=https \
|
SRC_URI = "git://github.com/FreeRDP/FreeRDP.git;branch=stable-2.0;protocol=https \
|
||||||
|
file://run-ptest \
|
||||||
file://winpr-makecert-Build-with-install-RPATH.patch \
|
file://winpr-makecert-Build-with-install-RPATH.patch \
|
||||||
file://0001-Fixed-compilation-warnings.patch \
|
file://0001-Fixed-compilation-warnings.patch \
|
||||||
file://0001-Fix-const-qualifier-error.patch \
|
file://0001-Fix-const-qualifier-error.patch \
|
||||||
@ -37,6 +40,7 @@ EXTRA_OECMAKE += " \
|
|||||||
|
|
||||||
PACKAGECONFIG ??= " \
|
PACKAGECONFIG ??= " \
|
||||||
${@bb.utils.filter('DISTRO_FEATURES', 'directfb pam pulseaudio wayland x11', d)}\
|
${@bb.utils.filter('DISTRO_FEATURES', 'directfb pam pulseaudio wayland x11', d)}\
|
||||||
|
${@bb.utils.contains('PTEST_ENABLED', '1', 'test', '', d)} \
|
||||||
alsa gstreamer cups pcsc server \
|
alsa gstreamer cups pcsc server \
|
||||||
"
|
"
|
||||||
|
|
||||||
@ -51,6 +55,7 @@ PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER_1_0=ON,-DWITH_GSTREAMER_1_0=OFF,gst
|
|||||||
PACKAGECONFIG[cups] = "-DWITH_CUPS=ON,-DWITH_CUPS=OFF,cups"
|
PACKAGECONFIG[cups] = "-DWITH_CUPS=ON,-DWITH_CUPS=OFF,cups"
|
||||||
PACKAGECONFIG[server] = "-DWITH_SERVER=ON,-DWITH_SERVER=OFF"
|
PACKAGECONFIG[server] = "-DWITH_SERVER=ON,-DWITH_SERVER=OFF"
|
||||||
PACKAGECONFIG[alsa] = "-DWITH_ALSA=ON,-DWITH_ALSA=OFF,alsa-lib"
|
PACKAGECONFIG[alsa] = "-DWITH_ALSA=ON,-DWITH_ALSA=OFF,alsa-lib"
|
||||||
|
PACKAGECONFIG[test] = "-DBUILD_TESTING=ON,-DBUILD_TESTING=OFF"
|
||||||
|
|
||||||
PACKAGES =+ "libfreerdp"
|
PACKAGES =+ "libfreerdp"
|
||||||
|
|
||||||
@ -59,6 +64,12 @@ FILES:libfreerdp = "${libdir}/lib*${SOLIBS}"
|
|||||||
|
|
||||||
PACKAGES_DYNAMIC += "^libfreerdp-plugin-.*"
|
PACKAGES_DYNAMIC += "^libfreerdp-plugin-.*"
|
||||||
|
|
||||||
|
do_configure:prepend() {
|
||||||
|
sed -i 's,CMAKE_CURRENT_SOURCE_DIR,"${PTEST_PATH}/test_data",' ${S}/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c
|
||||||
|
sed -i 's,\${CMAKE_CURRENT_SOURCE_DIR},"${PTEST_PATH}/test_data",' ${S}/libfreerdp/crypto/test/CMakeLists.txt
|
||||||
|
sed -i 's,\${CMAKE_CURRENT_SOURCE_DIR},${PTEST_PATH}/test_data,' ${S}/winpr/libwinpr/utils/test/CMakeLists.txt
|
||||||
|
}
|
||||||
|
|
||||||
do_configure:append() {
|
do_configure:append() {
|
||||||
sed -i -e 's|${WORKDIR}||g' ${B}/buildflags.h
|
sed -i -e 's|${WORKDIR}||g' ${B}/buildflags.h
|
||||||
}
|
}
|
||||||
@ -70,6 +81,15 @@ do_install:append () {
|
|||||||
rm -rf ${D}${libdir}/freerdp
|
rm -rf ${D}${libdir}/freerdp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_install_ptest() {
|
||||||
|
install -d ${D}${PTEST_PATH}/test_data
|
||||||
|
cp -r ${B}/Testing ${D}${PTEST_PATH}
|
||||||
|
install -m 0644 ${S}/libfreerdp/codec/test/progressive.bmp ${D}${PTEST_PATH}/test_data/
|
||||||
|
install -m 0644 ${S}/libfreerdp/crypto/test/Test_x509_cert_info.pem ${D}${PTEST_PATH}/test_data/
|
||||||
|
install -m 0644 ${S}/winpr/libwinpr/utils/test/lodepng_32bit.png ${D}${PTEST_PATH}/test_data/
|
||||||
|
install -m 0644 ${S}/winpr/libwinpr/utils/test/lodepng_32bit.bmp ${D}${PTEST_PATH}/test_data/
|
||||||
|
}
|
||||||
|
|
||||||
python populate_packages:prepend () {
|
python populate_packages:prepend () {
|
||||||
freerdp_root = d.expand('${libdir}/freerdp')
|
freerdp_root = d.expand('${libdir}/freerdp')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user