From 2f0aebedc2609224bd073daa5218edd29e53cc33 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 22 Oct 2018 13:10:28 +0100 Subject: [PATCH] tests: adding new test for villas-convert --- tests/integration/convert.sh | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 tests/integration/convert.sh diff --git a/tests/integration/convert.sh b/tests/integration/convert.sh new file mode 100755 index 000000000..c9231744c --- /dev/null +++ b/tests/integration/convert.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# Integration test for villas-convert tool +# +# @author Steffen Vogel +# @copyright 2018, Institute for Automation of Complex Power Systems, EONERC +# @license GNU General Public License (version 3) +# +# VILLASnode +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +################################################################################## + +set -e + +OUTPUT_FILE=$(mktemp) +INPUT_FILE=$(mktemp) + +FORMATS="villas.human csv json" + +for FORMAT in ${FORMATS}; do + villas-signal -v5 -n -l20 mixed | \ + tee ${INPUT_FILE} | \ + villas-convert -o ${FORMAT} | \ + villas-convert -i ${FORMAT} | \ + tee ${OUTPUT_FILE} + + villas-test-cmp ${INPUT_FILE} ${OUTPUT_FILE} +done