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

📄 test_all.sh

📁 Amis - A maximum entropy estimator 一个最大熵模型统计工具
💻 SH
字号:
#!/bin/shAMIS="../src/amis $*"DIFF=diff#ALGORITHMS="GIS IIS"ALGORITHMS="GIS IIS BFGS BFGSMAP"TEST_BINARY="simple combine pack variable multifile tree packtree forest fix"TEST_NONBINARY="$TEST_BINARY nonbinary"######################################################################num_tests=0num_success=0num_fail=0num_fail_threshold=10exec_test() {    feature=$1    shift    test_file_list=$1    shift    additional_args=$*    for test_file in $test_file_list ; do	for algo in $ALGORITHMS ; do	    num_tests=`expr $num_tests + 1`	    command="$AMIS -f $feature -a $algo $additional_args $test_file.conf"	    test_spec="$test_file $feature $algo"#	    echo $command	    if $command &> /dev/null		then		if $DIFF $test_file.output $test_file.$algo.test &> /dev/null		    then		    echo "$test_spec: SUCCESS"		    num_success=`expr $num_success + 1`		else		    echo "$test_spec: FAIL"		    num_fail=`expr $num_fail + 1`		fi	    else		echo "FAILED: $command"		exit 1	    fi	done    done}exec_test binary "$TEST_BINARY"exec_test binary "$TEST_BINARY" --event-on-file trueexec_test integer "$TEST_NONBINARY"exec_test integer "$TEST_NONBINARY" --event-on-file trueexec_test real "$TEST_NONBINARY"exec_test real "$TEST_NONBINARY" --event-on-file trueecho "$num_success tests passed."if [ $num_fail -gt 0 ]; then    echo "$num_fail tests failed."    if [ $num_fail -gt $num_fail_threshold ]; then	exit 1    fifi

⌨️ 快捷键说明

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