1##########################################################################
2# Copyright (c) 2011, ETH Zurich.
3# All rights reserved.
4#
5# This file is distributed under the terms in the attached LICENSE file.
6# If you do not find this file, copies can be found by writing to:
7# ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
8##########################################################################
9
10import re
11import tests
12from common import TestCommon
13from results import PassFailResult
14
15@tests.add_test
16class FpuTest(TestCommon):
17    '''FPU context switching'''
18    name = "fputest"
19
20    def get_modules(self, build, machine):
21        modules = super(FpuTest, self).get_modules(build, machine)
22        modules.add_module("fputest", ["test1" , "2"])
23        modules.add_module("fputest", ["test2" , "2"])
24        return modules
25
26    def get_finish_string(self):
27        return "fputest passed successfully!"
28
29    def process_data(self, testdir, rawiter):
30        # the test passed iff the last line is the finish string
31        lastline = ''
32        for line in rawiter:
33            lastline = line
34        passed = lastline.startswith(self.get_finish_string())
35        return PassFailResult(passed)
36