Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Unit testing using imported data

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124190] Re: Unit testing using imported data
  • From: A Retey <awnl at gmx-topmail.de>
  • Date: Thu, 12 Jan 2012 04:19:41 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jeh5op$r66$1@smc.vnet.net> <jejki2$b9t$1@smc.vnet.net>

Hi,

>> I want to setup a unit test for functions I have made. The
>> functions perform computation on imported data. The data are HDF
>> files. How can I setup the unit test so that the data gets imported
>> for use in a unit test? The imported data is the input for the
>> function.

AFAIK you can use any kind of code within a Unit test file. Typically 
you will do some initialization like loading packages before the actual 
Test[]s. I don't see why you would have problems to import your data 
there or even within a Test-Definition. Are you encountering problems 
when doing so?

> I should add that I want to use the built in .mt file in Wolfram
> Workbench. The Mathematica front end is not used. The help content
> in Workbench doesn't have any information on importing when using the
> .mt test files.

If you start the tests from Workbench there is by default no FrontEnd 
started and at least some of the functionality needs it, although I'm 
not sure whether the HDF Import will need it. But if that is your 
problem you probably only need to wrap the Import with an UseFrontEnd to 
get things running. I think you probably will need to provide more 
details if you want to get more specific suggestions...

hth,

albert





  • Prev by Date: Re: take square of the second and third column of a table
  • Next by Date: Re: select 1st column element based on criteria in 2nd column in mathematica
  • Previous by thread: Re: Unit testing using imported data
  • Next by thread: Group Disclosure Triangle Lost When Saving to CDF