Protobuf: added facilities for launching tests automatically from carkot/proto/compiler/Makefile
This commit is contained in:
@@ -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
|
||||
|
||||
+28
@@ -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
|
||||
Reference in New Issue
Block a user