aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_compiler_SUITE.erl
AgeCommit message (Collapse)Author
2015-06-18Change license text to APLv2Bruce Yinhe
2014-05-29Add @codecs and @custom_types tests to compiler suiteAnders Svensson
Dictionary compilation fails to detect undefined AVPs in these sections.
2014-03-21Adapt dictionary compilation to new default encodingAnders Svensson
The problem is that the change in default encoding to utf8 in 17.0, in commit 00e42967, changes the behaviour of erl_parse:abstract/1, which is used by the dictionary compiler to turn terms into abstract code. In particular, it transforms the orddict representation of a parsed dictionary to contruct the return value of a dictionary module's dict/0 function. This orddict contains various lists, one of which is a list of tuples of the form {Name, Code, [VendorId], [Avp]} where Name is an ASCII string and VendorId is a non-negative integer. Using erl_parse:abstract/2 instead allows a string encoding to be specified but regardless of what encoding is used, the result of transforming our tuple might not be what we really want, which is for Name to always be represented as a string form and [VendorId] to always be represented as a cons form: the [VendorId] will always end up as a string form if the integers are small enough. The only way around this is to transform the tuple bit by bit, but modifying the code to do this is quite a lot of work, for not much gain: it would be nice to produce more readable output but nothing stops working without it. This commit restores the pre-17.0 conversion by explicilty specifying latin1 as the string encoding to erl_parse:abstract/2. The utf8 encoding broke the compilation of some dictionares since unicode strings aren't expected when writing the generated code to file. Note that the latin1 encoding does reasonably well in practice, although it mangles the Ericsson Vendor Id list [193] into a "LATIN CAPITAL LETTER A WITH ACUTE". The utf8 encoding does worse, mangling the 3GPP Vendor Id 10415 into "DESERET CAPITAL LETTER CHEE". An ascii encoding would do better than latin1 but doesn't yet exist. (Encoding isn't really what the option is. It's a string predicate: if the predicate is true then represent as a string form, otherwise a cons form.)
2014-01-16Ensure that Grouped AVP's are fully defined in dictionariesAnders Svensson
The case in which an AVP was defined as having type Grouped in @avp_types without a corresponding specification in @grouped was missing.
2014-01-16Don't format diameter_make:codec/2 errorsAnders Svensson
Instead, add diameter_make:format_error/1 to allow the caller to format if desired, which is what applications like compiler and yecc do. Use this to check that the expected error is the one actually generated in the compiler suite.
2014-01-16Compiler suite fixAnders Svensson
An error when expecting success wasn't regarded as failure when compiling dictionaries.
2013-12-01Return compilable forms instead of beamAnders Svensson
That is, preprocessed forms that can be passed to compile:forms/1,2.
2013-12-01Fix diameter_make:flatten/1Anders Svensson
To set @avp_vendor_id, @codecs and @custom_types as required for imported avps.
2013-12-01Simplify and extend diameter_make interfaceAnders Svensson
In particular, make codec/2 flexible as to what's generated, the formats (erl, hrl, parse, forms and beam) being passed in the options list and defaulting to [erl, hrl]. The 'parse' format is the internal format to which dictionaries are parsed, which can be manipulated by flatten/1 before being passed back to codec/2 or format/1. Remove the (undocumented) dict/1,2 since codec/2 now subsumes it with the 'parse' option.
2013-11-28Adapt compiler suite to diameter_makeAnders Svensson
It was originally written before this interface existed.
2013-11-28Remove last remnants of "spec"Anders Svensson
2013-03-24Move example dict compilation to examples suiteAnders Svensson
From compiler suite.
2012-11-19Minor test suite tweaksAnders Svensson
2012-08-26Lighten up on timetraps in test suitesAnders Svensson
Some look to be optimistic when running in slow virtual environments. (With bad time keeping?)
2011-12-16Move example dictionaries to examples/dictAnders Svensson
2011-12-16Set name/prefix at compilation, not in dictionariesAnders Svensson
To avoid inappropriate defaults if the dictionaries are reused.
2011-12-16Add RFC 4004 (MIP) dictionaryAnders Svensson
2011-12-16Add RFC 4740 (SIP) dictionaryAnders Svensson
2011-12-16Add RFC 4072 (EAP) dictionaryAnders Svensson
2011-12-16Add RFC 4006 (CC) dictionaryAnders Svensson
2011-12-16Add RFC 4005 (NAS) dictionaryAnders Svensson
2011-12-16Add standards testcase to compiler suiteAnders Svensson
To test compilation of example dictionaries from various standards.
2011-12-16Increase timetrap in compiler suiteAnders Svensson
Compilation is slow on Solaris for one.
2011-12-08Add compiler testcases for generation and compilation to beamAnders Svensson
2011-12-08Fix semantic checks on AVP qualifiersAnders Svensson
Didn't quite interpret '*' as RFC 3588 dictates. In particular, the interpretation depends on what's being qualified, a required, optional or fixed AVP.
2011-12-05Fix interpretation of vendor id in @groupedAnders Svensson
A value is required to be the same as any specified with @avp_vendor_id but otherwise the two locations are equivalent. Both possibilities are allowed since @avp_vendor_id is required for AVPs of types other than Grouped (modulo it not really needing to exist at all: see commit 943266c9) and since the grammar parsed in @grouped (from RFC 3588) allows it.
2011-12-05Add range checks on dictionary integersAnders Svensson
Check that values that should be Unsigned32 actually are.
2011-12-04Don't explicitly load inherited modulesAnders Svensson
Just use include options to add to the code path and expect that dependent modules will either already have been loaded or will be loaded dynamically, thereby avoiding having a module being left as both current and old code when compiling concurrently. Not a problem for a human user interactively compiling one module at a time but the compiler test suite for one will compile concurrently. In any case, leaving behind old code is probably not what someone would expect while relying on the code path probably is.
2011-12-04Add format testcase to compiler suiteAnders Svensson
Plus additional parsing tests.
2011-12-02Add compiler suiteAnders Svensson