Skip to content

Commit

Permalink
run the unit tests automatically if you build them
Browse files Browse the repository at this point in the history
  • Loading branch information
giuspen committed Nov 28, 2020
1 parent fdc411f commit e8328de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 0 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@ else
cmake .. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
make -j$(nproc --all)
fi

# run unit tests
./tests/run_tests
10 changes: 10 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,13 @@ package_add_test(run_tests
tests_tmp_n_p7zip.cpp
tests_types.cpp
)

if(UNIX AND NOT APPLE)
add_custom_command(TARGET run_tests POST_BUILD
COMMAND xvfb-run ./run_tests
)
else()
add_custom_command(TARGET run_tests POST_BUILD
COMMAND ./run_tests
)
endif()

0 comments on commit e8328de

Please sign in to comment.