-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running tests with MinGW build #300
Comments
MinGW doesn't have an "unsigned long" type, or it has some kind of issues with the %lx format? Well, that's not really a valid set of changes to include in the main sources. |
There are also a lot of warnings that will trigger failure because of What are the recommendations for fixing the other issues? Considering that it's very close, seems to be worth fixing. |
Putting the E... defines inside ifndef's with a comment explaining why that's there could be reasonable. What's the actual problem with the %lx format? Warnings should be fixed, not ignored. What does it complain about? |
Running
|
So those would have to be |
Well, the thought was that %p isn't defined to have a consistent representation across all platforms, but trying to emit pointer values and expecting consistency even across multiple runs of the same compiled binary on the same system is a lost cause. So, you're right, those uses should be changed to %p, since they're just error cases anyway. |
…rms' pointers are larger than "unsigned long". Also, there's no need to worry about output consistency here, since it'll be different anyway due to different pointer values.
With current master branch and this patch https://gist.github.com/braydonf/1428d5d91c08f5c381d4e6cb83529484 tests will compile with I've just realized there are several bash scripts in the tests that may be causing issue when using |
You need to pass it the location of the input files, i.e. valid.json which is in the tests directory. If you're in the tests directory while running it then it would simply be something like:
Of course, if you don't run the test_util_file.test wrapper script then you'll just get the raw output without having it compared to the expected output in test_util_file.expected, so to actually verify things you'll need to do the diff yourself. |
hmm... some comments about the mingw format issue: |
I'll apply those changes, since we happen to know that the values in question here are within range. However, that's not really a proper fix, and you shouldn't expect building on mingw to continue to work in general. |
…o work around broken behavior of MinGW.
Okay. So I've been able to have the tests run with ---
tests/test-defs.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/test-defs.sh b/tests/test-defs.sh
index 5a32d39..817904e 100755
--- a/tests/test-defs.sh
+++ b/tests/test-defs.sh
@@ -98,7 +98,7 @@ run_output_test()
err=$?
else
- eval "\"${top_builddir}/${TEST_COMMAND}"\" \"\$@\" ${REDIR_OUTPUT}
+ eval wine "\"${top_builddir}/${TEST_COMMAND}"\" \"\$@\" ${REDIR_OUTPUT}
err=$?
fi
@@ -114,6 +114,8 @@ run_output_test()
fi
fi
+ sed -i 's/\r$//' "${TEST_OUTPUT}.out"
+
if ! "$CMP" -s "${srcdir}/${TEST_OUTPUT}.expected" "${TEST_OUTPUT}.out" ; then
echo "ERROR: \"${TEST_COMMAND} $@\" (${TEST_OUTPUT}) failed (set VERBOSE=1 to see full output):" 1>&2
(cd "${CURDIR}" ; set -x ; diff "${srcdir}/${TEST_OUTPUT}.expected" "$testsubdir/${TEST_OUTPUT}.out")
--
2.7.4
With results:
Not sure what's going on with the other tests yet. |
Why is that? Adding it to the CI should help maintain that it continues to work. |
Since it's not an environment that I consider a "first class" target for json-c, I'm reluctant to impose restrictions on what kind of code may be included just to allow it to work within mingw, and I'm unlikely to require that proposed changes keep it working (or even notice when they break). |
I tried running tests with
wine
with themake check
build, and ran into some issues.With these changes it worked:
https://gist.github.com/braydonf/41091d8a63d111aa2d954dccb1ad0d56
The text was updated successfully, but these errors were encountered: