
#import "DeveloperBench.h"
#define CFILE "BusyBox.tar.Z"


@implementation DeveloperBench

-(BOOL)canRunBenchmark
{
	if(access("/bin/cc",F_OK)){
		[speedCell setStringValue:"NOT INSTALLED"];
		return NO;
	}
	return YES;
}

- setupBenchmark
{
	system("/bin/rm -rf /tmp/BusyBox");
	return self;
}

- benchmark
{
	char	buf[256];
	char	dir[256];

	[[NXBundle mainBundle] getPath:dir forResource:CFILE ofType:0];
	sprintf(buf,"zcat %s | (cd /tmp;tar xf -)",dir);
	system(buf);
	system("(cd /tmp/BusyBox;make app)");
	return self;
}

- shutdownBenchmark
{
	char	buf[256];
	[speedCell setDoubleValue:wallTime];
	sprintf(buf,"Compile: %g",wallTime);
	[self	logResults:buf];
	return self;
}	

@end
