1#----------------------------------------------------------------------------
2# Project:  Horizon
3# File:     CTR.commondefs.test.om
4#
5# Copyright (C)2009-2011 Nintendo Co., Ltd.  All rights reserved.
6#
7# These coded instructions, statements, and computer programs contain
8# proprietary information of Nintendo of America Inc. and/or Nintendo
9# Company Ltd., and are protected by Federal copyright law. They may
10# not be disclosed to third parties or copied or duplicated in any form,
11# in whole or in part, without the prior written consent of Nintendo.
12#
13# $Rev: 34692 $
14#----------------------------------------------------------------------------
15
16
17#======================================================================
18#
19# Test summary output
20#
21#======================================================================
22private.TEST_TARGETS    = $(filter dotests-%,$(TARGETS))
23private.TEST_SUMMAY     = $(ROOT_IMAGES)/tests/nnTest-Report.txt
24private.SUMMARY_TEST    = $(absname $(ROOT_TOOLS)$(DIRSEP)_private$(DIRSEP)TestReport.py)
25
26#-------------------------------------------------------
27# GetTestLogFiles
28#
29# Overview
30#   Get all log files of executed tests.
31#
32# Global variable that is referenced
33#   None.
34#-------------------------------------------------------
35GetTestLogFiles(targets) =
36    ret[] =
37    foreach(target, $(targets))
38        if $(filter dotests%, $(basename $(target.target)))
39            ret += $(file $(filter %.log, $(target.build-deps)))
40            export
41        export
42    return $(ret)
43
44#-------------------------------------------------------
45# AddRulesToOutputTestSummary
46#
47# Overview
48#   The rule to output the summary of the results of the executed test is created in .BUILD_SUCCESS.
49#
50#
51# Referenced variable
52#   SUMMARY_TEST TEST_SUMMAY
53#-------------------------------------------------------
54AddRulesToOutputTestSummary() =
55    if $(file-exists $(SUMMARY_TEST))
56        .BUILD_SUCCESS: $(makeDirectory $(dirname $(TEST_SUMMAY)))
57            python $(SUMMARY_TEST) $(GetTestLogFiles $(find-build-targets Succeeded)) > $(TEST_SUMMAY) || true
58            cat $(TEST_SUMMAY)
59
60#======================================================================
61#
62# Root definition
63#
64#======================================================================
65
66# Add summary output rule only when dotests series is targeted.
67if $(and $(not $(isEmpty $(filter dotests-%,$(TARGETS)))), \
68         $(not $(and $(defined SKIP_RUN), $(SKIP_RUN))))
69    AddRulesToOutputTestSummary()
70