Skip to content

Commit 34890bb

Browse files
committed
Updated unittests scripts.
1 parent 74adaa2 commit 34890bb

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

test_scripts/run_unittests_golang.sh

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,41 @@ if [ -z "$1" ]; then
77
exit 1
88
fi
99

10+
GO_BUILD_SUBFOLDER=go_$1
11+
12+
if [ "${VERBOSE:-}" -eq 1 ] 2>/dev/null; then
13+
printf "Preparing Go build subfolder: $GO_BUILD_SUBFOLDER\n"
14+
fi
15+
16+
# Check if the go build subfolder exists
17+
if [ -d "$GO_BUILD_SUBFOLDER" ]; then
18+
# Find and delete all files and folders
19+
find "$GO_BUILD_SUBFOLDER" -mindepth 1 -exec rm -rf {} +
20+
21+
if [ "${VERBOSE:-}" -eq 1 ] 2>/dev/null; then
22+
printf "Cleanup completed.\n"
23+
fi
24+
else
25+
if [ "${VERBOSE:-}" -eq 1 ] 2>/dev/null; then
26+
printf "Subfolder does not exist. Creating it...\n"
27+
fi
28+
29+
mkdir $GO_BUILD_SUBFOLDER
30+
fi
31+
32+
cp -R $1/* $GO_BUILD_SUBFOLDER
33+
1034
# Move to the subfolder
11-
cd "$1" 2>/dev/null
35+
cd "$GO_BUILD_SUBFOLDER" 2>/dev/null
1236

1337
if [ $? -ne 0 ]; then
14-
echo "Error: Subfolder '$1' does not exist."
38+
printf "Error: Go build folder '$GO_BUILD_SUBFOLDER' does not exist.\n"
1539
exit 2
1640
fi
1741

42+
echo "Runinng go get..."
43+
go get
44+
1845
# Execute all Golang unittests in the subfolder
1946
echo "Running Golang unittests in $1..."
2047
go test

test_scripts/run_unittests_react.sh

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,33 @@ if [ -z "$1" ]; then
77
exit 1
88
fi
99

10+
# Define the path to the subfolder
11+
NODE_SUBFOLDER=node_$1
12+
13+
if [ "${VERBOSE:-}" -eq 1 ] 2>/dev/null; then
14+
printf "Preparing Node subfolder: $NODE_SUBFOLDER\n"
15+
fi
16+
17+
# Check if the node subfolder exists
18+
if [ -d "$NODE_SUBFOLDER" ]; then
19+
# Find and delete all files and folders except "node_modules", "build", and "package-lock.json"
20+
find "$NODE_SUBFOLDER" -mindepth 1 ! -path "$NODE_SUBFOLDER/node_modules*" ! -path "$NODE_SUBFOLDER/build*" ! -name "package-lock.json" -exec rm -rf {} +
21+
22+
if [ "${VERBOSE:-}" -eq 1 ] 2>/dev/null; then
23+
printf "Cleanup completed, keeping 'node_modules' and 'package-lock.json'.\n"
24+
fi
25+
else
26+
if [ "${VERBOSE:-}" -eq 1 ] 2>/dev/null; then
27+
printf "Subfolder does not exist. Creating it...\n"
28+
fi
29+
30+
mkdir $NODE_SUBFOLDER
31+
fi
32+
33+
cp -R $1/* $NODE_SUBFOLDER
34+
1035
# Move to the subfolder
11-
cd "$1" 2>/dev/null
36+
cd "$NODE_SUBFOLDER" 2>/dev/null
1237

1338
if [ $? -ne 0 ]; then
1439
echo "Error: Subfolder '$1' does not exist."

0 commit comments

Comments
 (0)