working-directory: tests
run: bash PythonTest.sh
- #build-go:
- # name: Build Go
- # runs-on: ubuntu-latest
- # steps:
- # - uses: actions/checkout@v1
- # - name: flatc
- # # FIXME: make test script not rely on flatc
- # run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j4
- # - name: test
- # working-directory: tests
- # run: bash GoTest.sh
+ build-go:
+ name: Build Go
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - name: flatc
+ # FIXME: make test script not rely on flatc
+ run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j4
+ - name: test
+ working-directory: tests
+ run: bash GoTest.sh
#build-csharp:
# name: Build CSharp
# flag -test.bench and the wildcard regexp ".":
# go -test -test.bench=. ...
GOPATH=${go_path} go test flatbuffers_test \
- --test.coverpkg=github.com/google/flatbuffers/go \
+ --coverpkg=github.com/google/flatbuffers/go \
--cpp_data=${test_dir}/monsterdata_test.mon \
--out_data=${test_dir}/monsterdata_go_wire.mon \
- --test.bench=. \
- --test.benchtime=3s \
+ --bench=. \
+ --benchtime=3s \
--fuzz=true \
--fuzz_fields=4 \
--fuzz_objects=10000
flag.IntVar(&fuzzFields, "fuzz_fields", 4, "fields per fuzzer object")
flag.IntVar(&fuzzObjects, "fuzz_objects", 10000,
"number of fuzzer objects (higher is slower and more thorough")
- flag.Parse()
-
- if cppData == "" {
- fmt.Fprintf(os.Stderr, "cpp_data argument is required\n")
- os.Exit(1)
- }
}
// Store specific byte patterns in these variables for the fuzzer. These
overflowingInt64Val = flatbuffers.GetInt64([]byte{0x84, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44})
)
+func TestMain(m *testing.M) {
+ flag.Parse()
+ if cppData == "" {
+ fmt.Fprintf(os.Stderr, "cpp_data argument is required\n")
+ os.Exit(1)
+ }
+ os.Exit(m.Run())
+}
+
// TestAll runs all checks, failing if any errors occur.
func TestAll(t *testing.T) {
// Verify that the Go FlatBuffers runtime library generates the