Protobuf: added facilities for launching tests automatically from carkot/proto/compiler/Makefile

This commit is contained in:
dsavvinov
2016-08-17 13:25:07 +03:00
parent 8eb92866fa
commit 74a6f230d1
2 changed files with 36 additions and 0 deletions
+8
View File
@@ -17,6 +17,10 @@ RUNTIME_DIR = runtime
RUNTIME_SRC = $(RUNTIME_DIR)/src/main/kotlin
RUNTIME_JAR = $(RUNTIME_DIR)/build/libs/protokot-runtime.jar
# Testing project
TEST_PROJECT = $(PROTOC_DIR)/protoc-tests
# Produce protoc*, .jar-packed runtime and symlink to runtime sources
all: $(EXE) $(JAR) $(SYMLINK)
# Place protoc* into build directory
@@ -45,6 +49,10 @@ $(BINDIR):
$(BUILDDIR):
mkdir -p $(BUILDDIR)
# Testing
test:
cd $(TEST_PROJECT); ./run_tests.sh
clean:
$(MAKE) -C $(PROTOC_DIR) clean
cd $(RUNTIME_DIR); gradle clean
@@ -0,0 +1,28 @@
#!/bin/bash
red='\033[0;31m'
nc='\033[0m'
JAVA_TESTS_DIR='kt_java_tests'
JS_TESTS_DIR='kt_js_tests'
echo -e "${red} Running Java Tests${nc}"
cd ${JAVA_TESTS_DIR}
gradle runTests -q
cd ..
if [ $? -ne 0 ]; then
echo -e "${red}Kotlin <-> Java testing failed! ${nc}"
exit 1
fi
echo
echo -e "${red} Running JS Tests${nc}"
cd ${JS_TESTS_DIR}
gradle runTests -q
cd ..
if [ $? -ne 0 ]; then
echo -e "${red}Kotlin <-> JS testing failed! ${nc}"
exit 1
fi
echo