1echo off
2:: ###############################################################################
3:: #
4:: # Copyright (C) 2009-2013 Nintendo.  All rights reserved.
5:: #
6:: # These coded instructions, statements, and computer programs contain
7:: # proprietary information of Nintendo of America Inc. and/or Nintendo
8:: # Company Ltd., and are protected by Federal copyright law.  They may
9:: # not be disclosed to third parties or copied or duplicated in any form,
10:: # in whole or in part, without the prior written consent of Nintendo.
11:: #
12:: ###############################################################################
13
14::Insert code to delete all files except for the .rpx and .rpl
15
16::
17if not exist %CAFE_ROOT%\masteringtemp (
18	mkdir %CAFE_ROOT%\masteringtemp
19)
20if not exist %CAFE_ROOT%\mstrtestlogs (
21	mkdir %CAFE_ROOT%\mstrtestlogs
22)
23
24set MSTR_LOGDIR=%CAFE_ROOT%\mstrtestlogs
25set TEST_RPX_DIR=%CAFE_ROOT%\system\bin\ghs\cafe\demo\gx2\garden\motionBlur\DEBUG
26set TEST_RPX=motionBlur
27
28@echo on
29::Create default app, cos, and meta.xml files
30cafex run -b %TEST_RPX_DIR%\%TEST_RPX%.rpx
31cafex stop
32::
33echo off
34
35::Test1 - Basic mastering test- Provide all paths
36@echo makemaster with -r -o and -w arguments
37@echo *#*#*#*#*#*# TEST 1 BEGIN #*#*#*#*#*#*
38cafex makemaster -r %TEST_RPX_DIR%\%TEST_RPX%.rpx -o %CAFE_ROOT%\motionBlur_CafeX_DEBUG -w %CAFE_ROOT%\masteringtemp > %MSTR_LOGDIR%\Test1_log.txt
39if exist %CAFE_ROOT%\motionBlur_CafeX_DEBUG.wumad (
40	%CAFE_ROOT%\system\bin\tool\mastering\comparewumad.exe motionBlur_CafeX_DEBUG.wumad motionBlur_Script_DEBUG.wumad > %MSTR_LOGDIR%\Test1_cmp.txt
41) else (
42	@echo Mastering process did not generate a wumad!  See %MSTR_LOGDIR%\Test1_log.txt for details.
43	@echo *#*#*#*#*#*# TEST 1 FAIL  #*#*#*#*#*#*
44)
45@echo *#*#*#*#*#*# TEST 1 END   #*#*#*#*#*#*
46@echo .
47
48::Test2 - Basic mastering test- Provide no paths
49@echo makemaster with no arguments
50@echo *#*#*#*#*#*# TEST 2 BEGIN #*#*#*#*#*#*
51cafex makemaster > %MSTR_LOGDIR%\Test2_log.txt
52if exist %TEST_RPX_DIR%\%TEST_RPX%.wumad (
53	%CAFE_ROOT%\system\bin\tool\mastering\comparewumad.exe %TEST_RPX_DIR%\motionBlur.wumad %CAFE_ROOT%\motionBlur_Script_DEBUG.wumad > %MSTR_LOGDIR%\Test2_cmp.txt
54) else (
55	@echo Mastering process did not generate a wumad!  See %MSTR_LOGDIR%\Test2_log.txt for details.
56	@echo *#*#*#*#*#*# TEST 2 FAIL  #*#*#*#*#*#*
57)
58@echo *#*#*#*#*#*# TEST 2 END   #*#*#*#*#*#*
59@echo .
60
61::Test3 - Add system partition
62@echo makemaster with system update partition
63@echo *#*#*#*#*#*# TEST 3 BEGIN #*#*#*#*#*#*
64cafex makemaster -u -o %CAFE_ROOT%\motionBlur_CafeX_D_Part > %MSTR_LOGDIR%\Test3_log.txt
65if exist %CAFE_ROOT%\motionBlur_CafeX_D_Part.wumad (
66	%CAFE_ROOT%\system\bin\tool\mastering\comparewumad.exe %CAFE_ROOT%\motionBlur_CafeX_D_Part.wumad %CAFE_ROOT%\motionBlur_Script_DEBUG_Part.wumad > %MSTR_LOGDIR%\Test3_cmp.txt
67) else (
68	@echo Mastering process did not generate a wumad!  See %MSTR_LOGDIR%\Test3_log.txt for details.
69	@echo *#*#*#*#*#*# TEST 3 FAIL  #*#*#*#*#*#*
70)
71@echo *#*#*#*#*#*# TEST 3 END   #*#*#*#*#*#*
72@echo .
73
74::Test4 - Create patch
75@echo *#*#*#*#*#*# TEST 4 BEGIN #*#*#*#*#*#*
76cafex makemaster -o %CAFE_ROOT%\helloworldv2_CafeX -p %CAFE_ROOT%\helloworldv1.wumad -r %CAFE_ROOT%\system\bin\ghs\cafe\demo\helloworld\DEBUG\helloworld.rpx > %MSTR_LOGDIR%\Test4_log.txt
77if exist %CAFE_ROOT%\helloworldv2_CafeX.wumad (
78	%CAFE_ROOT%\system\bin\tool\mastering\comparewumad.exe %CAFE_ROOT%\helloworldv2_CafeX.wumad %CAFE_ROOT%\helloworldv2.wumad > %MSTR_LOGDIR%\Test4_cmp.txt
79) else (
80	@echo Mastering process did not generate a wumad!  See %MSTR_LOGDIR%\Test4_log.txt for details.
81	@echo *#*#*#*#*#*# TEST 4 FAIL  #*#*#*#*#*#*
82	goto EndTest4
83)
84::Check for .diff existence
85if exist %CAFE_ROOT%\helloworldv2_CafeX.diff (
86	@echo Diff the .diffs here!
87) else (
88	@echo Mastering process did not generate a diff file!  See %MSTR_LOGDIR%\Test4_log.txt for details.
89	@echo *#*#*#*#*#*# TEST 4 FAIL  #*#*#*#*#*#*
90)
91:EndTest4
92@echo *#*#*#*#*#*# TEST 4 END   #*#*#*#*#*#*
93@echo .
94
95::Test5 - Create AOC
96@echo Test AOC creation w/ makeaoc command
97@echo *#*#*#*#*#*# TEST 5 BEGIN #*#*#*#*#*#*
98set OLD_CAFE_CONTENT_DIR=%CAFE_CONTENT_DIR%
99set OLD_CAFE_CODE_DIR=%CAFE_CODE_DIR%
100set CAFE_CODE_DIR=%CAFE_ROOT%\AOCTutorial\code
101set CAFE_CONTENT_DIR=%CAFE_ROOT%\AOCTutorial\content
102
103cafex makeaoc %CAFE_ROOT%\AOCTutorial\AOC1\ AOC1CafeX > %MSTR_LOGDIR%\Test5_log.txt
104if exist %CAFE_ROOT%\AOCTutorial\AOC1\outdir\AOC1CafeX.wumad (
105	comparewumad.exe %CAFE_ROOT%\AOCTutorial\AOC1\outdir\AOC1CafeX.wumad %CAFE_ROOT%\AOC1Script.wumad > %MSTR_LOGDIR%\Test5_cmp.txt
106) else (
107	@echo Mastering process did not generate a wumad!  See %MSTR_LOGDIR%\Test5_log.txt for details.
108	@echo *#*#*#*#*#*# TEST 5 FAIL  #*#*#*#*#*#*
109)
110@echo *#*#*#*#*#*# TEST 5 END   #*#*#*#*#*#*
111set CAFE_CODE_DIR=%OLD_CAFE_CODE_DIR%
112set CAFE_CONTENT_DIR=%OLD_CAFE_CONTENT_DIR%
113@echo .
114
115@echo Test the help message
116@echo *#*#*#*#*#*# HELP MESSAGE #*#*#*#*#*#*
117::Last test - help message
118cafex makemaster -h
119@echo *#*#*#*#*#*# HELP MSG END #*#*#*#*#*#*
120
121@echo -*-*-*-*-*-* ALL TESTS COMPLETE *-*-*-*-*-*-