File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,27 @@ PROJECT_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
1313# Create a temporary file for valgrind output
1414VALGRIND_LOG=$( mktemp)
1515
16- # Run valgrind with our test script
16+ # Create a temporary directory for compiled JS
17+ TEMP_DIR=$( mktemp -d)
18+ COMPILED_JS=" $TEMP_DIR /valgrind-test.js"
19+
20+ # Compile TypeScript to JavaScript
21+ echo " Compiling TypeScript..."
22+ npx tsc " $SCRIPT_DIR /valgrind-test.ts" --outDir " $TEMP_DIR " --module commonjs --target es2020 --skipLibCheck || {
23+ echo " Failed to compile TypeScript"
24+ rm -rf " $TEMP_DIR "
25+ rm -f " $VALGRIND_LOG "
26+ exit 1
27+ }
28+
29+ # Run valgrind with the compiled JavaScript
1730valgrind \
1831 --leak-check=full \
1932 --show-leak-kinds=definite,indirect \
2033 --track-origins=yes \
2134 --suppressions=" $PROJECT_ROOT /.valgrind.supp" \
2235 --log-file=" $VALGRIND_LOG " \
23- node " $SCRIPT_DIR /valgrind-test.mjs "
36+ node " $COMPILED_JS "
2437
2538# Check the exit code
2639EXIT_CODE=$?
4154
4255# Clean up
4356rm -f " $VALGRIND_LOG "
57+ rm -rf " $TEMP_DIR "
4458
4559# Return the worst exit code
4660if [ $EXIT_CODE -ne 0 ] || [ $LEAK_EXIT_CODE -ne 0 ]; then
You can’t perform that action at this time.
0 commit comments