diff --git a/tests/docs-examples-test/test_R.sh b/tests/docs-examples-test/test_R.sh new file mode 100644 index 0000000000000000000000000000000000000000..8d2db4546f47f55a61f2a96d37ec7d4dbd725a5b --- /dev/null +++ b/tests/docs-examples-test/test_R.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +pgrep taosd || taosd >> /dev/null 2>&1 & +pgrep taosadapter || taosadapter >> /dev/null 2>&1 & + +cd ../../docs-examples/R + +jar_path=`find ../../../debug/build -name taos-jdbcdriver-*-dist.jar` +echo jar_path=$jar_path +R -f connect_native.r --args $jar_path +# R -f connect_rest.r --args $jar_path # bug 14704 + diff --git a/tests/docs-examples-test/test_c.sh b/tests/docs-examples-test/test_c.sh new file mode 100644 index 0000000000000000000000000000000000000000..2d47eff585b26659cb90a1669317efe074f1adde --- /dev/null +++ b/tests/docs-examples-test/test_c.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +set -e + +taosd >> /dev/null 2>&1 & +taosadapter >> /dev/null 2>&1 & + +cd ../../docs-examples/c + +# 1 +gcc connect_example.c -o connect_example -ltaos +./connect_example + +# 2 +taos -s "drop database if exists power" +gcc -o insert_example insert_example.c -ltaos +./insert_example + +gcc -o async_query_example async_query_example.c -ltaos +./async_query_example + +# 3 +taos -s "drop database if exists power" +gcc -o stmt_example stmt_example.c -ltaos +./stmt_example + +# 4 +taos -s "drop database if exists power" +gcc -o multi_bind_example multi_bind_example.c -ltaos +./multi_bind_example + +# 5 +gcc -o query_example query_example.c -ltaos +./query_example + +# 6 +taos -s "drop database if exists test" +gcc -o line_example line_example.c -ltaos +./line_example + +# 7 +taos -s "drop database if exists test" +gcc -o telnet_line_example telnet_line_example.c -ltaos +./telnet_line_example + +# 8 +taos -s "drop database if exists test" +gcc -o json_protocol_example json_protocol_example.c -ltaos +./json_protocol_example + diff --git a/tests/docs-examples-test/test_csharp.sh b/tests/docs-examples-test/test_csharp.sh new file mode 100644 index 0000000000000000000000000000000000000000..64d28d945f811db160c073643262f766e67fa59b --- /dev/null +++ b/tests/docs-examples-test/test_csharp.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +pgrep taosd || taosd >> /dev/null 2>&1 & +pgrep taosadapter || taosadapter >> /dev/null 2>&1 & +cd ../../docs-examples/csharp + +dotnet run --project connect.csproj + +taos -s "drop database if exists power" +dotnet run --project sqlinsert.csproj +dotnet run --project query.csproj +dotnet run --project asyncquery.csproj + +taos -s "drop database if exists power" +dotnet run --project stmtinsert.csproj + +taos -s "drop database if exists test" +dotnet run --project influxdbline.csproj + +taos -s "drop database if exists test" +dotnet run --project optstelnet.csproj + +taos -s "drop database if exists test" +dotnet run --project optsjson.csproj diff --git a/tests/docs-examples-test/test_go.sh b/tests/docs-examples-test/test_go.sh new file mode 100644 index 0000000000000000000000000000000000000000..d959d8c1ed646a130b5ffd8c3387e7abe965621e --- /dev/null +++ b/tests/docs-examples-test/test_go.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +taosd >> /dev/null 2>&1 & +taosadapter >> /dev/null 2>&1 & + +cd ../../docs-examples/go + +go mod tidy + +go run ./connect/restexample/main.go + +taos -s "drop database if exists power" +go run ./insert/sql/main.go + +taos -s "drop database if exists power" +go run ./insert/stmt/main.go + +taos -s "drop database if exists test" +go run ./insert/line/main.go + +taos -s "drop database if exists test" +go run ./insert/telnet/main.go + +taos -s "drop database if exists test" +go run ./insert/json/main.go + +go run ./query/sync/main.go diff --git a/tests/docs-examples-test/test_java.sh b/tests/docs-examples-test/test_java.sh new file mode 100644 index 0000000000000000000000000000000000000000..0e8e8266a18e3c1e403750f4a33c0fb765f8030f --- /dev/null +++ b/tests/docs-examples-test/test_java.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +taosd >> /dev/null 2>&1 & +taosadapter >> /dev/null 2>&1 & +cd ../../docs-examples/java + +mvn test \ No newline at end of file diff --git a/tests/docs-examples-test/test_node.sh b/tests/docs-examples-test/test_node.sh new file mode 100644 index 0000000000000000000000000000000000000000..14aab236f9f96b372f864384adf92cbc9c55559f --- /dev/null +++ b/tests/docs-examples-test/test_node.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +set -e + +pgrep taosd || taosd >> /dev/null 2>&1 & +pgrep taosadapter || taosadapter >> /dev/null 2>&1 & + +cd ../../docs-examples/node + +npm install +cd restexample; + +node connect.js + +cd ../nativeexample + +node connect.js + +taos -s "drop database if exists power" +node insert_example.js + +node query_example.js + +taos -s "drop database if exists power" +node param_bind_example.js + +taos -s "drop database if exists power" +node multi_bind_example.js + +taos -s "drop database if exists test" +node influxdb_line_example.js + +taos -s "drop database if exists test" +node opentsdb_telnet_example.js + +taos -s "drop database if exists test" +node opentsdb_json_example.js diff --git a/tests/docs-examples-test/test_python.sh b/tests/docs-examples-test/test_python.sh new file mode 100644 index 0000000000000000000000000000000000000000..2b96311b29736951e71851af49f84f074428be72 --- /dev/null +++ b/tests/docs-examples-test/test_python.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +set -e + +taosd >> /dev/null 2>&1 & +taosadapter >> /dev/null 2>&1 & + +cd ../../docs-examples/python + +# 1 +taos -s "create database if not exists log" +python3 connect_example.py + +# 2 +taos -s "drop database if exists power" +python3 native_insert_example.py + +# 3 +taos -s "drop database power" +python3 bind_param_example.py + +# 4 +taos -s "drop database power" +python3 multi_bind_example.py + +# 5 +python3 query_example.py + +# 6 +python3 async_query_example.py + +# 7 +taos -s "drop database if exists test" +python3 line_protocol_example.py + +# 8 +taos -s "drop database test" +python3 telnet_line_protocol_example.py + +# 9 +taos -s "drop database test" +python3 json_protocol_example.py + +# 10 +# python3 subscribe_demo.py + + diff --git a/tests/docs-examples-test/test_rust.sh b/tests/docs-examples-test/test_rust.sh new file mode 100644 index 0000000000000000000000000000000000000000..6bf0fe457af81d577cbc33c6a809717847b40c86 --- /dev/null +++ b/tests/docs-examples-test/test_rust.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +pgrep taosd || taosd >> /dev/null 2>&1 & +pgrep taosadapter || taosadapter >> /dev/null 2>&1 & + +cd ../../docs-examples/rust + +cargo run -p nativeexample --example connect +cargo run -p restexample --example connect + +taos -s "drop database if exists power" +cargo run -p restexample --example insert_example + +cargo run -p restexample --example query_example + + +taos -s "drop database if exists power" +cargo run -p nativeexample --example stmt_example + +taos -s "drop database if exists test" +cargo run -p schemalessexample --example influxdb_line_example + +taos -s "drop database if exists test" +cargo run -p schemalessexample --example opentsdb_telnet_example + +taos -s "drop database if exists test" +cargo run -p schemalessexample --example opentsdb_json_example \ No newline at end of file