-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·56 lines (45 loc) · 1.44 KB
/
run_tests.sh
File metadata and controls
executable file
·56 lines (45 loc) · 1.44 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
#!/bin/bash
set -e
# Colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
BUILD_DIR="build"
# Function to compile kernel
compile_kernel() {
local kernel=$1
echo -e "\nCompiling kernel: ${kernel}..."
if ./build/src/simplang "tests/${kernel}.sl"; then
echo -e "${GREEN}Successfully compiled ${kernel}${NC}"
else
echo -e "${RED}Failed to compile ${kernel}${NC}"
exit 1
fi
}
# Build everything
echo "Building SimpLang compiler and host programs..."
./build.sh
# Build all test programs
echo "Building test runners..."
cmake --build $BUILD_DIR --target all_test_runners
# Compile all test kernels
echo "Compiling test kernels..."
for kernel in arithmetic fibonacci loop conditions main return array_comprehensive; do # Added array_comprehensive - it's working
compile_kernel "test_${kernel}"
done
# Compile new SIMD array tests
echo "Compiling SIMD array tests..."
compile_kernel "test_simd_arrays"
compile_kernel "test_simple_simd"
# Compile performance test kernels
echo -e "\n${BLUE}Compiling performance test kernels...${NC}"
compile_kernel "test_baseline_perf" # This one works
compile_kernel "perf_array" # New array performance test
# Run regular tests
echo -e "\nRunning tests..."
cd $BUILD_DIR && ctest --output-on-failure
# Run performance test separately
echo -e "\n${BLUE}Running SIMD performance test...${NC}"
./tests/perf_simd_runner ./tests/obj/perf_simd.so
cd ..