|
| 1 | +steps: |
| 2 | + - task: UsePythonVersion@0 |
| 3 | + inputs: |
| 4 | + versionSpec: '$(python.version)' |
| 5 | + displayName: "Using Python version: $(python.version)" |
| 6 | + |
| 7 | + - script: | |
| 8 | + python -m pip install --upgrade pip pytest numpy |
| 9 | + displayName: 'Pip install Python dependencies' |
| 10 | +
|
| 11 | + - script: | |
| 12 | + cmake -H. -Bbuild ^ |
| 13 | + -A x64 ^ |
| 14 | + -DCMAKE_BUILD_TYPE=Release ^ |
| 15 | + -DCMAKE_INSTALL_PREFIX=$(Agent.BuildDirectory)\Software\xcfun ^ |
| 16 | + -DCMAKE_CXX_COMPILER=cl.exe ^ |
| 17 | + -DXCFUN_PYTHON_INTERFACE=ON |
| 18 | + displayName: "Configure XCFun" |
| 19 | +
|
| 20 | + - script: | |
| 21 | + cmake --build build ^ |
| 22 | + --config Release ^ |
| 23 | + --target install |
| 24 | + displayName: "Build XCFun" |
| 25 | +
|
| 26 | + - script: | |
| 27 | + cd build |
| 28 | + ctest --output-on-failure ^ |
| 29 | + -C Release ^ |
| 30 | + -E python-interface ^ |
| 31 | + --verbose |
| 32 | + displayName: "Test XCFun with CTest" |
| 33 | +
|
| 34 | + # Test we can build the C++ example |
| 35 | + - script: | |
| 36 | + cmake -H.\examples\CXX_host -Bbuild_CXX_host ^ |
| 37 | + -A x64 ^ |
| 38 | + -DCMAKE_BUILD_TYPE=Release ^ |
| 39 | + -DXCFun_DIR=$(Agent.BuildDirectory)\Software\xcfun\share\cmake\XCFun ^ |
| 40 | + -DCMAKE_CXX_COMPILER=cl.exe |
| 41 | + displayName: "Configure C++ host examples" |
| 42 | +
|
| 43 | + - script: | |
| 44 | + cmake --build build_CXX_host |
| 45 | + displayName: "Build C++ host example" |
| 46 | +
|
| 47 | + # Test we can build the C example |
| 48 | + - script: | |
| 49 | + cmake -H.\examples\C_host -Bbuild_C_host ^ |
| 50 | + -A x64 ^ |
| 51 | + -DCMAKE_BUILD_TYPE=Release ^ |
| 52 | + -DXCFun_DIR=$(Agent.BuildDirectory)\Software\xcfun\share\cmake\XCFun ^ |
| 53 | + -DCMAKE_C_COMPILER=cl.exe |
| 54 | + displayName: "Configure C host examples" |
| 55 | +
|
| 56 | + - script: | |
| 57 | + cmake --build build_C_host |
| 58 | + displayName: "Build C host example" |
| 59 | +
|
| 60 | +# - script: | |
| 61 | +# set PYTHONPATH=$(Agent.BuildDirectory)\Software\xcfun\lib\python;%PYTHONPATH% |
| 62 | +# ls $(Agent.BuildDirectory)\Software\xcfun\lib\python\xcfun |
| 63 | +# python -c "import xcfun; print(xcfun.xcfun_splash())" |
| 64 | +# displayName: "Test XCFun Python module" |
0 commit comments