[misc] Improved temporary directory selecting in BOQA.
Issue #1333: Add tests for BOQA.