代码拉取完成,页面将自动刷新
#!/bin/bash
set -eo pipefail
PLATFORM="`uname -s`"
[ "$1" ] && VERSION="$1" || VERSION="2.1devel"
# Portable "ggrep -A" replacement.
# Work around Solaris awk record limit of 2559 bytes.
# contextgrep PATTERN POST_MATCH_LINES
contextgrep() {
cut -c -2500 | awk "/$1/ { count = ($2 + 1) } count > 0 { count--; print }"
}
do_tests() {
echo
cd tests
lua -e 'print("Testing Lua CJSON version " .. require("cjson")._VERSION)'
./test.lua | contextgrep 'FAIL|Summary' 3 | grep -v PASS | cut -c -150
cd ..
}
echo "===== Setting LuaRocks PATH ====="
eval "`luarocks path`"
echo "===== Building UTF-8 test data ====="
( cd tests && ./genutf8.pl; )
echo "===== Cleaning old build data ====="
make clean
rm -f tests/cjson.so
echo "===== Verifying cjson.so is not installed ====="
cd tests
if lua -e 'require "cjson"' 2>/dev/null
then
cat <<EOT
Please ensure you do not have the Lua CJSON module installed before
running these tests.
EOT
exit 1
fi
cd ..
echo "===== Testing LuaRocks build ====="
luarocks make --local
do_tests
luarocks remove --local lua-cjson
make clean
echo "===== Testing Makefile build ====="
make "$@"
cp -r lua/cjson cjson.so tests
do_tests
make clean
rm -rf tests/cjson{,.so}
if [ -z "$SKIP_CMAKE" ]; then
echo "===== Testing Cmake build ====="
mkdir build
cd build
cmake ..
make
cd ..
cp -r lua/cjson build/cjson.so tests
do_tests
rm -rf build tests/cjson{,.so}
echo "===== Testing Cmake fpconv build ====="
mkdir build
cd build
cmake -DUSE_INTERNAL_FPCONV=1 ..
make
cd ..
cp -r lua/cjson build/cjson.so tests
do_tests
rm -rf build tests/cjson{,.so}
else
echo "===== Skipping Cmake build ====="
fi
# vi:ai et sw=4 ts=4:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。