forked from brettviren/wire-cell-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8131247
commit 61a3578
Showing
6 changed files
with
90 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env bats | ||
|
||
# Test for https://github.com/WireCell/wire-cell-toolkit/issues/200 | ||
# | ||
# In part this issue invovles a problem building against WCT so we put | ||
# this test outside of sub-packages. | ||
|
||
@test "assure build config built" { | ||
eval $(../wcb dumpenv|grep =) | ||
[[ -f "$BuildConfig" ]] | ||
} | ||
|
||
@test "assure build config installed" { | ||
eval $(../wcb dumpenv|grep =) | ||
[[ -n "$PREFIX" ]] | ||
[[ -n "$BuildConfig" ]] | ||
|
||
echo "Expect build config file: $PREFIX/include/$BuildConfig" | ||
[[ -f "$PREFIX/include/$BuildConfig" ]] | ||
} | ||
|
||
@test "external build with config" { | ||
# assume we run from build/ | ||
eval $(../wcb dumpenv|grep =) | ||
[[ -n "$PREFIX" ]] | ||
[[ -n "$BuildConfig" ]] | ||
[[ -n "$CXX" ]] | ||
|
||
here=$(pwd) | ||
tmp="$(mktemp -d ${BATS_TMPDIR}/test-issue200-build-with-config-XXXXX)" | ||
echo "working in: $tmp" | ||
cd $tmp/ | ||
|
||
cat <<EOF > check.cxx | ||
#include "$BuildConfig" | ||
#include <iostream> | ||
int main() { | ||
std::cout << "version " << WIRECELL_VERSION << std::endl; | ||
return 0; | ||
} | ||
EOF | ||
run $CXX -I $PREFIX/include -o check check.cxx | ||
echo $output | ||
[[ "$status" -eq 0 ]] | ||
|
||
run ./check | ||
echo "$output" | ||
[[ "$status" -eq 0 ]] | ||
|
||
[[ -n "$(echo $output|grep version)" ]] | ||
|
||
cd $here | ||
rm -rf $tmp | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters