blob: f858b4974ca58b6b58b789020bd597ff4c4f63c1 [file] [log] [blame]
Cosmos Nicolaoubbae3882014-10-02 22:58:19 -07001#!/bin/bash
2
3# Test the simulator command-line tool.
4#
5
6source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
7
Jing Jin89312ff2014-10-24 10:42:08 -07008readonly WORKDIR="${shell_test_WORK_DIR}"
9
Cosmos Nicolaoubbae3882014-10-02 22:58:19 -070010main() {
11 # Build binaries.
Jing Jin89312ff2014-10-24 10:42:08 -070012 cd "${WORKDIR}"
13 PKG="veyron.io/veyron/veyron/tools/naming/simulator"
14 SIMULATOR_BIN="$(shell_test::build_go_binary ${PKG})"
Cosmos Nicolaoubbae3882014-10-02 22:58:19 -070015
16 local -r DIR=$(shell::go_package_dir "${PKG}")
17 local file
Jiri Simsa85aea7b2014-10-15 15:48:36 -070018 for file in "${DIR}"/*.scr; do
19 echo "${file}"
Cosmos Nicolaou28f35c32014-12-01 20:36:27 -080020 "${SIMULATOR_BIN}" --interactive=false < "${file}" &> /dev/null || shell_test::fail "line ${LINENO}: failed for ${file}"
Cosmos Nicolaoubbae3882014-10-02 22:58:19 -070021 done
22 shell_test::pass
23}
24
25main "$@"