Repository navigation
Modify some integration tests to allow them to pass on more limited systems - #307
Conversation
…on't have port 8080 open or where the test don't run on a 'normal' file system (e.g. a sandbox full of symlinks).
| #define STR2(p) #p | ||
| #define STR(p) STR2(p) |
There was a problem hiding this comment.
Why do we need the proxy definition of STR(p)? Cannot we just simply have what's on line 317 and name that STR(p) ?
There was a problem hiding this comment.
Without the extra layer, the macro expands to the literal argument (PORT) rather than what that argument expands to:
A quick demo of how things expand: https://godbolt.org/z/Mz4eexzb5
See also: https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Stringification.html
I disabled the check for the test files, but codacy even on re-runs keeps complaining about the issue. I suspect that it keeps the settings it had at the time the PR was created when evaluating a PR. I'll manually check codacy before merging this change to see if there are other issues, but in regard to the definition of the port parameter, don't worry about it. |
|
Looks like codacy caches config per commit rather than per PR, adding a new commit seems to make it start over. :-) |
|
Looks good. Merged it in. |
Several integration tests require that port 8080 be available. As this is one of the more common alternative HTTP ports, it is likely to be unavailable. A bit of pre-processor hacking allows the build to select a different port if needed.
Another issue is that tests that use
httpserver::file_responserequire that the expected path be an actual file. Some build environments (the provoking case is where I need to use libhttpserver from a Bazel build, which uses a sandbox built from symlinks, and I need to also build and run the test under bazel to ensure that build is also correct)NOTE: I don't know how to make Codacy/cppcheck happy with the new config
HTTPSERVER_PORT(it seems to already be fine with the other config:HTTPSERVER_NO_LOCAL_FS) . The most useful thing I've found is this but I don't know where to go from there.Help or suggestions would be appreciated.