1rem Supply argument x64, x86 or amd64_arm64
2
3echo "Build"
4md build
5cd build
6call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %1
7cmake -DZ3_BUILD_DOTNET_BINDINGS=True -DZ3_BUILD_JAVA_BINDINGS=True -DZ3_BUILD_PYTHON_BINDINGS=True -G "NMake Makefiles" ../
8nmake
9if ERRORLEVEL 1 exit 1
10
11if %1==x86 goto BUILD_EXAMPLES
12if %1==amd64_arm64 goto BUILD_EXAMPLES
13echo "Test python bindings"
14pushd python
15python z3test.py z3
16if ERRORLEVEL 1 exit 1
17python z3test.py z3num
18if ERRORLEVEL 1 exit 1
19popd
20
21:BUILD_EXAMPLES
22echo "Build and run examples"
23nmake cpp_example
24if %1==amd64_arm64 goto C_EXAMPLE
25examples\cpp_example_build_dir\cpp_example.exe
26if ERRORLEVEL 1 exit 1
27
28:C_EXAMPLE
29nmake c_example
30if %1==amd64_arm64 goto ALL_DONE
31examples\c_example_build_dir\c_example.exe
32if ERRORLEVEL 1 exit 1
33
34rem nmake java_example
35rem java_example.exe
36if ERRORLEVEL 1 exit 1
37
38rem nmake dotnet_example
39rem dotnet_example.exe
40if ERRORLEVEL 1 exit 1
41
42echo "Build and run unit tests"
43nmake test-z3
44rem TBD: test error level
45rem test-z3.exe -a
46
47
48cd ..
49echo "Run regression tests"
50git clone https://github.com/z3prover/z3test z3test
51echo "test-benchmarks"
52python z3test\scripts\test_benchmarks.py build\z3.exe z3test\regressions\smt2
53if ERRORLEVEL 1 exit 1
54echo "benchmarks tested"
55
56:ALL_DONE
57echo "All done"
58