loom
1#!/bin/bash
2
3process_files() {
4local title="$1"
5local output_file="$2"
6local file_path="$3"
7local executable="$4"
8local test_params="$5"
9
10echo "" >> "${output_file}"
11echo "=============================== ${title} ===============================" >> "${output_file}"
12
13find "${file_path}" -type f -name "*.txt" | sort | while read -r file; do
14echo "" >> "${output_file}"
15echo "----- ${file} -----" >> "${output_file}"
16
17echo ">>> SOURCE:" >> "${output_file}"
18cat "${file}" >> "${output_file}"
19
20echo "<<< RESULT:" >> "${output_file}"
21"${executable}" "${file}" "${test_params}" >> "${output_file}"
22done
23}
24
25
26OUTPUT_FILE="test/tmp/test-lsp-client.out"
27BASE_DIR="test/source/lsp/client"
28EXECUTABLE="build/tests/test-lsp-client"
29
30echo "Тесты языкового клиента" > ${OUTPUT_FILE}
31
32
33process_files "Тесты языкового клиента (json)" \
34"${OUTPUT_FILE}" \
35"${BASE_DIR}/json" \
36"${EXECUTABLE}" \
37"data/servers/lsp/bin/simodo-lsp-json test/tmp/server.log Debug save"
38
39
40process_files "Тесты языкового клиента (simodo)" \
41"${OUTPUT_FILE}" \
42"${BASE_DIR}/simodo" \
43"${EXECUTABLE}" \
44"data/servers/lsp/bin/simodo-lsp bin/semantics bin/modules data/grammar test/tmp/server.log Debug save"
45
46exit 0
47