Last active
October 1, 2018 12:39
-
-
Save tosik/10a1e6423e35f549996cf233c423d000 to your computer and use it in GitHub Desktop.
run googletest filtered by current file name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! RunTest() | |
let filter = substitute(expand('%:t'), "_test.cpp", "", "g") | |
let filter = substitute(l:filter, ".cpp", "", "g") | |
let filter = system("ruby -e \"print '" . l:filter . "'.split('_').collect(&:capitalize).join\"") | |
let lower_filter = tolower(l:filter[0]) . l:filter[1 : -1] | |
let output = system("make build-test && GTEST_FILTER=*" . l:filter . "*:*" . l:lower_filter . "* build/test") | |
echo "test finished" | |
cexpr l:output | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment