ariths-gen/tests/test_mac.sh
Vojta Mrazek bee2086705
Devel (#2)
* CGP format

* CGP format minor

* General MAC circuit

* Modified definition of MAC class to allow proper generation of output representations.

* auto test MAC

* test all

* Made some minor changes and updated creation of MAC circuit.

* Updated logic behind generating export representations, mainly focused around circuit and its buses and subcomponents namings.

* Made some minor changes concerning proper exportation of multiplier circuits.

Co-authored-by: honzastor <jan.klhufek@gmail.com>
2021-09-18 12:55:31 +02:00

36 lines
601 B
Bash

#!/usr/bin/bash
valid=1
test_circuit_mac () {
local type=$1
for mode in "flat" "hier"; do
echo -e "===== Testing \e[33mMAC\e[0m ($mode) ======"
g++ -std=c++11 -pedantic -g -std=c++11 -pedantic -DCNAME="$circuit" $type.c ../test_circuits/mac/mac_$mode.c -o tmp.exe
if ./tmp.exe ; then
echo -e "[\e[32mok\e[0m]"
else
echo -e "[\e[31mfail\e[0m]"
valid=0
fi
done
}
test_circuit_mac "mac"
if [ $valid -eq 1 ]; then
echo "all tests passed"
exit 0
else
echo "some of tests failed"
exit 1
fi