Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/root-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ jobs:
CONTAINER_IMAGE: "registry.cern.ch/root-ci/${{ matrix.image }}:buildready" #KEEP IN SYNC WITH ABOVE
CONTAINER_OPTIONS: "--security-opt label=disable --rm ${{ matrix.property == 'gpu' && '--device nvidia.com/gpu=all' || '' }}" #KEEP IN SYNC WITH ABOVE

env:
BUILD_DIR: /github/home/ROOT-CI/build
INSTALL_DIR: /github/home/ROOT-CI/install
POST_INSTALL_DIR: /github/home/ROOT-CI/PostInstall

steps:
- name: Configure large ccache
if: ${{ matrix.is_special }}
Expand Down Expand Up @@ -586,6 +591,18 @@ jobs:
run: |
ccache -s || true

- name: Install
run: "cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_DIR }}"

- name: Build post-install test project
run: |
cmake -S test/PostInstall/ -B ${{ env.POST_INSTALL_DIR }} -DCMAKE_PREFIX_PATH=${{ env.INSTALL_DIR }};
cmake --build ${{ env.POST_INSTALL_DIR }};

- name: CTest in post-install test project
working-directory: ${{ env.POST_INSTALL_DIR }}
run: ctest -j $(nproc)

event_file:
# For any event that is not a PR, the CI will always run. In PRs, the CI
# can be skipped if the tag [skip-ci] or [skip ci] is written in the title.
Expand Down
21 changes: 21 additions & 0 deletions test/PostInstall/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)

project(PostInstall)

find_package(ROOT REQUIRED)

add_executable(readHSimple readHSimple.cxx)
target_link_libraries(readHSimple PUBLIC ROOT::Hist ROOT::RIO)

include(CTest)

if(BUILD_TESTING)
add_test(NAME run-hsimple
COMMAND ${ROOT_BINDIR}/root.exe -b -q -l -e ".x ${CMAKE_SOURCE_DIR}/../../tutorials/hsimple.C" -e "return"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME read-hsimple
COMMAND $<TARGET_FILE:readHSimple>
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_tests_properties(run-hsimple PROPERTIES FIXTURES_SETUP HSIMPLE)
set_tests_properties(read-hsimple PROPERTIES FIXTURES_REQUIRED HSIMPLE)
endif()
19 changes: 19 additions & 0 deletions test/PostInstall/readHSimple.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <TH1.h>
#include <TFile.h>

int main()
{
TFile file("hsimple.root", "READ");
if (!file.IsOpen())
return 1;

TH1 *histo = file.Get<TH1>("hpx");
if (!histo)
return 2;

if (histo->GetEntries() != 25000)
return 3;
histo->Print();

return 0;
}
Loading