chakra-core / chakra-core/ChakraCore
Running native tests xplat
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
In an attempt to write some unit tests for #2581 I hit a slight snag. The native tests that test the JSRT api is driven by a windows only build.
I managed to get the driver to compile, this took a few #defines and an update to catch.hpp. This could probably be improved with a bit more work and getting pal included. I ran into a few macro redefinitions with `charkacore.h` though. Also I had to use libc++ as the version of stdlib++ doesn't seem to support some of the features that are needed by catch. I would need to look on linux to see what happens here.
The other problem is the rather liberal use of windows only jsrt functions. E.g.
```
REQUIRE(JsGetPropertyNameFromId(name1, &name) == JsNoError);
REQUIRE(JsPointerToString(_u("value1"), wcslen(_u("value1")), &value1) == JsNoError);
```
My suggestion is rewrite these to use `JsCopyString` etc. If their is still a need to test JsPointerToString this can be done with platform specific test files. If I head down this path would this be ok?
cc: @digitalinfinity
Contributor guide
Assessment
This issue has not been assessed yet.