Welcome to mirror list, hosted at ThFree Co, Russian Federation.

vs200x_compiler_tests.cpp « tests « vs200x « actions « src - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 167ad3084aa35a093aef2261ba5840d7e7aa8f85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**
 * \file   vs200x_compiler_tests.cpp
 * \brief  Automated tests for VS200x compiler block processing.
 * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
 */

#include "premake.h"
#include "actions/tests/action_tests.h"
extern "C" {
#include "actions/vs200x/vs200x_project.h"
}

SUITE(action)
{
	/**********************************************************************
	 * Default settings
	 **********************************************************************/

	TEST_FIXTURE(FxAction, VCCLCompilerTool_Defaults_OnVs2002)
	{
		session_set_action(sess, "vs2002");
		vs200x_project_vc_cl_compiler_tool(sess, prj, strm);
		CHECK_EQUAL(
			"\t\t\t<Tool\n"
			"\t\t\t\tName=\"VCCLCompilerTool\"\n"
			"\t\t\t\tOptimization=\"0\"\n"
			"\t\t\t\tMinimalRebuild=\"TRUE\"\n"
			"\t\t\t\tBasicRuntimeChecks=\"3\"\n"
			"\t\t\t\tRuntimeLibrary=\"3\"\n"
			"\t\t\t\tRuntimeTypeInfo=\"TRUE\"\n"
			"\t\t\t\tUsePrecompiledHeader=\"2\"\n"
			"\t\t\t\tWarningLevel=\"3\"\n"
			"\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n"
			"\t\t\t\tDebugInformationFormat=\"4\"/>\n",
			buffer);
	}

	TEST_FIXTURE(FxAction, VCCLCompilerTool_Defaults_OnVs2005)
	{
		session_set_action(sess, "vs2005");
		vs200x_project_vc_cl_compiler_tool(sess, prj, strm);
		CHECK_EQUAL(
			"\t\t\t<Tool\n"
			"\t\t\t\tName=\"VCCLCompilerTool\"\n"
			"\t\t\t\tOptimization=\"0\"\n"
			"\t\t\t\tMinimalRebuild=\"true\"\n"
			"\t\t\t\tBasicRuntimeChecks=\"3\"\n"
			"\t\t\t\tRuntimeLibrary=\"3\"\n"
			"\t\t\t\tUsePrecompiledHeader=\"0\"\n"
			"\t\t\t\tWarningLevel=\"3\"\n"
			"\t\t\t\tDetect64BitPortabilityProblems=\"true\"\n"
			"\t\t\t\tDebugInformationFormat=\"4\"\n"
			"\t\t\t/>\n",
			buffer);
	}

	TEST_FIXTURE(FxAction, VCCLCompilerTool_Defaults_OnVs2008)
	{
		session_set_action(sess, "vs2008");
		vs200x_project_vc_cl_compiler_tool(sess, prj, strm);
		CHECK_EQUAL(
			"\t\t\t<Tool\n"
			"\t\t\t\tName=\"VCCLCompilerTool\"\n"
			"\t\t\t\tOptimization=\"0\"\n"
			"\t\t\t\tMinimalRebuild=\"true\"\n"
			"\t\t\t\tBasicRuntimeChecks=\"3\"\n"
			"\t\t\t\tRuntimeLibrary=\"3\"\n"
			"\t\t\t\tUsePrecompiledHeader=\"0\"\n"
			"\t\t\t\tWarningLevel=\"3\"\n"
			"\t\t\t\tDebugInformationFormat=\"4\"\n"
			"\t\t\t/>\n",
			buffer);
	}



	/**********************************************************************
	 * Defines tests
	 **********************************************************************/

	TEST_FIXTURE(FxAction, VCCLCompilerTool_WithDefines)
	{
		session_set_action(sess, "vs2002");
		char* defines[] = { "DEFINE0", "DEFINE1", NULL };
		SetConfigField(prj, BlockDefines, defines);
		vs200x_project_vc_cl_compiler_tool(sess, prj, strm);
		CHECK_EQUAL(
			"\t\t\t<Tool\n"
			"\t\t\t\tName=\"VCCLCompilerTool\"\n"
			"\t\t\t\tOptimization=\"0\"\n"
			"\t\t\t\tPreprocessorDefinitions=\"DEFINE0;DEFINE1\"\n"
			"\t\t\t\tMinimalRebuild=\"TRUE\"\n"
			"\t\t\t\tBasicRuntimeChecks=\"3\"\n"
			"\t\t\t\tRuntimeLibrary=\"3\"\n"
			"\t\t\t\tRuntimeTypeInfo=\"TRUE\"\n"
			"\t\t\t\tUsePrecompiledHeader=\"2\"\n"
			"\t\t\t\tWarningLevel=\"3\"\n"
			"\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n"
			"\t\t\t\tDebugInformationFormat=\"4\"/>\n",
			buffer);
	}
}