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

fn_location_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: 8e060f108e638d15b06a1403e58026c118d348c9 (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_location_tests.cpp
 * \brief  Automated tests for the location() function.
 * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
 */

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


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

	TEST_FIXTURE(FxAccessor, Location_Error_OnNoActiveProject)
	{
		Script script = script_create();
		const char* result = script_run_string(script, "location()");
		CHECK_EQUAL("no active solution or project", result);
		script_destroy(script);
	}

	TEST_FIXTURE(FxAccessor, Location_CanRoundtrip)
	{
		const char* result = script_run_string(script,
			"location 'elsewhere';"
			"return location()");
		CHECK_EQUAL("elsewhere", result);
	}
}