cucumber-cpp icon indicating copy to clipboard operation
cucumber-cpp copied to clipboard

Cucumber for Makefile

Open FaiqueAli opened this issue 1 year ago • 1 comments

Discussed in https://github.com/orgs/cucumber/discussions/2188

Originally posted by FaiqueAli July 22, 2024 Hi, I have gone through the documentation and tried with the example project to understand cucumber and executed the defined test cases. Now, I need to integrate Cucumber in my QNX c++ project that is based on Makefile, Is there any documentation or sample project available to start with or any other reference point?

FaiqueAli avatar Jul 23 '24 07:07 FaiqueAli

Hi @FaiqueAli, I don't have documentation at hand, but lets try to figure it out. We integrated cucumber-cpp in Zephyr once, that seems to be close.

First question is how you would like to test your code. Best case is when your code under test is independent from QNX. Then you don't need QNX integration at all because you can setup a new (CMake?) project with cucumber-cpp and just reference your code under test.

When your code under test is inter-winded with QNX, you have to integrate cucumber-cpp as library in your QNX project. This shouldn't be any different from any other library. The maybe bigger issue is to run your tests. We did run Zephyr on Linux (with the posix target). Using (linking) cucumber-cpp did not work, we used cucumber-cpp-nomain and implemented our "own" main method. This was actually copying and adjusting acceptWireProtocol from src/main.cpp: https://github.com/cucumber/cucumber-cpp/blob/f468ce65f68e1560d22b4bc14e5e489b2651776e/src/main.cpp#L11

This runs cucumber-cpp within your QNX application. Then you can run cucumber-ruby from your Linux machine, it connects via a network socket to cucumber-cpp in QNX.

I hope this helps.

ursfassler avatar Aug 01 '24 15:08 ursfassler