ci: register schemagen regression tests with ctest
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-arm64, ubuntu-latest-arm64, true) (pull_request) Successful in 53s
CI / pre-commit (pull_request) Successful in 51s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-arm64, ubuntu-latest-arm64, false) (pull_request) Successful in 51s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-amd64, ubuntu-latest-amd64, true) (pull_request) Successful in 1m30s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-amd64, ubuntu-latest-amd64, false) (pull_request) Successful in 1m24s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-arm64, ubuntu-latest-arm64, true) (pull_request) Successful in 53s
CI / pre-commit (pull_request) Successful in 51s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-arm64, ubuntu-latest-arm64, false) (pull_request) Successful in 51s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-amd64, ubuntu-latest-amd64, true) (pull_request) Successful in 1m30s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-amd64, ubuntu-latest-amd64, false) (pull_request) Successful in 1m24s
Remove the standalone "Run schemagen tests" workflow step and instead add the big-schema regression test to contrib/schemagen/CMakeLists.txt so ctest picks it up alongside schemagen_example. Update README to document both `ctest` and the convenience `./run_tests.sh`. Closes #3
This commit is contained in:
@@ -76,15 +76,25 @@ union `type` lists other than `["T", "null"]`, non-string enums, and remote
|
||||
|
||||
## Testing
|
||||
|
||||
After building weaseljson (e.g. `cmake -S . -B build && make -C build`), run:
|
||||
The schemagen tests are registered with CTest and run as part of the default
|
||||
`ctest` invocation from the build directory:
|
||||
|
||||
```sh
|
||||
cmake -S . -B build
|
||||
make -C build -j "$(nproc)"
|
||||
cd build
|
||||
ctest --output-on-failure
|
||||
```
|
||||
|
||||
For local development you can also use the convenience script:
|
||||
|
||||
```sh
|
||||
cd contrib/schemagen
|
||||
./run_tests.sh
|
||||
```
|
||||
|
||||
This regenerates the example parser (`gen.h`) and a regression parser with 40
|
||||
required properties (`big.h`), compiles `test_gen.cpp` and `test_big.cpp`, and
|
||||
runs both. `test_big.cpp` specifically covers issue #3: it checks that a
|
||||
40-property object accepts all fields, rejects a missing field at index 32, and
|
||||
rejects duplicate keys around the 32-bit boundary.
|
||||
Both regenerate the example parser (`gen.h`) and a regression parser with 40
|
||||
required properties (`big.h`), compile `test_gen.cpp` and `test_big.cpp`, and run
|
||||
them. `test_big.cpp` specifically covers issue #3: it checks that a 40-property
|
||||
object accepts all fields, rejects a missing field at index 32, and rejects
|
||||
duplicate keys around the 32-bit boundary.
|
||||
|
||||
Reference in New Issue
Block a user