runtest

来自「su 的源代码库」· 代码 · 共 120 行

TXT
120
字号
########################################################################## Invocation arguments are:						##	-v: verbose, print the compilation command			##	-c: continue testing after a test fails				##	-src: testing the source compatibility package			##	-bin: testing the binary compatibility package (default)	##	-native: test the native stdio					##	-whatever_else: bad argument, will be ignored.			##	tests: source of tests to be run.				##									## Below are a few example test runs:					##	runtest:							##		tests the uni-threaded binary compatibility package.	##	runtest -src -mt -lpthread:					##		tests the multi-threaded source compatibility package	##		on a Linux/Irix/Solaris platform.			##	runtest -mt -lcma:						##		tests the multi-threaded binary compatibility package	##		on a HPUX platform (-lcma defines the thread library).	##									## Written by Kiem-Phong Vo 						##########################################################################verbose=0exit_on_fail=1files=""LIBS=""HDRS=""DEFS=""XLIBS=""tsttype="binary"	# test binary emulation by defaultenvtype="ut"		# test uni-threaded by defaultwhile test "$1" != ""do	case $1 in	-l*)	XLIBS="$XLIBS $1";		;;	-v)	verbose=1;		;;	-c)	exit_on_fail=0;		;;	-src)	tsttype="source";		;;	-bin)	tsttype="binary";		;;	-native) tsttype="native";		;;	-mt)	envtype="mt";		;;	-ut)	envtype="ut";		;;	-*)	echo "Hmm, unknown argument: $1";		;;	*)	files="${files} $1";		;;	esac	shiftdoneif test "$CC" = ""; then CC="cc"; fiif test "$files" = ""then	files="*.c"fiif test $tsttype = sourcethen	HDRS="-I../Stdio_s"	if test $envtype = "mt"	then	DEFS="-Dvt_threaded=1";		LIBS="../libsfio-mt.a ../../vthread/libvthread.a"	else	DEFS="-Dvt_threaded=0"		LIBS="../libsfio.a"	fielif test $tsttype = binarythen	HDRS=""	if test $envtype = "mt"	then	DEFS="-Dvt_threaded=1";		LIBS="../Stdio_b/libstdio-mt.a ../libsfio-mt.a ../../vthread/libvthread.a"	else	DEFS="-Dvt_threaded=0"		LIBS="../Stdio_b/libstdio.a ../libsfio.a"	fielse	HDRS=""	if test $envtype = "mt"	then	DEFS="-Dvt_threaded=1";		LIBS="../../vthread/libvthread.a"	else	DEFS="-Dvt_threaded=0"		LIBS=""	fifiLIBS="$LIBS $XLIBS"if test "$verbose" = 1then echo "Compile: $CC -g -I. -I.. -I../../vthread $HDRS $DEFS whatever.c $LIBS -o t"fifor i in $filesdo	echo "-- $i:"	status=""	if $CC -g -I. -I.. -I../../vthread $HDRS $DEFS $i $LIBS -o t	then		if ./t		then	rm t; status=Passed		else	status=Failed		fi	else	status="Not compiled"	fi	echo "	$status"	if test "$status" != "Passed"	then if test "$exit_on_fail" = "1"; then exit; fi	fidone

⌨️ 快捷键说明

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