test-release.sh 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. #!/bin/bash
  2. # Tested on Linux, MSys2
  3. trap 'echo -e "${GREEN}Exiting at user request$RESET"; exit' INT
  4. umask 0022
  5. export MMGEN_TEST_SUITE=1
  6. export MMGEN_NO_LICENSE=1
  7. export PYTHONPATH=.
  8. test_py='test/test.py -n'
  9. objtest_py='test/objtest.py'
  10. unit_tests_py='test/unit_tests.py --names --quiet'
  11. tooltest_py='test/tooltest.py'
  12. tooltest2_py='test/tooltest2.py --names'
  13. gentest_py='test/gentest.py'
  14. scrambletest_py='test/scrambletest.py'
  15. mmgen_tool='cmds/mmgen-tool'
  16. mmgen_keygen='cmds/mmgen-keygen'
  17. python='python3'
  18. rounds=100 rounds_min=20 rounds_mid=250 rounds_max=500
  19. monero_addrs='3,99,2,22-24,101-104'
  20. dfl_tests='obj unit hash alts monero eth autosign btc btc_tn btc_rt bch bch_rt ltc ltc_tn ltc_rt tool tool2 gen'
  21. add_tests='autosign_minimal autosign_live'
  22. PROGNAME=$(basename $0)
  23. while getopts hbCfiIlOpRtvV OPT
  24. do
  25. case "$OPT" in
  26. h) printf " %-16s Test MMGen release\n" "${PROGNAME}:"
  27. echo " USAGE: $PROGNAME [options] [tests]"
  28. echo " OPTIONS: '-h' Print this help message"
  29. echo " '-b' Buffer keypresses for all invocations of 'test/test.py'"
  30. echo " '-C' Run tests in coverage mode"
  31. echo " '-f' Speed up the tests by using fewer rounds"
  32. echo " '-i' Create and install Python package, then run tests. A branch"
  33. echo " must be supplied as the first argument"
  34. echo " '-I' Install the package only; don't run tests"
  35. echo " '-l' List the test name symbols"
  36. echo " '-O' Use pexpect.spawn rather than popen_spawn for applicable tests"
  37. echo " '-p' Pause between tests"
  38. echo " '-R' Don't remove temporary files after program has exited"
  39. echo " '-t' Print the tests without running them"
  40. echo " '-v' Run test/test.py with '--exact-output' and other commands with"
  41. echo " '--verbose' switch"
  42. echo " '-V' Run test/test.py and other commands with '--verbose' switch"
  43. echo " AVAILABLE TESTS:"
  44. echo " obj - data objects"
  45. echo " unit - unit tests"
  46. echo " hash - internal hash function implementations"
  47. echo " alts - operations for all supported gen-only altcoins"
  48. echo " monero - operations for Monero"
  49. echo " eth - operations for Ethereum"
  50. echo " autosign - autosign"
  51. echo " btc - bitcoin"
  52. echo " btc_tn - bitcoin testnet"
  53. echo " btc_rt - bitcoin regtest"
  54. echo " bch - bitcoin cash (BCH)"
  55. echo " bch_rt - bitcoin cash (BCH) regtest"
  56. echo " ltc - litecoin"
  57. echo " ltc_tn - litecoin testnet"
  58. echo " ltc_rt - litecoin regtest"
  59. echo " tool - tooltest (all supported coins)"
  60. echo " tool2 - tooltest2 (all supported coins)"
  61. echo " gen - gentest (all supported coins)"
  62. echo " By default, all tests are run"
  63. exit ;;
  64. b) test_py+=" --buf-keypress" ;;
  65. C) mkdir -p 'test/trace'
  66. touch 'test/trace.acc'
  67. test_py+=" --coverage"
  68. tooltest_py+=" --coverage"
  69. tooltest2_py+=" --fork --coverage"
  70. scrambletest_py+=" --coverage"
  71. python="python3 -m trace --count --file=test/trace.acc --coverdir=test/trace"
  72. unit_tests_py="$python $unit_tests_py"
  73. objtest_py="$python $objtest_py"
  74. gentest_py="$python $gentest_py"
  75. mmgen_tool="$python $mmgen_tool"
  76. mmgen_keygen="$python $mmgen_keygen" ;&
  77. f) rounds=10 rounds_min=3 rounds_mid=25 rounds_max=50 monero_addrs='3,23' unit_tests_py+=" --fast" ;;
  78. i) INSTALL=1 ;;
  79. I) INSTALL_ONLY=1 ;;
  80. l) echo -e "Default tests:\n $dfl_tests"
  81. echo -e "Additional tests:\n $add_tests"
  82. exit ;;
  83. O) test_py+=" --pexpect-spawn" ;;
  84. p) PAUSE=1 ;;
  85. R) NO_TMPFILE_REMOVAL=1 ;;
  86. t) TESTING=1 ;;
  87. v) EXACT_OUTPUT=1 test_py+=" --exact-output" ;&
  88. V) VERBOSE=1 [ "$EXACT_OUTPUT" ] || test_py+=" --verbose"
  89. tooltest_py+=" --verbose" tooltest2_py+=" --verbose"
  90. gentest_py+=" --verbose" mmgen_tool+=" --verbose"
  91. unit_tests_py="${unit_tests_py/--quiet/--verbose}"
  92. scrambletest_py+=" --verbose" ;;
  93. *) exit ;;
  94. esac
  95. done
  96. [ "$EXACT_OUTPUT" -o "$VERBOSE" ] || objtest_py+=" -S"
  97. shift $((OPTIND-1))
  98. REFDIR='test/ref'
  99. if uname -a | grep -qi mingw; then SUDO='' MINGW=1; else SUDO='sudo' MINGW=''; fi
  100. [ "$MINGW" ] || RED="\e[31;1m" GREEN="\e[32;1m" YELLOW="\e[33;1m" RESET="\e[0m"
  101. [ "$INSTALL" ] && {
  102. BRANCH=$1; shift
  103. BRANCHES=$(git branch)
  104. FOUND_BRANCH=$(for b in ${BRANCHES/\*}; do [ "$b" == "$BRANCH" ] && echo ok; done)
  105. [ "$FOUND_BRANCH" ] || { echo "Branch '$BRANCH' not found!"; exit; }
  106. }
  107. set -e
  108. check() {
  109. [ "$BRANCH" ] || { echo 'No branch specified. Exiting'; exit; }
  110. [ "$(git diff $BRANCH)" == "" ] || {
  111. echo "Unmerged changes from branch '$BRANCH'. Exiting"
  112. exit
  113. }
  114. git diff $BRANCH >/dev/null 2>&1 || exit
  115. }
  116. uninstall() {
  117. set +e
  118. eval "$SUDO ./scripts/uninstall-mmgen.py"
  119. [ "$?" -ne 0 ] && { echo 'Uninstall failed, but proceeding anyway'; sleep 1; }
  120. set -e
  121. }
  122. install() {
  123. set -x
  124. eval "$SUDO rm -rf .test-release"
  125. git clone --branch $BRANCH --single-branch . .test-release
  126. (
  127. cd .test-release
  128. ./setup.py sdist
  129. mkdir pydist && cd pydist
  130. if [ "$MINGW" ]; then unzip ../dist/mmgen-*.zip; else tar zxvf ../dist/mmgen-*gz; fi
  131. cd mmgen-*
  132. eval "$SUDO ./setup.py clean --all"
  133. [ "$MINGW" ] && ./setup.py build --compiler=mingw32
  134. eval "$SUDO ./setup.py install --force"
  135. )
  136. set +x
  137. }
  138. do_test() {
  139. set +x
  140. for i in "$@"; do
  141. echo -e "${GREEN}Running:$RESET $YELLOW$i$RESET"
  142. [ "$TESTING" ] || eval "$i" || {
  143. echo -e $RED"Test '$CUR_TEST' failed at command '$i'"$RESET
  144. exit
  145. }
  146. done
  147. }
  148. i_obj='Data object'
  149. s_obj='Testing data objects'
  150. t_obj=(
  151. "$objtest_py --coin=btc"
  152. "$objtest_py --coin=btc --testnet=1"
  153. "$objtest_py --coin=ltc"
  154. "$objtest_py --coin=ltc --testnet=1")
  155. f_obj='Data object test complete'
  156. i_unit='Unit'
  157. s_unit='Running unit'
  158. t_unit=("$unit_tests_py")
  159. f_unit='Unit tests run complete'
  160. i_hash='Internal hash function implementations'
  161. s_hash='Testing internal hash function implementations'
  162. t_hash=(
  163. "$python test/hashfunc.py sha256 $rounds_max"
  164. "$python test/hashfunc.py sha512 $rounds_max"
  165. "$python test/hashfunc.py keccak $rounds_max")
  166. f_hash='Hash function tests complete'
  167. i_alts='Gen-only altcoin'
  168. s_alts='The following tests will test generation operations for all supported altcoins'
  169. t_alts=(
  170. "$scrambletest_py"
  171. "$test_py ref_altcoin"
  172. "$gentest_py --coin=btc 2 $rounds"
  173. "$gentest_py --coin=btc --type=compressed 2 $rounds"
  174. "$gentest_py --coin=btc --type=segwit 2 $rounds"
  175. "$gentest_py --coin=btc --type=bech32 2 $rounds"
  176. "$gentest_py --coin=ltc 2 $rounds"
  177. "$gentest_py --coin=ltc --type=compressed 2 $rounds"
  178. "$gentest_py --coin=ltc --type=segwit 2 $rounds"
  179. "$gentest_py --coin=ltc --type=bech32 2 $rounds"
  180. "$gentest_py --coin=etc 2 $rounds"
  181. "$gentest_py --coin=etc --use-internal-keccak-module 2 $rounds_min"
  182. "$gentest_py --coin=eth 2 $rounds"
  183. "$gentest_py --coin=eth --use-internal-keccak-module 2 $rounds_min"
  184. "$gentest_py --coin=xmr 2 $rounds"
  185. "$gentest_py --coin=xmr --use-internal-keccak-module 2 $rounds_min"
  186. "$gentest_py --coin=zec 2 $rounds"
  187. "$gentest_py --coin=zec --type=zcash_z 2 $rounds_mid"
  188. "$gentest_py --coin=btc 2:ext $rounds"
  189. "$gentest_py --coin=btc --type=compressed 2:ext $rounds"
  190. "$gentest_py --coin=btc --type=segwit 2:ext $rounds"
  191. "$gentest_py --coin=ltc 2:ext $rounds"
  192. "$gentest_py --coin=ltc --type=compressed 2:ext $rounds"
  193. # "$gentest_py --coin=ltc --type=segwit 2:ext $rounds" # pycoin generates old-style LTC Segwit addrs
  194. # "$gentest_py --coin=etc 2:ext $rounds" # no pythereum
  195. # "$gentest_py --coin=eth 2:ext $rounds"
  196. "$gentest_py --coin=zec 2:ext $rounds"
  197. "$gentest_py --coin=zec --type=zcash_z 2:ext $rounds_mid"
  198. "$gentest_py --all 2:pycoin $rounds"
  199. # "$gentest_py --all 2:pyethereum $rounds"
  200. "$gentest_py --all 2:keyconv $rounds_mid"
  201. "$gentest_py --all 2:zcash_mini $rounds_mid")
  202. if [ "$MINGW" ]; then
  203. t_alts[13]="# MSWin platform: skipping zcash z-addr generation and altcoin verification with third-party tools"
  204. i=14 end=${#t_alts[*]}
  205. while [ $i -lt $end ]; do unset t_alts[$i]; let i++; done
  206. fi
  207. f_alts='Gen-only altcoin tests completed'
  208. if [ "$MINGW" ]; then
  209. TMPDIR='/tmp/mmgen-test-release'
  210. else
  211. TMPDIR='/tmp/mmgen-test-release-'$(cat /dev/urandom | base32 - | head -n1 | cut -b 1-16)
  212. fi
  213. mkdir -p $TMPDIR
  214. i_monero='Monero'
  215. s_monero='Testing key-address file generation and wallet creation and sync operations for Monero'
  216. s_monero='The monerod (mainnet) daemon must be running for the following tests'
  217. t_monero=(
  218. "mmgen-walletgen -q -r0 -p1 -Llabel --outdir $TMPDIR -o words"
  219. "$mmgen_keygen -q --accept-defaults --use-internal-keccak-module --outdir $TMPDIR --coin=xmr $TMPDIR/*.mmwords $monero_addrs"
  220. 'cs1=$(mmgen-tool -q --accept-defaults --coin=xmr keyaddrfile_chksum $TMPDIR/*-XMR*.akeys)'
  221. "$mmgen_keygen -q --use-old-ed25519 --accept-defaults --outdir $TMPDIR --coin=xmr $TMPDIR/*.mmwords $monero_addrs"
  222. 'cs2=$(mmgen-tool -q --accept-defaults --coin=xmr keyaddrfile_chksum $TMPDIR/*-XMR*.akeys)'
  223. '[ "$cs1" == "$cs2" ] || false'
  224. "$mmgen_tool -q --accept-defaults --outdir $TMPDIR keyaddrlist2monerowallets $TMPDIR/*-XMR*.akeys addrs=23"
  225. "$mmgen_tool -q --accept-defaults --outdir $TMPDIR keyaddrlist2monerowallets $TMPDIR/*-XMR*.akeys addrs=103-200"
  226. 'rm $TMPDIR/*-MoneroWallet*'
  227. "$mmgen_tool -q --accept-defaults --outdir $TMPDIR keyaddrlist2monerowallets $TMPDIR/*-XMR*.akeys"
  228. "$mmgen_tool -q --accept-defaults --outdir $TMPDIR syncmonerowallets $TMPDIR/*-XMR*.akeys addrs=3"
  229. "$mmgen_tool -q --accept-defaults --outdir $TMPDIR syncmonerowallets $TMPDIR/*-XMR*.akeys addrs=23-29"
  230. "$mmgen_tool -q --accept-defaults --outdir $TMPDIR syncmonerowallets $TMPDIR/*-XMR*.akeys"
  231. )
  232. [ "$MINGW" ] && {
  233. t_monero[2]="# MSWin platform: skipping Monero wallet creation and sync tests; NOT verifying key-addr list"
  234. i=3 end=${#t_monero[*]}
  235. while [ $i -lt $end ]; do unset t_monero[$i]; let i++; done
  236. }
  237. [ "$monero_addrs" == '3,23' ] && {
  238. unset t_monero[12]
  239. unset t_monero[7]
  240. unset t_monero[3]
  241. }
  242. f_monero='Monero tests completed'
  243. i_eth='Ethereum'
  244. s_eth='Testing transaction and tracking wallet operations for Ethereum and Ethereum Classic'
  245. t_eth=(
  246. "$test_py --coin=eth ethdev"
  247. "$test_py --coin=etc ethdev"
  248. )
  249. f_eth='Ethereum tests completed'
  250. i_autosign='Autosign'
  251. s_autosign='The bitcoin, bitcoin-abc and litecoin mainnet and testnet daemons must be running for the following test'
  252. t_autosign=("$test_py autosign")
  253. f_autosign='Autosign test complete'
  254. i_autosign_minimal='Autosign Minimal'
  255. s_autosign_minimal='The bitcoin mainnet and testnet daemons must be running for the following test'
  256. t_autosign_minimal=("$test_py autosign_minimal")
  257. f_autosign_minimal='Autosign Minimal test complete'
  258. i_autosign_live='Autosign Live'
  259. s_autosign_live="The bitcoin mainnet and testnet daemons must be running for the following test\n"
  260. s_autosign_live+="${YELLOW}Mountpoint, '/etc/fstab' and removable device must be configured "
  261. s_autosign_live+="as described in 'mmgen-autosign --help'${RESET}"
  262. t_autosign_live=("$test_py autosign_live")
  263. f_autosign_live='Autosign Live test complete'
  264. i_btc='Bitcoin mainnet'
  265. s_btc='The bitcoin (mainnet) daemon must both be running for the following tests'
  266. t_btc=(
  267. "$test_py --exclude regtest"
  268. "$test_py --segwit"
  269. "$test_py --segwit-random"
  270. "$test_py --bech32"
  271. "$python scripts/compute-file-chksum.py $REFDIR/*testnet.rawtx >/dev/null 2>&1")
  272. f_btc='You may stop the bitcoin (mainnet) daemon if you wish'
  273. i_btc_tn='Bitcoin testnet'
  274. s_btc_tn='The bitcoin testnet daemon must both be running for the following tests'
  275. t_btc_tn=(
  276. "$test_py --testnet=1"
  277. "$test_py --testnet=1 --segwit"
  278. "$test_py --testnet=1 --segwit-random"
  279. "$test_py --testnet=1 --bech32")
  280. f_btc_tn='You may stop the bitcoin testnet daemon if you wish'
  281. i_btc_rt='Bitcoin regtest'
  282. s_btc_rt="The following tests will test MMGen's regtest (Bob and Alice) mode"
  283. t_btc_rt=(
  284. "$test_py regtest"
  285. )
  286. f_btc_rt='Regtest (Bob and Alice) mode tests for BTC completed'
  287. i_bch='Bitcoin cash (BCH)'
  288. s_bch='The bitcoin cash daemon (Bitcoin ABC) must both be running for the following tests'
  289. t_bch=("$test_py --coin=bch --exclude regtest")
  290. f_bch='You may stop the Bitcoin ABC daemon if you wish'
  291. i_bch_rt='Bitcoin cash (BCH) regtest'
  292. s_bch_rt="The following tests will test MMGen's regtest (Bob and Alice) mode"
  293. t_bch_rt=("$test_py --coin=bch regtest")
  294. f_bch_rt='Regtest (Bob and Alice) mode tests for BCH completed'
  295. i_ltc='Litecoin'
  296. s_ltc='The litecoin daemon must both be running for the following tests'
  297. t_ltc=(
  298. "$test_py --coin=ltc --exclude regtest"
  299. "$test_py --coin=ltc --segwit"
  300. "$test_py --coin=ltc --segwit-random"
  301. "$test_py --coin=ltc --bech32")
  302. f_ltc='You may stop the litecoin daemon if you wish'
  303. i_ltc_tn='Litecoin testnet'
  304. s_ltc_tn='The litecoin testnet daemon must both be running for the following tests'
  305. t_ltc_tn=(
  306. "$test_py --coin=ltc --testnet=1 --exclude regtest"
  307. "$test_py --coin=ltc --testnet=1 --segwit"
  308. "$test_py --coin=ltc --testnet=1 --segwit-random"
  309. "$test_py --coin=ltc --testnet=1 --bech32")
  310. f_ltc_tn='You may stop the litecoin testnet daemon if you wish'
  311. i_ltc_rt='Litecoin regtest'
  312. s_ltc_rt="The following tests will test MMGen's regtest (Bob and Alice) mode"
  313. t_ltc_rt=("$test_py --coin=ltc regtest")
  314. f_ltc_rt='Regtest (Bob and Alice) mode tests for LTC completed'
  315. i_tool2='Tooltest2'
  316. s_tool2="The following tests will run '$tooltest2_py' for all supported coins"
  317. t_tool2=(
  318. "$tooltest2_py --quiet"
  319. "$tooltest2_py --quiet --coin=btc"
  320. "$tooltest2_py --quiet --coin=btc --testnet=1"
  321. "$tooltest2_py --quiet --coin=ltc"
  322. "$tooltest2_py --quiet --coin=ltc --testnet=1"
  323. "$tooltest2_py --quiet --coin=bch"
  324. "$tooltest2_py --quiet --coin=bch --testnet=1"
  325. "$tooltest2_py --quiet --coin=zec"
  326. "$tooltest2_py --quiet --coin=zec --type=zcash_z"
  327. "$tooltest2_py --quiet --coin=xmr"
  328. "$tooltest2_py --quiet --coin=dash"
  329. "$tooltest2_py --quiet --coin=eth"
  330. "$tooltest2_py --quiet --coin=eth --testnet=1"
  331. "$tooltest2_py --quiet --coin=eth --token=mm1"
  332. "$tooltest2_py --quiet --coin=eth --token=mm1 --testnet=1"
  333. "$tooltest2_py --quiet --coin=etc")
  334. f_tool2='tooltest2 tests completed'
  335. i_tool='Tooltest'
  336. s_tool="The following tests will run '$tooltest_py' for all supported coins"
  337. t_tool=(
  338. "$tooltest_py --coin=btc cryptocoin"
  339. "$tooltest_py --coin=btc mnemonic"
  340. "$tooltest_py --coin=ltc cryptocoin"
  341. "$tooltest_py --coin=eth cryptocoin"
  342. "$tooltest_py --coin=etc cryptocoin"
  343. "$tooltest_py --coin=dash cryptocoin"
  344. "$tooltest_py --coin=doge cryptocoin"
  345. "$tooltest_py --coin=emc cryptocoin"
  346. "$tooltest_py --coin=zec cryptocoin")
  347. [ "$MINGW" ] || {
  348. t_tool_len=${#t_tool[*]}
  349. t_tool[$t_tool_len]="$tooltest_py --coin=zec --type=zcash_z cryptocoin"
  350. }
  351. f_tool='tooltest tests completed'
  352. i_gen='Gentest'
  353. s_gen="The following tests will run '$gentest_py' on mainnet and testnet for all supported coins"
  354. t_gen=(
  355. "$gentest_py -q 2 $REFDIR/btcwallet.dump"
  356. "$gentest_py -q --type=segwit 2 $REFDIR/btcwallet-segwit.dump"
  357. "$gentest_py -q --type=bech32 2 $REFDIR/btcwallet-bech32.dump"
  358. "$gentest_py -q 1:2 $rounds"
  359. "$gentest_py -q --type=segwit 1:2 $rounds"
  360. "$gentest_py -q --type=bech32 1:2 $rounds"
  361. "$gentest_py -q --testnet=1 2 $REFDIR/btcwallet-testnet.dump"
  362. "$gentest_py -q --testnet=1 1:2 $rounds"
  363. "$gentest_py -q --testnet=1 --type=segwit 1:2 $rounds"
  364. "$gentest_py -q --coin=ltc 2 $REFDIR/litecoin/ltcwallet.dump"
  365. "$gentest_py -q --coin=ltc --type=segwit 2 $REFDIR/litecoin/ltcwallet-segwit.dump"
  366. "$gentest_py -q --coin=ltc --type=bech32 2 $REFDIR/litecoin/ltcwallet-bech32.dump"
  367. "$gentest_py -q --coin=ltc 1:2 $rounds"
  368. "$gentest_py -q --coin=ltc --type=segwit 1:2 $rounds"
  369. "$gentest_py -q --coin=ltc --testnet=1 2 $REFDIR/litecoin/ltcwallet-testnet.dump"
  370. "$gentest_py -q --coin=ltc --testnet=1 1:2 $rounds"
  371. "$gentest_py -q --coin=ltc --testnet=1 --type=segwit 1:2 $rounds")
  372. f_gen='gentest tests completed'
  373. [ -d .git -a -n "$INSTALL" -a -z "$TESTING" ] && {
  374. check
  375. uninstall
  376. install
  377. cd .test-release/pydist/mmgen-*
  378. }
  379. [ "$INSTALL_ONLY" ] && exit
  380. prompt_skip() {
  381. echo -n "Enter 's' to skip, or ENTER to continue: "; read -n1; echo
  382. [ "$REPLY" == 's' ] && return 0
  383. return 1
  384. }
  385. run_tests() {
  386. for t in $1; do
  387. eval echo -e "'\n'"\${GREEN}'###' Running $(echo \$i_$t) tests\$RESET
  388. eval echo -e $(echo \$s_$t)
  389. [ "$PAUSE" ] && prompt_skip && continue
  390. CUR_TEST=$t
  391. eval "do_test \"\${t_$t[@]}\""
  392. eval echo -e \$GREEN$(echo \$f_$t)\$RESET
  393. done
  394. }
  395. check_args() {
  396. for i in $tests; do
  397. echo "$dfl_tests $add_tests" | grep -q "\<$i\>" || { echo "$i: unrecognized argument"; exit; }
  398. done
  399. }
  400. tests=$dfl_tests
  401. [ "$*" ] && tests="$*"
  402. check_args
  403. echo "Running tests: $tests"
  404. START=$(date +%s)
  405. run_tests "$tests"
  406. TIME=$(($(date +%s)-START))
  407. MS=$(printf %02d:%02d $((TIME/60)) $((TIME%60)))
  408. [ "$NO_TMPFILE_REMOVAL" ] || rm -rf /tmp/mmgen-test-release-*
  409. echo -e "${GREEN}All OK. Total elapsed time: $MS$RESET"