diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch new file mode 100644 index 00000000..3ce431d4 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch @@ -0,0 +1,56 @@ +From 6ba81efe971fb6038af6e950e853d35ee6dd9cc3 Mon Sep 17 00:00:00 2001 +From: Yogesh Tyagi +Date: Sun, 11 Dec 2022 22:34:15 +0800 +Subject: [PATCH] Add print function to print test run status in ptest format + +Upstream-Status: Inappropriate [OE ptest specific] + +Signed-off-by: Yogesh Tyagi +--- + run_tests.py | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/run_tests.py b/run_tests.py +index 87305a06..4f2f0f59 100755 +--- a/run_tests.py ++++ b/run_tests.py +@@ -385,6 +385,9 @@ def run_test(testname, host, target): + else: + ispc_exe_rel = add_prefix(host.ispc_cmd, host, target) + ++ # to reslove the error '.rodata' can not be used when making a PIE object ++ ispc_exe_rel = ispc_exe_rel + " --pic" ++ + # is this a test to make sure an error is issued? + want_error = (filename.find("tests_errors") != -1) + if want_error == True: +@@ -844,6 +847,17 @@ def check_compiler_exists(compiler_exe): + return + error("missing the required compiler: %s \n" % compiler_exe, 1) + ++def print_test_run_status(results): ++ for fstatus in results: ++ if (fstatus[1] == Status.Success): ++ print( "%s: %s" % ("PASS", fstatus[0])) ++ elif (fstatus[1] == Status.Compfail): ++ print( "%s: %s" % ("FAIL", fstatus[0])) ++ elif (fstatus[1] == Status.Runfail): ++ print( "%s: %s" % ("FAIL", fstatus[0])) ++ elif (fstatus[1] == Status.Skip): ++ print( "%s: %s" % ("SKIP", fstatus[0])) ++ + def print_result(status, results, s, run_tests_log, csv): + title = StatusStr[status] + file_list = [fname for fname, fstatus in results if status == fstatus] +@@ -987,6 +1001,8 @@ def run_tests(options1, args, print_version): + pass_rate = -1 + print_debug("PASSRATE (%d/%d) = %d%% \n\n" % (len(run_succeed_files), total_tests_executed, pass_rate), s, run_tests_log) + ++ print_test_run_status(results) ++ + for status in Status: + print_result(status, results, s, run_tests_log, options.csv) + fails = [status != Status.Compfail and status != Status.Runfail for _, status in results] +-- +2.37.3 + diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/run-ptest b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/run-ptest new file mode 100644 index 00000000..77d13bb4 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +python3 run_tests.py diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.18.0.bb b/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.18.0.bb index 6a2e6059..b7083f82 100644 --- a/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.18.0.bb +++ b/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.18.0.bb @@ -7,7 +7,7 @@ LICENSE = "BSD-3-Clause & Apache-2.0-with-LLVM-exception" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=da5ecffdd210b3cf776b32b41c182e87 \ file://third-party-programs.txt;md5=3cd6f8a7c3bd9d2bb898fcb27c75221a" -inherit cmake python3native +inherit cmake python3native ptest S = "${WORKDIR}/git" @@ -17,13 +17,17 @@ SRC_URI = "git://github.com/ispc/ispc.git;protocol=https;branch=main \ file://0001-Fix-QA-Issues.patch \ file://6a1b2ffae0cc12467838bc671e3b089924de90a6.patch \ file://ec35a6f8e60ba77e59a6f2bfec27011e0ab34dda.patch \ + file://0001-Add-print-function-to-print-test-run-status-in-ptest.patch \ + file://run-ptest \ " + SRCREV = "f7ec3aa173c816377c215d83196b5c7c3a88db1c" COMPATIBLE_HOST = '(x86_64).*-linux' DEPENDS += " clang-native bison-native flex-native" RDEPENDS:${PN} += " clang-libllvm clang clang-libclang-cpp" +RDEPENDS:${PN}-ptest += " python3-multiprocessing" YFLAGS='-d -t -v -y --file-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}' @@ -32,6 +36,15 @@ do_configure:prepend() { sed -i -e 's#\${FLEX_EXECUTABLE}.*#\${FLEX_EXECUTABLE} \-L #g' ${S}/CMakeLists.txt } +do_install_ptest() { + cp -rf ${S}/run_tests.py ${D}${PTEST_PATH} + cp -rf ${S}/common.py ${D}${PTEST_PATH} + cp -rf ${S}/tests ${D}${PTEST_PATH} + cp -rf ${S}/test_static.isph ${D}${PTEST_PATH} + cp -rf ${S}/fail_db.txt ${D}${PTEST_PATH} + cp -rf ${S}/test_static.cpp ${D}${PTEST_PATH} +} + EXTRA_OECMAKE += " \ -DISPC_INCLUDE_TESTS=OFF \ -DISPC_INCLUDE_EXAMPLES=OFF \