Skip to content

Commit

Permalink
Install LICENSE.txt, README.md, and tests with CMake.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter committed Apr 23, 2020
1 parent 2b3c3fb commit 1c8dd1b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ build_script:
- set TERRA_SHARE_PATH=%TERRA_DIR%\install\share\terra
- ps: |
If($Env:LLVM_VERSION_SHORT -eq 60 -and $Env:USE_CMAKE -eq 1) {
git ls-tree HEAD -r tests --name-only | ForEach-Object { $dir = "$Env:TERRA_SHARE_PATH\$(Split-Path -Path $_)"; If(!(Test-Path "$dir")) { New-Item -Path "$dir" -ItemType Directory }; Copy-Item $_ "$dir" }
$Env:RELEASE_NAME = "terra-Windows-x86_64-$(git rev-parse --short HEAD)"
Rename-Item install "$Env:RELEASE_NAME"
7z a "$Env:RELEASE_NAME.zip" "$Env:RELEASE_NAME"
Expand Down
20 changes: 20 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,30 @@ file(GLOB TERRA_TESTS
${PROJECT_SOURCE_DIR}/tests/*.t
${PROJECT_SOURCE_DIR}/tests/fails/*.t
)
file(GLOB_RECURSE TERRA_TESTS_INSTALL
RELATIVE ${PROJECT_SOURCE_DIR}/tests
${PROJECT_SOURCE_DIR}/tests/*
)

foreach(TERRA_TEST ${TERRA_TESTS})
add_test(NAME ${TERRA_TEST}
COMMAND $<TARGET_FILE:TerraExecutable> ${TERRA_TEST}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests
)
endforeach()
foreach(TERRA_TEST ${TERRA_TESTS_INSTALL})
get_filename_component(TERRA_TEST_DIR ${TERRA_TEST} DIRECTORY)
install(
FILES ${PROJECT_SOURCE_DIR}/tests/${TERRA_TEST}
DESTINATION ${CMAKE_INSTALL_DATADIR}/terra/tests/${TERRA_TEST_DIR}
)
endforeach()

install(
FILES ${PROJECT_SOURCE_DIR}/release/share/terra/LICENSE.txt
DESTINATION ${CMAKE_INSTALL_DATADIR}/terra
)
install(
FILES ${PROJECT_SOURCE_DIR}/release/share/terra/README.md
DESTINATION ${CMAKE_INSTALL_DATADIR}/terra
)
13 changes: 8 additions & 5 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,14 @@ if [[ $USE_CMAKE -eq 1 ]]; then
../install/bin/terra ./run
popd
fi
else
make LLVM_CONFIG=$(which $LLVM_CONFIG) CLANG=$(which $CLANG) test

# Only deploy Makefile-based builds, and only with LLVM 6.
if [[ $LLVM_CONFIG = llvm-config-6.0 && $USE_CMAKE -eq 1 && $USE_CUDA -eq 1 && ( $CC = gcc || $(uname) = Darwin ) ]]; then
make LLVM_CONFIG=$(which $LLVM_CONFIG) CLANG=$(which $CLANG) release
# Only deploy CMake builds, and only with LLVM 6.
if [[ $LLVM_CONFIG = llvm-config-6.0 && $USE_CUDA -eq 1 && ( $CC = gcc || $(uname) = Darwin ) ]]; then
RELEASE_NAME=terra-`uname | sed -e s/Darwin/OSX/`-`uname -m`-`git rev-parse --short HEAD`
mv install $RELEASE_NAME
zip -q -r $RELEASE_NAME.zip $RELEASE_NAME
mv $RELEASE_NAME install
fi
else
make LLVM_CONFIG=$(which $LLVM_CONFIG) CLANG=$(which $CLANG) test
fi

0 comments on commit 1c8dd1b

Please sign in to comment.