@@ -35,6 +35,7 @@ jobs:
make
sudo make install
sudo make install_libs
+
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
@@ -61,3 +62,10 @@ jobs:
shell: bash
# Execute tests defined by the CMake configuration.
run: ctest -C $BUILD_TYPE
+
+ - name: Upload Artifacts
+ if: ${{ always() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: artifacts-download
+ path: ${{runner.workspace}}/build/Testing/
@@ -123,8 +123,9 @@ add_subdirectory(${KS_DIR}/examples)
if (Boost_FOUND)
+ set(KS_TEST_DIR "${KS_DIR}/tests")
enable_testing()
- add_subdirectory(${KS_DIR}/tests)
+ add_subdirectory(${KS_TEST_DIR})
endif()
@@ -9,6 +9,7 @@ rm -rf src/
rm -rf examples/
rm -rf tests/
rm -rf Testing/
+rm -f ../tests/*.dat
rm -f ../lib/*
rm ../kernelshark.desktop
rm ../org.freedesktop.kshark-record.policy
@@ -1,6 +1,5 @@
message("\n tests ...")
-set(KS_TEST_DIR "${KS_DIR}/tests")
set(EXECUTABLE_OUTPUT_PATH ${KS_TEST_DIR})
add_executable(kshark-tests libkshark-tests.cpp)
@@ -9,6 +8,11 @@ target_compile_definitions(kshark-tests PRIVATE "BOOST_TEST_DYN_LINK=1")
target_link_libraries(kshark-tests kshark-gui
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+add_test(NAME "get_test_data"
+ COMMAND ${KS_TEST_DIR}/get_test_data.sh
+ WORKING_DIRECTORY ${KS_TEST_DIR})
+
+message(STATUS "libkshark-tests")
add_test(NAME "libkshark_tests"
COMMAND ${KS_TEST_DIR}/kshark-tests --log_format=HRF
WORKING_DIRECTORY ${KS_TEST_DIR})
new file mode 100755
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+TEST_DIR=`dirname $0`
+TEST_DATA_DIR=kernel-shark_testdata
+TEST_DATA_REPO=https://github.com/yordan-karadzhov/${TEST_DATA_DIR}.git
+
+rm -fv ${TEST_DIR}/*.dat
+
+if [ -d "${TEST_DATA_DIR}" ]; then
+ rm -rf ${TEST_DATA_DIR}
+fi
+
+git clone ${TEST_DATA_REPO}
+
+if [ ! -d "${TEST_DATA_DIR}" ]; then
+ exit false
+fi
+
+rm -f ${TEST_DATA_DIR}/LICENSE
+cp -v ${TEST_DATA_DIR}/* ${TEST_DIR}/
+rm -rf ${TEST_DATA_DIR}
The patch adds a procedure to download two trace data files that will be used by the CI tests. The files are obtained from a dedicated github repository. The tests cases using the trace data files will be added in following patches. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> --- .github/workflows/main.yml | 8 ++++++++ CMakeLists.txt | 3 ++- build/cmake_clean.sh | 1 + tests/CMakeLists.txt | 6 +++++- tests/get_test_data.sh | 21 +++++++++++++++++++++ 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100755 tests/get_test_data.sh