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

vs200x_xml_tests.cpp « tests « vs200x « action « src - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dfde57a72a2b2c735764d36e3b0e170343db9245 (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
/**
 * \file   vs200x_xml_tests.cpp
 * \brief  Automated tests for Visual Studio XML output functions.
 * \author Copyright (c) 2008 Jason Perkins and the Premake project
 */

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


SUITE(action)
{
	/**********************************************************************
	 * Element end tests
	 **********************************************************************/

	TEST_FIXTURE(FxAction, ElementEnd_SlashBracket_Vs2002)
	{
		session_set_action(sess, "vs2002");
		vs200x_element_end(sess, strm, 0, "/>");
		CHECK_EQUAL("/>\n", buffer);
	}

	TEST_FIXTURE(FxAction, ElementEnd_SlashBracket_Vs2003)
	{
		session_set_action(sess, "vs2003");
		vs200x_element_end(sess, strm, 0, "/>");
		CHECK_EQUAL("/>\n", buffer);
	}

	TEST_FIXTURE(FxAction, ElementEnd_SlashBracket_Vs2005)
	{
		session_set_action(sess, "vs2005");
		vs200x_element_end(sess, strm, 0, "/>");
		CHECK_EQUAL("\n/>\n", buffer);
	}

	TEST_FIXTURE(FxAction, ElementEnd_SlashBracket_Vs2008)
	{
		session_set_action(sess, "vs2008");
		vs200x_element_end(sess, strm, 0, "/>");
		CHECK_EQUAL("\n/>\n", buffer);
	}

	TEST_FIXTURE(FxAction, ElementEnd_Bracket_Vs2002)
	{
		session_set_action(sess, "vs2002");
		vs200x_element_end(sess, strm, 0, ">");
		CHECK_EQUAL(">\n", buffer);
	}

	TEST_FIXTURE(FxAction, ElementEnd_Bracket_Vs2003)
	{
		session_set_action(sess, "vs2003");
		vs200x_element_end(sess, strm, 0, ">");
		CHECK_EQUAL(">\n", buffer);
	}

	TEST_FIXTURE(FxAction, ElementEnd_Bracket_Vs2005)
	{
		session_set_action(sess, "vs2005");
		vs200x_element_end(sess, strm, 0, ">");
		CHECK_EQUAL("\n\t>\n", buffer);
	}

	TEST_FIXTURE(FxAction, ElementEnd_Bracket_Vs2008)
	{
		session_set_action(sess, "vs2008");
		vs200x_element_end(sess, strm, 0, ">");
		CHECK_EQUAL("\n\t>\n", buffer);
	}


	/**********************************************************************
	 * Attribute tests
	 **********************************************************************/

	TEST_FIXTURE(FxAction, Attribute_OnLevel0)
	{
		session_set_action(sess, "vs2002");
		vs200x_attribute(strm, 0, "ProjectType", "Visual C++");
		CHECK_EQUAL("\nProjectType=\"Visual C++\"", buffer);
	}

	TEST_FIXTURE(FxAction, Attribute_OnLevel3)
	{
		session_set_action(sess, "vs2002");
		vs200x_attribute(strm, 3, "ProjectType", "Visual C++");
		CHECK_EQUAL("\n\t\t\tProjectType=\"Visual C++\"", buffer);
	}
}