@@ -15,29 +15,33 @@ for source_name in $source_names; do
1515 name=${source_name#*/ }
1616 type=${source_name%/* }
1717 if [ $type == " datasource" ]; then
18- type=dataSource
18+ type=DataSource
1919 fi
20- # echo $source_name $type $name
20+ if [ $type == " resource" ]; then
21+ type=Resource
22+ fi
2123 function_name=$( cat tencentcloud/provider.go | grep " \" ${name} \" " | grep " ${type} " )
2224 function_name=${function_name#*: }
2325 function_name=$( echo $( echo ${function_name% ,* } ) )
24-
25- test_file= $( grep -r " func $ function_name \*schema\.Resource " tencentcloud )
26- test_file=${test_file #*/ }
26+ package= ${function_name % . * }
27+ function_name= ${ function_name#* .}
28+ test_file=$( grep -r " func $function_name \*schema\.Resource " tencentcloud/services/ $package )
2729 test_file=${test_file%:* }
2830 test_files=" $test_files $test_file "
2931done
3032echo " test files:" $test_files
3133
3234for test_file in $test_files ; do
35+ file_path=${test_file%/* }
36+ test_file=${test_file##*/ }
3337 test_case_type=${test_file% _tc_* }
3438 test_case_name=${test_file#* _tc_}
3539 test_case_name=${test_case_name% .* }
3640
3741 test_case_type=` echo $test_case_type | sed -r ' s/(^|_)(\w)/\U\2/g' `
3842 test_case_name=` echo $test_case_name | sed -r ' s/(^|_)(\w)/\U\2/g' `
3943
40- go_test_cmd=" go test -v -run TestAccTencentCloud${test_case_name}${test_case_type} -timeout=0 ./tencentcloud/ "
44+ go_test_cmd=" go test -v -run TestAccTencentCloud${test_case_name}${test_case_type} -timeout=0 ./$file_path "
4145 echo $go_test_cmd
4246 $go_test_cmd
4347 if [ $? -ne 0 ]; then
0 commit comments