2015-02-25 20:30:24 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-03-11 01:55:02 -04:00
|
|
|
ANSI_RED=`tput setaf 1`
|
|
|
|
ANSI_GREEN=`tput setaf 2`
|
|
|
|
ANSI_CYAN=`tput setaf 6`
|
|
|
|
ANSI_RESET=`tput sgr0`
|
2015-03-01 03:03:09 +08:00
|
|
|
|
|
|
|
run_test() {
|
2015-03-11 01:55:02 -04:00
|
|
|
echo -e "\n${ANSI_CYAN}running test: $@ ${ANSI_RESET}"
|
|
|
|
"$@"
|
2015-03-01 03:03:09 +08:00
|
|
|
if [ $? -ne 0 ]; then
|
2015-03-11 01:55:02 -04:00
|
|
|
echo "${ANSI_RED}[FAILED] $@ ${ANSI_RESET}"
|
2015-03-01 03:03:09 +08:00
|
|
|
foundError=1
|
|
|
|
else
|
2015-03-11 01:55:02 -04:00
|
|
|
echo "${ANSI_GREEN}[PASSED] $@ ${ANSI_RESET}"
|
2015-03-01 03:03:09 +08:00
|
|
|
fi
|
2015-03-11 01:55:02 -04:00
|
|
|
echo
|
2015-03-01 03:03:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
foundError=0
|
2015-03-11 01:55:02 -04:00
|
|
|
echo -e "Running $CI_TARGET tests\n"
|
2015-02-25 20:30:24 -08:00
|
|
|
|
2015-03-01 03:03:09 +08:00
|
|
|
CI_TARGET=${CI_TARGET:-core}
|
2015-02-25 20:30:24 -08:00
|
|
|
if [ "$CI_TARGET" == "core" ]; then
|
2015-03-01 03:03:09 +08:00
|
|
|
run_test make -C myhdl/test/core
|
|
|
|
run_test make -C myhdl/test/core2
|
2015-02-25 20:30:24 -08:00
|
|
|
elif [ "$CI_TARGET" == "icarus" ]; then
|
2015-03-01 03:03:09 +08:00
|
|
|
run_test make -C "myhdl/test/conversion/general" icarus
|
2015-03-29 11:05:35 -04:00
|
|
|
run_test make -C cosimulation/icarus test
|
2015-03-01 03:03:09 +08:00
|
|
|
run_test make -C myhdl/test/conversion/toVerilog
|
2015-03-03 18:19:29 -05:00
|
|
|
elif [ "$CI_TARGET" == "ghdl" ]; then
|
|
|
|
run_test make -C "myhdl/test/conversion/general" GHDL
|
|
|
|
run_test make -C myhdl/test/conversion/toVHDL GHDL
|
2015-02-25 20:30:24 -08:00
|
|
|
fi
|
2015-03-01 03:03:09 +08:00
|
|
|
|
|
|
|
exit $foundError
|