@@ -29,34 +29,66 @@ conda activate "$CONDA_ENV"
29
29
# export TORCHINDUCTOR_FX_GRAPH_CACHE=0
30
30
# export TRITONPARSE_DEBUG=1
31
31
32
- # Build pytest command
33
- PYTEST_CMD=" python -m unittest tests.test_tritonparse"
34
-
35
- # Add verbose flag
36
- if [ " $VERBOSE " = " true" ]; then
37
- PYTEST_CMD=" $PYTEST_CMD -v"
38
- fi
39
-
40
- # Add coverage if requested
41
- if [ " $COVERAGE " = " true" ]; then
42
- PYTEST_CMD=" $PYTEST_CMD --cov=tritonparse --cov-report=xml"
43
- fi
44
-
45
- # Run tests based on type
32
+ # Build unittest command based on test type
46
33
case " $TEST_TYPE " in
47
34
" cpu" )
48
35
echo " Running CPU tests only..."
49
- $PYTEST_CMD -m " not cuda"
36
+ if [ " $COVERAGE " = " true" ]; then
37
+ echo " Running with coverage..."
38
+ if [ " $VERBOSE " = " true" ]; then
39
+ coverage run -m unittest tests.test_tritonparse.TestTritonparseCPU -v
40
+ else
41
+ coverage run -m unittest tests.test_tritonparse.TestTritonparseCPU
42
+ fi
43
+ coverage report
44
+ coverage xml
45
+ else
46
+ if [ " $VERBOSE " = " true" ]; then
47
+ python -m unittest tests.test_tritonparse.TestTritonparseCPU -v
48
+ else
49
+ python -m unittest tests.test_tritonparse.TestTritonparseCPU
50
+ fi
51
+ fi
50
52
;;
51
53
" cuda" )
52
54
echo " Running CUDA tests only..."
53
55
export CUDA_VISIBLE_DEVICES=0
54
- $PYTEST_CMD -m cuda
56
+ if [ " $COVERAGE " = " true" ]; then
57
+ echo " Running with coverage..."
58
+ if [ " $VERBOSE " = " true" ]; then
59
+ coverage run -m unittest tests.test_tritonparse.TestTritonparseCUDA -v
60
+ else
61
+ coverage run -m unittest tests.test_tritonparse.TestTritonparseCUDA
62
+ fi
63
+ coverage report
64
+ coverage xml
65
+ else
66
+ if [ " $VERBOSE " = " true" ]; then
67
+ python -m unittest tests.test_tritonparse.TestTritonparseCUDA -v
68
+ else
69
+ python -m unittest tests.test_tritonparse.TestTritonparseCUDA
70
+ fi
71
+ fi
55
72
;;
56
73
" all" )
57
74
echo " Running all tests..."
58
75
export CUDA_VISIBLE_DEVICES=0
59
- $PYTEST_CMD
76
+ if [ " $COVERAGE " = " true" ]; then
77
+ echo " Running with coverage..."
78
+ if [ " $VERBOSE " = " true" ]; then
79
+ coverage run -m unittest tests.test_tritonparse -v
80
+ else
81
+ coverage run -m unittest tests.test_tritonparse
82
+ fi
83
+ coverage report
84
+ coverage xml
85
+ else
86
+ if [ " $VERBOSE " = " true" ]; then
87
+ python -m unittest tests.test_tritonparse -v
88
+ else
89
+ python -m unittest tests.test_tritonparse
90
+ fi
91
+ fi
60
92
;;
61
93
* )
62
94
echo " Unknown test type: $TEST_TYPE "
0 commit comments