Editing Wiki

15 views
Skip to first unread message

Krzysztof Sakrejda

unread,
Apr 4, 2015, 1:29:22 AM4/4/15
to stan...@googlegroups.com
I ran 'grep' on the Stan unit tests looking for EXPECT_ and ASSERT_ an put together a short list of commonly used tests with links to the GoogleTest doc so it's less bewildering for someone who needs to write tests. I was going to put this into the Stan Wiki on using GoogleTest. but I think I don't have permission to edit the wiki.

#### Common test types:

The documentation (above) is excellent so check there for details but here is a directory of commonly used test types in Stan:

* [EXPECT/ASSERT](https://code.google.com/p/googletest/wiki/Primer#Assertions) EXPECT records the result but allows further tests in the same function, ASSERT exits the current function without cleanup. Stan unit tests use both forms.
* [EXPECT_TRUE](https://code.google.com/p/googletest/wiki/Primer#Basic_Assertions) EXPECT_TRUE/FALSE test that the condition is TRUE/FALSE.
* [EXPECT_EQ](https://code.google.com/p/googletest/wiki/Primer#Binary_Comparison) Tests that a calculated value equals (==) an expected result exactly, not appropriate for floating point comparison.
* [EXPECT_FLOAT_EQ](https://code.google.com/p/googletest/wiki/AdvancedGuide#Floating-Point_Comparison) Tests that a floating point calculation results to known output values.
* [EXPECT_NEAR](https://code.google.com/p/googletest/wiki/AdvancedGuide#Floating-Point_Macros) Like EXPECT_FLOAT_EQ but a third argument sets the threshold used.
* [ASSERT_THROW](https://code.google.com/p/googletest/wiki/AdvancedGuide#Exception_Assertions) Tests that a specific exception type is thrown.
* [ASSERT_NO_THROW](https://code.google.com/p/googletest/wiki/AdvancedGuide#Exception_Assertions) Tests that the statement does not throw. Some parts of the code are not supposed to throw... not sure which.

Bob Carpenter

unread,
Apr 4, 2015, 1:43:39 AM4/4/15
to stan...@googlegroups.com
You should be able to edit the wiki because we gave you write
permission on the repos. You need to be logged into GitHub.

You could also just point to the googletest docs, which have
a longer list. But a short list would probably be helpful, too.
Just be sure to stress that it's not exhaustive.

- Bob
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Krzysztof Sakrejda

unread,
Apr 4, 2015, 2:03:21 AM4/4/15
to stan...@googlegroups.com
On Saturday, April 4, 2015 at 1:43:39 AM UTC-4, Bob Carpenter wrote:
> You should be able to edit the wiki because we gave you write
> permission on the repos. You need to be logged into GitHub.

Nope, the button is missing, I logged out and in.

>
> You could also just point to the googletest docs, which have
> a longer list. But a short list would probably be helpful, too.
> Just be sure to stress that it's not exhaustive.

Will do (if I ever figure out where that button is) I just want to give the narrow view first.

Krzysztof

>
> - Bob

Bob Carpenter

unread,
Apr 4, 2015, 2:17:39 AM4/4/15
to stan...@googlegroups.com
I don't know how you're sending mail or pushing, because I invited
you, but it looks like you never accepted.

I just issued another invitation which will give you push permission on
all the repos. After you accept, you should be able to edit the wikis.

Sorry for the hassle and thanks for taking time to update the wikis!

- Bob

Krzysztof Sakrejda

unread,
Apr 4, 2015, 2:23:41 AM4/4/15
to stan...@googlegroups.com
Hey I got the button now, thanks! Krzysztof

On Saturday, April 4, 2015 at 2:17:39 AM UTC-4, Bob Carpenter wrote:
> I don't know how you're sending mail or pushing, because I invited
> you, but it looks like you never accepted.
>
> I just issued another invitation which will give you push permission on
> all the repos. After you accept, you should be able to edit the wikis.
>
> Sorry for the hassle and thanks for taking time to update the wikis!
>
> - Bob
>
Reply all
Reply to author
Forward
0 new messages