File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,24 @@ TIER3="examples/frontend examples/markdown_editor examples/reflux_demo/web_count
3333# Exclusion list (package names to skip)
3434EXCLUDED=" too_many_cooks too_many_cooks_vscode_extension"
3535
36+ # Helper functions
37+ is_type () {
38+ local name=$( basename " $1 " )
39+ local list=" $2 "
40+ [[ " $list " =~ " $name " ]]
41+ }
42+
43+ is_excluded () {
44+ local name=$( basename " $1 " )
45+ [[ " $EXCLUDED " =~ " $name " ]]
46+ }
47+
48+ calc_coverage () {
49+ local lcov=" $1 "
50+ [[ -f " $lcov " ]] || { echo " 0" ; return ; }
51+ awk -F: ' /^LF:/ { total += $2 } /^LH:/ { covered += $2 } END { if (total > 0) printf "%.1f", (covered / total) * 100; else print "0" }' " $lcov "
52+ }
53+
3654# Parse arguments
3755TIER=" "
3856PACKAGES=()
@@ -73,24 +91,6 @@ TEST_PATHS=("${FILTERED_PATHS[@]}")
7391
7492mkdir -p " $LOGS_DIR "
7593
76- # Helper functions
77- is_type () {
78- local name=$( basename " $1 " )
79- local list=" $2 "
80- [[ " $list " =~ " $name " ]]
81- }
82-
83- is_excluded () {
84- local name=$( basename " $1 " )
85- [[ " $EXCLUDED " =~ " $name " ]]
86- }
87-
88- calc_coverage () {
89- local lcov=" $1 "
90- [[ -f " $lcov " ]] || { echo " 0" ; return ; }
91- awk -F: ' /^LF:/ { total += $2 } /^LH:/ { covered += $2 } END { if (total > 0) printf "%.1f", (covered / total) * 100; else print "0" }' " $lcov "
92- }
93-
9494# Test a single package (runs in subshell)
9595test_package () {
9696 local dir=" $1 "
You can’t perform that action at this time.
0 commit comments