@@ -45,7 +45,7 @@ OPTION:
4545 --skip-list SKIPLIST
4646 --extra-skip-list-suffixes SEMICOLON-SEPARATED LIST OF SUFFIXES
4747 --select-from-file SELECTFILE
48- --test-expr EXPRESSION
48+ --select NAME
4949 --debug-fail
5050"
5151
@@ -88,8 +88,8 @@ TRITON_TEST_IGNORE_ERRORS=false
8888SKIP_PIP=false
8989SKIP_PYTORCH=false
9090TEST_UNSKIP=false
91- TEST_FILTER_EXPRESSION =" "
92- TEST_DEBUG_FAIL =false
91+ TRITON_TEST_SELECT =" "
92+ TRITON_TEST_DEBUG_FAIL =false
9393
9494while (( $# != 0 )) ; do
9595 case " $1 " in
@@ -277,12 +277,12 @@ while (( $# != 0 )); do
277277 TRITON_TEST_SELECTFILE=" $( realpath " $2 " ) "
278278 shift 2
279279 ;;
280- --test-expr )
281- TEST_FILTER_EXPRESSION =" $2 "
280+ --select )
281+ TRITON_TEST_SELECT =" $2 "
282282 shift 2
283283 ;;
284284 --debug-fail)
285- TEST_DEBUG_FAIL =true
285+ TRITON_TEST_DEBUG_FAIL =true
286286 shift
287287 ;;
288288 --help)
@@ -354,44 +354,12 @@ run_unit_tests() {
354354}
355355
356356run_pytest_command () {
357- local pytest_args=()
358- local pytest_expr=" "
359-
360- # Parse args to separate -k expression
361- local args=(" $@ " )
362- for (( i= 0 ; i< ${# args[@]} ; i++ )) ; do
363- if [[ " ${args[i]} " == " -k" ]]; then
364- pytest_expr=" ${args[i+1]} "
365- i=$(( i + 1 ))
366- continue
367- fi
368- pytest_args+=(" ${args[i]} " )
369- done
370-
371- # Combine with TEST_FILTER_EXPRESSION
372- if [[ -n " $TEST_FILTER_EXPRESSION " ]]; then
373- if [[ -n " $pytest_expr " ]]; then
374- pytest_expr=" ($pytest_expr ) and ($TEST_FILTER_EXPRESSION )"
375- else
376- pytest_expr=" $TEST_FILTER_EXPRESSION "
377- fi
378- fi
379-
380- # Apply -k expression if any
381- if [[ -n " $pytest_expr " ]]; then
382- pytest_args+=(" -k" " $pytest_expr " )
383- fi
384-
385- if [[ " $TEST_DEBUG_FAIL " == true ]]; then
386- pytest_args+=(" --pdb" )
387- fi
388-
389- if [[ -n " $TRITON_TEST_SELECTFILE " ]] || [[ -n " $pytest_expr " ]]; then
390- if pytest " ${pytest_args[@]} " --collect-only > /dev/null 2>&1 ; then
391- pytest " ${pytest_args[@]} "
357+ if [[ -n " $TRITON_TEST_SELECTFILE " ]] || [[ -n " $TRITON_TEST_SELECT " ]]; then
358+ if pytest " $@ " --collect-only > /dev/null 2>&1 ; then
359+ pytest " $@ "
392360 fi
393361 else
394- pytest " ${pytest_args[@]} "
362+ pytest " $@ "
395363 fi
396364}
397365
0 commit comments