Skip to content

Commit

Permalink
QoL improvements when running a subset of the expression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Oct 3, 2024
1 parent 9c7c3ff commit a931acd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ doxygen:
clean:
@echo ' removing generated test files'
@$(RM) $(wildcard test/prob/generate_tests$(EXE))
@$(RM) $(EXPRESSION_TESTS) $(call findfiles,test/expressions,*_test.cpp)
@$(RM) $(call findfiles,test/prob,*_generated_v_test.cpp)
@$(RM) $(call findfiles,test/prob,*_generated_vv_test.cpp)
@$(RM) $(call findfiles,test/prob,*_generated_fd_test.cpp)
Expand Down
2 changes: 1 addition & 1 deletion runTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def checkToolchainPathWindows():
universal_newlines=True,
)
out, err = p1.communicate()
if re.search(" |\(|\)", out):
if re.search(r" |\(|\)", out):
stopErr(
"The RTools toolchain is installed in a path with spaces or bracket. Please reinstall to a valid path.",
-1,
Expand Down
5 changes: 4 additions & 1 deletion test/generate_expression_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def save_tests_in_files(N_files, tests):
for i in range(N_files):
start = i * len(tests) // N_files
end = (i + 1) * len(tests) // N_files
if start >= end:
# don't try to compile an empty file
continue
with open(src_folder + "tests%d_test.cpp" % i, "w") as out:
out.write("#include <test/expressions/expression_test_helpers.hpp>\n\n")
for test in tests[start:end]:
Expand Down Expand Up @@ -125,5 +128,5 @@ def main(functions=(), j=1):
code = cg.cpp(),
)
)

save_tests_in_files(j, tests)
2 changes: 1 addition & 1 deletion test/sig_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def get_cpp_type(stan_type):
"uniform_lcdf": [None, 0.2, 0.9],
"uniform_lpdf": [None, 0.2, 0.9],
"uniform_rng": [0.2, 1.9, None],
"wiener_lpdf": [0.8, None, 0.4, None, None],
"wiener_lpdf": [0.8, None, 0.4, None, None, None, None, None],
}

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

0 comments on commit a931acd

Please sign in to comment.