[programs/robocopy.exe] How to do unit test correctly?

Weiwen Chen ofey206 at gmail.com
Sat Jun 26 06:38:11 CDT 2021


Hi everyone:
I'm Weiwen Chen from Fudan University and I'm working on adding
`robocopy.exe` into wine. I stage my work on my github fork
<https://github.com/ofey404/wine/tree/robocopy>.

This program accepts complex command line arguments, so I'm trying to
implement my own `getopt` function which accepts dos-style flags(beginning
with slash, like `/x`).

The dummy code is under programs/robocopy
<https://github.com/ofey404/wine/tree/robocopy/programs/robocopy>
directory. And I want to add some unittest of `getopt_long()`, in
robocopy/tests/getopt.c
<https://github.com/ofey404/wine/blob/fe4a71850b023eefadab5ce357ce4671c1fffc72/programs/robocopy/tests/getopt.c#L21>.
I try to import my source code of `getopt.c` relatively into unit test
file, but I failed with error message like this:

../wine-git/programs/robocopy/tests/getopt.c:20: error: #include directive
with relative path not allowed

How can I include my source file correctly into the test? Maybe I should
configure something in the `configure` script, but I don't know how to do
it.

I've read some of the builtin programs, but they seldom have a separate
`test/` directory, and I don't find examples of unit tests.

Wish you all the best
Weiwen Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210626/d4c0021f/attachment-0001.htm>


More information about the wine-devel mailing list