Jan Nils Ferner Jan Nils Ferner - 28 days ago 11
C++ Question

Running tests in Appveyor with C++ without a testing framework

We currently have set our tests up on Travis Ci by using CMakes integrated CTest, which just checks if the

int main()
returns something else than 0.

We would now like to add testing functionality to our automated windows builds in Appveyor while still keeping this simple return value check.

Every ressource for Appveyors testing we've found so far assumes we're using some kind of testing framework like MSTest, which we don't intend to do.

I found out that you can run custom CMD and Powershell testing scripts on Appveyor, which sounds like an ideal way to check the return value of our test.

Unfortunatly, we are all pretty inexperienced using CMD and Powershell and have no clue how to achieve this.

For reference, this is the project in question: JNF_NEAT

Answer

we set up our .appveyor.yml like this:

test_script:
  - C:\projects\jnf-neat\x64\Release\XORSolver.exe
  - C:\projects\jnf-neat\x64\Release\EvenNumbers.exe

where XORSolver.exe and EvenNumbers.exe are our integration tests that we already used to run on CMake.