File: test.bat

package info (click to toggle)
sentencepiece 0.1.95-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 48,820 kB
  • sloc: cpp: 182,738; python: 768; xml: 231; sh: 228; perl: 198; pascal: 50; makefile: 23
file content (38 lines) | stat: -rw-r--r-- 1,169 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
set PLATFORM=%1
if "%PLATFORM%"=="" set PLATFORM=x64
set PLATFORM_PREFIX=
if "%PLATFORM%"=="x64" set PLATFORM_PREFIX=-x64
set _CL_=/utf-8
set PATH=c:\Program Files\Git\usr\bin;c:\MinGW\bin;%PATH%
set CURRENT_PATH=%~dp0
set LIBRARY_PATH=%CURRENT_PATH%build\root

mkdir build
cd build

cmake .. -A %PLATFORM% -DSPM_BUILD_TEST=ON -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=%LIBRARY_PATH%
cmake --build . --config Release --target install || goto :error
ctest -C Release || goto :error
cpack || goto :error

cd ..\python
rem call :BuildPython C:\Python27%PLATFORM_PREFIX%
call :BuildPython C:\Python35%PLATFORM_PREFIX%
call :BuildPython C:\Python36%PLATFORM_PREFIX%
call :BuildPython C:\Python37%PLATFORM_PREFIX%
call :BuildPython C:\Python38%PLATFORM_PREFIX%
call :BuildPython C:\Python39%PLATFORM_PREFIX%
c:\Python38%PLATFORM_PREFIX%\python setup.py sdist || goto :error
exit

:BuildPython
%1\python -m pip install wheel || goto :error
%1\python setup.py build || goto :error
%1\python setup.py bdist_wheel || goto :error
%1\python setup.py test || goto :error
rmdir /Q /S build
del /S *.pyd
exit /b

:error
exit /b %errorlevel%