I’m working on running Coccinelle command in RobotFramework with “Run Process”, but the command line argument “–c++” can’t work.
This command works well in both command line and shell script:
spatch --sp-file test.cocci --dir ./ --c++
But not in .robot:
Run Process spatch --sp-file test.cocci --dir ./ --c++
I’ve tried --c\+\+, \-\-c\+\+, "–c++", etc… None of them work.
rasjani
(not available)
7 January 2025 11:48
2
in your example you have all the command line arguments for spatch with single spaces.
Also, you do not mention “how it doesn’t work” and what os you are running this on ?
For example; if i make “spatch.bat” that looks something like this;
echo 1: "%1"
echo 2: "%2"
echo 3: "%3"
echo 4: "%4"
echo 5: "%5"
and then robot to call that script:
*** Settings ***
Library Process
*** Test Cases ***
Run
Run Process c:/Users/xxx/src/e2e-testing/spatch.bat --sp-file test.cocci --dir ./ --c++ stdout=${CURDIR}/stdout.txt
the resulting stdout.txt looks like this;
C:\Users\xxx\src\e2e-testing>echo 1: "--sp-file"
1: "--sp-file"
C:\Users\xxx\src\e2e-testing>echo 2: "test.cocci"
2: "test.cocci"
C:\Users\xxx\src\e2e-testing>echo 3: "--dir"
3: "--dir"
C:\Users\xxx\src\e2e-testing>echo 4: "./"
4: "./"
C:\Users\xxx\src\e2e-testing>echo 5: "--c++"
5: "--c++"
the final argument at %5 looks just fine …
1 Like