diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ca8b113ca9b..39ecef6871d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,6 +167,7 @@ jobs: -e CC="${CC}" -e CXX="${CXX}" -e GTEST_FILTER="$GTEST_FILTER" + -e TOOLS_TEST_OLDVERSION="$TOOLS_TEST_OLDVERSION" bpftrace-builder-$BASE-llvm-$LLVM_VERSION ${PWD}/build-$TYPE-$BASE $TYPE diff --git a/.github/workflows/embedded.yml b/.github/workflows/embedded.yml index ae8e71cf59f9..f018237bb0e9 100644 --- a/.github/workflows/embedded.yml +++ b/.github/workflows/embedded.yml @@ -93,6 +93,7 @@ jobs: -e RUNTIME_TEST_DISABLE="${RUNTIME_TEST_DISABLE}" -e VENDOR_GTEST="${VENDOR_GTEST}" -e BUILD_LIBBPF="${BUILD_LIBBPF}" + -e TOOLS_TEST_OLDVERSION="$TOOLS_TEST_OLDVERSION" bpftrace-embedded-${{ matrix.env['BASE'] }} $(pwd)/build-embedded ${TYPE} -j`nproc` diff --git a/tests/tools-parsing-test.sh b/tests/tools-parsing-test.sh index 9c83ff40b016..da9c6673da74 100755 --- a/tests/tools-parsing-test.sh +++ b/tests/tools-parsing-test.sh @@ -15,6 +15,8 @@ EXIT_STATUS=0; TOOLDIR="" +OLDTOOLS=${TOOLS_TEST_OLDVERSION:-} + function tooldir() { for dir in "../../tools" "/vagrant/tools"; do if [[ -d "$dir" ]]; then @@ -30,11 +32,16 @@ function tooldir() { tooldir for f in "$TOOLDIR"/*.bt; do - if $BPFTRACE_EXECUTABLE --unsafe -d $f 2>/dev/null >/dev/null; then - echo "$f passed" + if [[ $OLDTOOLS =~ $(basename $f) ]]; then + tool=$(dirname $f)/old/$(basename $f) + else + tool=$f + fi + if $BPFTRACE_EXECUTABLE --unsafe -d $tool 2>/dev/null >/dev/null; then + echo "$tool passed" else - echo "$f failed"; - $BPFTRACE_EXECUTABLE --unsafe -d $f; + echo "$tool failed"; + $BPFTRACE_EXECUTABLE --unsafe -d $tool; EXIT_STATUS=1; fi done diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index df7ffc20c50d..6e5c7190af26 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -3,3 +3,4 @@ file(GLOB TXT_FILES *.txt) list(REMOVE_ITEM TXT_FILES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt) install(FILES ${BT_FILES} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/bpftrace/tools) install(FILES ${TXT_FILES} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/bpftrace/tools/doc) +add_subdirectory(old) diff --git a/tools/old/CMakeLists.txt b/tools/old/CMakeLists.txt new file mode 100644 index 000000000000..a295826f44f2 --- /dev/null +++ b/tools/old/CMakeLists.txt @@ -0,0 +1,2 @@ +file(GLOB BT_FILES *.bt) +install(FILES ${BT_FILES} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/bpftrace/tools/old)