sakrejda / protostan

Thin protobuf interface wrapper for Stan
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Exhaustively test stan::lang::compile wrapper #9

Closed ariddell closed 8 years ago

ariddell commented 8 years ago

The tests should test every possible outcome for stanc

From an email from Bob

>> Right now, there's two ways to fail.  You can either get
>> an exception in the code when there's a failed expectation
>> (such as an opening brace without the expected close brace)
>> and a parse failure when the program's ill formed for other
>> reasons.  This is just the behavior inherited from the Spirit
>> Qi parser, but we could always take a negative return and
>> throw an exception.

Tests for these conditions must be somewhere in cmdstan or stan, right?

sakrejda commented 8 years ago

Here's the ones I could find:

~/packages/stan-dev/protostan/lib/stan/src/test/unit$ grep 'compile(' ./* -R ./lang/compiler_test.cpp: stan::lang::compile(&msgs, stan_lang_in, cpp_out, model_name, in_file_name); ./lang/compiler_test.cpp: EXPECT_NO_THROW(stan::lang::compile(0, stan_lang_in, cpp_out, model_name, in_file_name)); ./lang/compiler_test.cpp: EXPECT_NO_THROW(stan::lang::compile(&out, stan_lang_in, cpp_out, model_name, in_file_name));

Doesn't seem to cover it?

ariddell commented 8 years ago

That's a start. I can translate PyStan's tests into gtest as well.

On 12/30, Krzysztof Sakrejda wrote:

Here's the ones I could find:

~/packages/stan-dev/protostan/lib/stan/src/test/unit$ grep 'compile(' ./* -R ./lang/compiler_test.cpp: stan::lang::compile(&msgs, stan_lang_in, cpp_out, model_name, in_file_name); ./lang/compiler_test.cpp: EXPECT_NO_THROW(stan::lang::compile(0, stan_lang_in, cpp_out, model_name, in_file_name)); ./lang/compiler_test.cpp: EXPECT_NO_THROW(stan::lang::compile(&out, stan_lang_in, cpp_out, model_name, in_file_name));

Doesn't seem to cover it?


Reply to this email directly or view it on GitHub: https://github.com/sakrejda/protostan/issues/9#issuecomment-168115700