xref: /freebsd/contrib/bc/vs/tests/tests_bc.bat (revision d43fa8ef534ac87a16843d45264f56cf11e0fcbc)
1@echo off
2
3set scripts=..\..\tests\bc
4set bc=%~dp0\bc.exe
5set args=-ql
6
7del /f /q *.txt > NUL
8
9
10rem excluded: all, errors, read_errors, posix_errors, misc6, misc7, recursive_arrays
11
12for %%i in (
13abs
14add
15arctangent
16arrays
17assignments
18bitfuncs
19boolean
20comp
21cosine
22decimal
23divide
24divmod
25engineering
26exponent
27functions
28globals
29length
30letters
31lib2
32log
33misc
34misc1
35misc2
36misc3
37misc4
38misc5
39modexp
40modulus
41multiply
42pi
43places
44power
45print2
46rand
47read
48scale
49scientific
50shift
51sine
52sqrt
53stdin
54stdin1
55stdin2
56strings
57subtract
58trunc
59vars
60void
61leadingzero
62) do (
63if exist "%scripts%\%%i.txt" (
64	"%bc%" "%args%" < "%scripts%\%%i.txt" > "%%i_results.txt"
65
66	if errorlevel 1 (
67		echo FAIL_RUNTIME: %%i
68		goto :eof
69	)
70
71	fc.exe "%scripts%\%%i_results.txt" "%%i_results.txt" > NUL
72
73	if errorlevel 1 (
74		echo FAIL_RESULTS: %%i
75		goto :eof
76	)
77
78	echo PASS: %%i
79) else (
80	echo FAIL_NOT_EXIST: %%i
81	goto :eof
82)
83)
84
85if exist "%scripts%\leadingzero.txt" (
86	"%bc%" "%args%" -z < "%scripts%\leadingzero.txt" > "leadingzero_z_results.txt"
87
88	if errorlevel 1 (
89		echo FAIL_RUNTIME: leadingzero_z
90		goto :eof
91	)
92
93	fc.exe "%scripts%\leadingzero_results.txt" "leadingzero_z_results.txt" > NUL
94
95	if errorlevel 1 (
96		echo FAIL_RESULTS: leadingzero_z
97		goto :eof
98	)
99
100	echo PASS: leadingzero_z
101) else (
102	echo FAIL_NOT_EXIST: leadingzero_z
103	goto :eof
104)