-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathrun-tests.sh
More file actions
executable file
·114 lines (102 loc) · 3.17 KB
/
run-tests.sh
File metadata and controls
executable file
·114 lines (102 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
# CsharpFlow Test Runner Script
# Runs comprehensive tests for all systems
echo "🚀 CsharpFlow Comprehensive Test Suite"
echo "======================================"
# Check for build tools
check_tool() {
if command -v $1 &> /dev/null; then
echo "✅ $1 found"
return 0
else
echo "❌ $1 not found"
return 1
fi
}
# Check available build tools
echo "📋 Checking build tools..."
DOTNET_AVAILABLE=false
MONO_AVAILABLE=false
if check_tool dotnet; then
DOTNET_AVAILABLE=true
elif check_tool mono && check_tool msbuild; then
MONO_AVAILABLE=true
else
echo "❌ No suitable build tools found"
echo "Install options:"
echo " - .NET SDK: sudo apt install dotnet-sdk-6.0"
echo " - Mono: sudo apt install mono-devel mono-complete"
exit 1
fi
echo ""
# Build project
echo "🔨 Building CsharpFlow..."
if [ "$DOTNET_AVAILABLE" = true ]; then
echo "Using .NET CLI..."
dotnet restore
if dotnet build Flow.sln; then
echo "✅ Build successful"
else
echo "❌ Build failed"
exit 1
fi
else
echo "Using Mono/MSBuild..."
if msbuild Flow.sln; then
echo "✅ Build successful"
else
echo "❌ Build failed"
exit 1
fi
fi
echo ""
# Run tests
echo "🧪 Running test suite..."
if [ "$DOTNET_AVAILABLE" = true ]; then
echo "Using .NET Test Runner..."
dotnet test TestFlow/TestFlow.csproj --logger "console;verbosity=detailed"
else
echo "Using Mono NUnit Runner..."
# Try different NUnit runner locations
NUNIT_RUNNERS=("nunit-console" "nunit3-console" "mono --runtime=v4.0 nunit-console.exe")
for runner in "${NUNIT_RUNNERS[@]}"; do
if command -v ${runner%% *} &> /dev/null; then
echo "Found NUnit runner: $runner"
$runner TestFlow/bin/Debug/TestFlow.dll
break
fi
done
fi
# Test results summary
if [ $? -eq 0 ]; then
echo ""
echo "🎉 All tests completed successfully!"
echo ""
echo "📊 Test Coverage Summary:"
echo " ✅ Core system tests"
echo " ✅ Flow control tests"
echo " ✅ Advanced scenario tests (20 tests)"
echo " ✅ New systems integration tests (28 tests)"
echo " ✅ Logger system tests"
echo " ✅ Memory management tests"
echo " ✅ Error handling tests"
echo " ✅ Object pooling tests"
echo ""
echo "🏆 CsharpFlow is ready for production use!"
else
echo ""
echo "❌ Some tests failed. Please review the output above."
echo ""
echo "Common issues:"
echo " - Missing dependencies (check packages.config)"
echo " - Version compatibility (check target framework)"
echo " - Test environment setup (check TestBase class)"
exit 1
fi
echo ""
echo "📋 System Information:"
echo " Platform: $(uname -a)"
echo " Build Tool: $(if [ "$DOTNET_AVAILABLE" = true ]; then echo ".NET $(dotnet --version)"; else echo "Mono $(mono --version | head -1)"; fi)"
echo " Test Runner: $(if [ "$DOTNET_AVAILABLE" = true ]; then echo "dotnet test"; else echo "NUnit Console"; fi)"
echo " Total C# Files: $(find . -name "*.cs" | wc -l)"
echo " Test Methods: $(grep -r "\[Test\]" TestFlow/ | wc -l)"