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

fn_defines_tests.cpp « tests « script « src - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4d643ef06f4b6fe889803969b59ee605ff641c85 (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
/**
 * \file   fn_defines_tests.cpp
 * \brief  Automated tests for the defines() function.
 * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
 */

#include "premake.h"
#include "script_tests.h"


SUITE(script)
{
	TEST_FIXTURE(FxAccessor, Defines_Exists_OnStartup)
	{
		const char* result = script_run_string(script, 
			"return (defines ~= nil)");
		CHECK_EQUAL("true", result);
	}

	TEST_FIXTURE(FxAccessor, Defines_Error_OnNoActiveObject)
	{
		Script script = script_create();
		const char* result = script_run_string(script, "defines {'DEBUG'}");
		CHECK_EQUAL("no active configuration block", result);
		script_destroy(script);
	}

	TEST_FIXTURE(FxAccessor, Defines_CanRoundtrip)
	{
		const char* result = script_run_string(script,
			"defines {'DEBUG'};"
			"return defines()[1]");
		CHECK_EQUAL("DEBUG", result);
	}
}