diff --git a/proto/compiler/Makefile b/proto/compiler/Makefile index 862536be967..3cc8fe32be8 100644 --- a/proto/compiler/Makefile +++ b/proto/compiler/Makefile @@ -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 diff --git a/proto/compiler/google/src/google/protobuf/compiler/kotlin/protoc-tests/run_tests.sh b/proto/compiler/google/src/google/protobuf/compiler/kotlin/protoc-tests/run_tests.sh new file mode 100755 index 00000000000..918d422cb65 --- /dev/null +++ b/proto/compiler/google/src/google/protobuf/compiler/kotlin/protoc-tests/run_tests.sh @@ -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