How to pass command-line arguments in CTest at runtime

I’ve figured out a way to do it (using the Fundamental theorem of software engineering). It’s not as simple as I’d like, but here it is. First, create a file ${CMAKE_SOURCE_DIR}/cmake/RunTests.cmake with the content if(NOT DEFINED ENV{TESTS_ARGUMENTS}) set(ENV{TESTS_ARGUMENTS} “–default-arguments”) endif() execute_process(COMMAND ${TEST_EXECUTABLE} $ENV{TESTS_ARGUMENTS} RESULT_VARIABLE result) if(NOT “${result}” STREQUAL “0”) message(FATAL_ERROR “Test failed with return value … Read more

Search for files & file names using silver searcher

According to the man page of ag -G –file-search-regex PATTERN Only search files whose names match PATTERN. You can use the -G option to perform searches on files matching a pattern. So, to answer your question: root@apache107:~/rpm-4.12.0.1# ag -G cpio.c size rpm2cpio.c 21: off_t payload_size; 73: /* Retrieve payload size and compression type. */ 76: … Read more

How to suppress all warnings using MSBuild

msbuild /clp:ErrorsOnly /consoleloggerparameters: Parameters to console logger. (Short form: /clp) The available parameters are: PerformanceSummary–Show time spent in tasks, targets and projects. Summary–Show error and warning summary at the end. NoSummary–Don’t show error and warning summary at the end. **ErrorsOnly–Show only errors.** WarningsOnly–Show only warnings. NoItemAndPropertyList–Don’t show list of items and properties at the start … Read more

PowerShell: how to count number of rows in csv file?

Get-Content and Measure-Object are fine for small files, but both are super inefficient with memory. I had real problems with large files. When counting rows in a 1GB file using either method, Powershell gobbled up all available memory on the server (8GB), then started paging to disk. I left it over an hour, but it … Read more

openssl command line to verify the signature

I found two solutions to your problem. You can use rsautl that way: (with private key: my.key and public key my-pub.pem) $ openssl rsautl -sign -inkey my.key -out in.txt.rsa -in in.txt Enter pass phrase for my.key: $ openssl rsautl -verify -inkey my-pub.pem -in in.txt.rsa -pubin Bonjour With this method, all the document is included within … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)