Unit Testing Framework maxtest

53 views
Skip to first unread message

Pixelbaker

unread,
Nov 20, 2011, 2:31:40 PM11/20/11
to 3ds-max-d...@googlegroups.com
Hi everyone.

I am the new guy, a pipeline developer working for a german feature film company.
Currently I am looking for a place to host my personal project called maxtest.
I was about to create a project/repo on SourceForge/GitHub, but then remembered this group.

Backing up my code with unit tests gets more and more important to me.
Roughly six weeks ago, I started developing a unit testing framework for MAXScript.
It is inspired by cppunit and Pythons unittest framework.
I am using it daily, it currently runs over 150 tests, growing. 
Using it on a daily basis, gives me confidence to make it available to a wider audience.

Features:
  • discovers tests
  • distinguishes between error, failed and passed tests
  • reports filepath & line number of a failed test
  • supports test suites with setUp and tearDown
  • comprehensive test results outputted to the listener
  • current asserts are: equals, notEquals, assertTrue, assertFalse, raises, notRaises
It is written for Max2011 and doesn't support the new Assert methods of Max2012.

My goal is to maintain and add features to the framework and collaborate with the community, while the code is hosted here.
I believe this project is beneficial for the MAXScript community as it promotes clean coding.

If an interest exist for this project, I am happy to post the files.
But ultimately I am aiming for commit rights myself.

Greets,
Pixelbaker

Christopher Diggins

unread,
Nov 24, 2011, 2:11:28 PM11/24/11
to 3ds-max-d...@googlegroups.com
Welcome Mr. Pixel Baker, :-)

Sounds great. I'm happy to give you commit privileges. You will just need a Google account. Please send me your Google account mail address and I'll add you to the list of committers. Thanks a lot for your participation!

Christopher Diggins

Pixelbaker

unread,
Jan 1, 2012, 9:08:42 AM1/1/12
to 3ds-max-d...@googlegroups.com
Happy New Year!

I uploaded maxtest just now. 

Sorry for keeping you waiting. 
A month back, I tried starting another discussion concerning our SVN structure.
I am still waiting for the approval. The post isn't showing up in the discussion list.
I wrote Christopher but didn't get a reply yet.
Maybe approval privileges for new discussions should be split among members.

I wanted to wait for the outcome of the SVN structure discussion before committing maxtest.
I decided to do the commit nevertheless.

Try the example.ms file, it will run the test inside test_example.ms
Documentation and more examples are coming soon.
I am currently using the framework at work. It runs over 500 tests.

Greets,
Pixelbaker

Jason Brackman

unread,
Mar 15, 2013, 7:51:00 PM3/15/13
to 3ds-max-d...@googlegroups.com
Hey Pixelbaker --

Not sure if you are still working on this -- I just tested it out and its pretty cool.  Gave me lots to think about.  Really like the output window. :)

There is a small issue with the code syntax (at least on Max 2012) ... looks like the fstream is created with an "r" tag -- but it needs an "rb"
- line 209 of finder.ms

J.

"André Schaarschmidt (PixelBaker.com)"

unread,
Mar 18, 2013, 6:23:05 AM3/18/13
to 3ds-max-d...@googlegroups.com
Hi Jason.

First of all, great to finally have another user beside myself. :)
Thanks for forwarding your bug report to me.
I am still maintaining it, so you are at the right place.

Currently I don't have Max installed. I am a bit worried that the "rb" flag breaks backward compatibility with Max 2011 files.
I thoroughly used it in conjunction with Max 2011, so that's why I probably didn't encounter the bug myself.
At that point of time I don't have Max installed for testing.
This will change in the next weeks at I promise to test and fix this bug.

Which output window do you mean? The interactive listener?
Did you just tested maxtest or do you use it in production as well?

Greets,
André


--
You received this message because you are subscribed to the Google Groups "3ds Max Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 3ds-max-dev-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jason Brackman

unread,
Mar 18, 2013, 11:44:45 AM3/18/13
to 3ds-max-d...@googlegroups.com
I don't currently have max2011 to confirm your guess -- but I would imagine you're correct.  Unicode was a big push in many software packages over the past few years and it is likely that the 'rb' flag is related to that change.

The output window I was referring too was the 'interactive" results window.

I have only just begun to really test your framework.  I work with three other Technical Artists, but I'm the only one who is mostly scripting and work almost exclusively on pipelines.  Others work on rigging, wrangling of assets, or very high level architectural choices.  I'm doing an overhaul on our core maxscript library -- providing more consistent documentation (decided to use something Rob Galanakis has used on his forum posts when discussing his code) and would like to introduce unit testing. 

When looking for examples your post came up in my Google search and I figured your unit test rig would be a good way to enforce some consistency in expectation.  I would LOVE to have it run in production, but it will likely be something I will have to play with for awhile before enforcing this as something all TAs will have to follow. 

My first thought is that the doc string should be parsed and used for the test, but I realize that the setup and breakdown of the test could be very complicated.  Currently I need to generate the geometry for a test case, etc... then run the function, then break down the info to allow the next test a clean run.   I noticed that you have a setup/teardown section for the framework -- but I wasn't quite sure what to do with those aspects yet.

I've found some other minor bugs in the results interpreter -- reloading one selected test often doesn't reorder properly -- if I go too much more into this I'll be able to properly define the bug and if I have a fix will send it.

Long story short -- haven't used unit testing before -- hoping your work will help me to ease into it -- as I would like to have a greater level of confidence that the scripts won't break as I push the code out to the users.

Jason


--
You received this message because you are subscribed to a topic in the Google Groups "3ds Max Developer Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/3ds-max-dev-discuss/KGFKEP-xzSQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to 3ds-max-dev-dis...@googlegroups.com.

Jason Brackman

unread,
Mar 18, 2013, 7:05:28 PM3/18/13
to 3ds-max-d...@googlegroups.com
Also -- :) -- just realized -- 'rt' is what I should have wrote in the original post -- not 'rb' -- its read only text not binary -- ...
Reply all
Reply to author
Forward
0 new messages