Closed Spuriosity1 closed 3 years ago
Is this a duplicate of #141? Check if you have bash installed - a recent version (>4.0 (dating from 2009 afair)).
I have GNU bash version 5.0.16 installed, but I ran the above in zsh
version 5.8 (apple darwin). I tried rebuilding in bash
(after clearing the build directory) and got the same output.
Could you run ctest -V -R JSON-Suite::not
to see more details of the error.
UpdateCTestConfiguration from :/*****/json-schema-validator/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/*****/json-schema-validator/build/DartConfiguration.tcl
Test project /*****/json-schema-validator/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 36
Start 36: JSON-Suite::not
36: Test command: /*****/json-schema-validator/test/test-pipe-in.sh "/*****/json-schema-validator/build/test/JSON-Schema-Test-Suite/json-schema-test" "/*****/json-schema-validator/test/JSON-Schema-Test-Suite/tests/draft7/not.json"
36: Test timeout computed to be: 10000000
36: /*****/json-schema-validator/test/test-pipe-in.sh: line 10: arr: bad array subscript
1/1 Test #36: JSON-Suite::not ..................***Failed 0.01 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 0.03 sec
The following tests FAILED:
36 - JSON-Suite::not (Failed)
Errors while running CTest
Looks like the same error #141 had.
I called ctest
in bash-5.0
, but maybe it's running the tests in the default shell?
What does which bash
give you?
/usr/local/bin/bash
This is a symlink to Homebrew's installation: brew list bash
gives
$ brew list bash
/usr/local/Cellar/bash/5.0.16/bin/bash
/usr/local/Cellar/bash/5.0.16/bin/bashbug
/usr/local/Cellar/bash/5.0.16/include/bash/ (58 files)
/usr/local/Cellar/bash/5.0.16/lib/bash/ (29 files)
/usr/local/Cellar/bash/5.0.16/lib/pkgconfig/bash.pc
/usr/local/Cellar/bash/5.0.16/share/doc/ (10 files)
/usr/local/Cellar/bash/5.0.16/share/info/bash.info
/usr/local/Cellar/bash/5.0.16/share/locale/ (38 files)
/usr/local/Cellar/bash/5.0.16/share/man/ (2 files)
That's the problem:
The script is looking for bash to be in /bin.
Right, /bin/bash
is the macOS default, which is bash 3.0.
So what now? How to fix it? Do you have an idea?
I just patched it by replacing arr[-1]
with ${arr[${#arr[@]}-1]}
, I'll submit a pull request (#150)
I recently tried to install this library by building from source.
System configuration: macOS 11.2 Big Sur nlohmann/json installed via Homebrew:
brew install nlohmann-json
, installed version 3.9.1 Output ofls /usr/local/lib | grep json
:libnlohmann_json_schema_validator.a
Output ofls /usr/local/include/nlohmann
:Build sequence:
giving output: