⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tests.sh

📁 unified configuration interface. small configuration library for programs written in c, can be used
💻 SH
字号:
#!/bin/shTESTS_DIR="./tests"CONFIG_DIR=${TESTS_DIR}"/config"CHANGES_DIR="/tmp/.uci"TMP_DIR=${TESTS_DIR}"/tmp"FULL_SUITE=${TESTS_DIR}"/full_suite.sh"UCI_STATIC="../uci-static"[ -x $UCI_STATIC ] || {	echo "uci-static is not present."	return 1}UCI="${UCI_STATIC} -c ${CONFIG_DIR} -p ${CHANGES_DIR}"REF_DIR="./references"SCRIPTS_DIR="./tests.d"DO_TEST="./shunit2/shunit2"rm -rf ${TESTS_DIR}mkdir -p ${TESTS_DIR}cat << 'EOF' > ${FULL_SUITE}setUp() {	mkdir -p ${CONFIG_DIR} ${CHANGES_DIR} ${TMP_DIR}}tearDown() {	rm -rf ${CONFIG_DIR} ${CHANGES_DIR} ${TMP_DIR}}assertSameFile() {	local ref=$1	local test=$2	diff -qr $ref $test	assertTrue $? || {		echo "REF:"		cat $ref		echo "----"		echo "TEST:"		cat $test		echo "----"	}}assertNotSegFault(){	[ $1 -eq 139 ] && fail "Returned with 139: segmentation fault (SIGSEGV)!!!"}assertNotIllegal(){	[ $1 -eq 132 ] && fail "Returned with 132: Illegal instruction (SIGILL)!!!"}assertFailWithNoReturn() {	local test="$1"	value=$( $test )	rv=$?	assertFalse "'$test' does not fail" $rv	assertNotSegFault $rv	assertNotIllegal $rv	assertNull "'$test' returns '$value'" "$value"}EOFfor suite in $(ls ${SCRIPTS_DIR}/*)do	cat ${suite} >> ${FULL_SUITE}doneecho ". ${DO_TEST}" >> ${FULL_SUITE}REF_DIR="${REF_DIR}" \CONFIG_DIR="${CONFIG_DIR}" \CHANGES_DIR="${CHANGES_DIR}" \TMP_DIR="${TMP_DIR}" \UCI="${UCI}" \/bin/sh ${FULL_SUITE}rm -rf ${TESTS_DIR}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -