Skip to content

Commit a931acd

Browse files
committed
QoL improvements when running a subset of the expression tests
1 parent 9c7c3ff commit a931acd

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ doxygen:
8787
clean:
8888
@echo ' removing generated test files'
8989
@$(RM) $(wildcard test/prob/generate_tests$(EXE))
90+
@$(RM) $(EXPRESSION_TESTS) $(call findfiles,test/expressions,*_test.cpp)
9091
@$(RM) $(call findfiles,test/prob,*_generated_v_test.cpp)
9192
@$(RM) $(call findfiles,test/prob,*_generated_vv_test.cpp)
9293
@$(RM) $(call findfiles,test/prob,*_generated_fd_test.cpp)

runTests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def checkToolchainPathWindows():
383383
universal_newlines=True,
384384
)
385385
out, err = p1.communicate()
386-
if re.search(" |\(|\)", out):
386+
if re.search(r" |\(|\)", out):
387387
stopErr(
388388
"The RTools toolchain is installed in a path with spaces or bracket. Please reinstall to a valid path.",
389389
-1,

test/generate_expression_tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def save_tests_in_files(N_files, tests):
2929
for i in range(N_files):
3030
start = i * len(tests) // N_files
3131
end = (i + 1) * len(tests) // N_files
32+
if start >= end:
33+
# don't try to compile an empty file
34+
continue
3235
with open(src_folder + "tests%d_test.cpp" % i, "w") as out:
3336
out.write("#include <test/expressions/expression_test_helpers.hpp>\n\n")
3437
for test in tests[start:end]:
@@ -125,5 +128,5 @@ def main(functions=(), j=1):
125128
code = cg.cpp(),
126129
)
127130
)
128-
131+
129132
save_tests_in_files(j, tests)

test/sig_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def get_cpp_type(stan_type):
132132
"uniform_lcdf": [None, 0.2, 0.9],
133133
"uniform_lpdf": [None, 0.2, 0.9],
134134
"uniform_rng": [0.2, 1.9, None],
135-
"wiener_lpdf": [0.8, None, 0.4, None, None],
135+
"wiener_lpdf": [0.8, None, 0.4, None, None, None, None, None],
136136
}
137137

138138
# list of functions we do not test. These are mainly functions implemented in compiler

0 commit comments

Comments
 (0)