diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-11-21 10:26:22 +1000 |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-11-21 04:26:55 +0100 |
commit | 1401e8a7a253c70ea05aebbd08e1a16457d052ef (patch) | |
tree | 342eeb8147e96c63650bbe480d3713d5a4045194 /t | |
parent | be10fdd251eae88c4b94b7045b2ccd677a97e2c9 (diff) |
test.pl: allow usage of ${foo} syntax for environment variables
Previously, $() and ${} were both for reading Pulse properties.
This meant that test.pl was able to write to both environment and
properties, but read only from properties.
Repurpose the ${} syntax to read from environment instead.
This enables us to build property values from system environment.
Change-Id: I7ac9c02a393bbe0400636e8cbc265dcd21b0b431
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Jyri Tahtela <jyri.tahtela@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 't')
9 files changed, 12 insertions, 6 deletions
diff --git a/t/01-test.t b/t/01-test.t index 89bc087a..38628bc2 100644 --- a/t/01-test.t +++ b/t/01-test.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 101; +use Test::More tests => 103; use FindBin; use File::Basename; use IO::Capture::Stdout; diff --git a/t/testdata/01_mixed_typical/projects/Mobility/stages/symbian-abld_3.1/properties/mobility.configure_args b/t/testdata/01_mixed_typical/projects/Mobility/stages/symbian-abld_3.1/properties/mobility.configure_args index 1bc258f6..a8664344 100644 --- a/t/testdata/01_mixed_typical/projects/Mobility/stages/symbian-abld_3.1/properties/mobility.configure_args +++ b/t/testdata/01_mixed_typical/projects/Mobility/stages/symbian-abld_3.1/properties/mobility.configure_args @@ -1 +1 @@ --prefix ${base.dir}\\_install -tests -examples -symbian-unfrozen +-prefix $(base.dir)\\_install -tests -examples -symbian-unfrozen diff --git a/t/testdata/02_property_substitution_simple/projects/testproject/stages/teststage/properties/using_property b/t/testdata/02_property_substitution_simple/projects/testproject/stages/teststage/properties/using_property index cec8b6f8..10e5c35e 100644 --- a/t/testdata/02_property_substitution_simple/projects/testproject/stages/teststage/properties/using_property +++ b/t/testdata/02_property_substitution_simple/projects/testproject/stages/teststage/properties/using_property @@ -1 +1 @@ -This property uses another property: "${source_property}" +This property uses another property: "$(source_property)" diff --git a/t/testdata/04_property_substitution_many/projects/testproject/stages/teststage/properties/00_references_bunch_of_stuff b/t/testdata/04_property_substitution_many/projects/testproject/stages/teststage/properties/00_references_bunch_of_stuff index 3a60b4db..cd6eafac 100644 --- a/t/testdata/04_property_substitution_many/projects/testproject/stages/teststage/properties/00_references_bunch_of_stuff +++ b/t/testdata/04_property_substitution_many/projects/testproject/stages/teststage/properties/00_references_bunch_of_stuff @@ -1 +1 @@ -all over the place: $(01) $(00) ${references_references_00_02_03} $(05) +all over the place: $(01) $(00) $(references_references_00_02_03) $(05) diff --git a/t/testdata/04_property_substitution_many/projects/testproject/stages/teststage/properties/references_references_00_02_03 b/t/testdata/04_property_substitution_many/projects/testproject/stages/teststage/properties/references_references_00_02_03 index 2c202cc0..80c7fbdd 100644 --- a/t/testdata/04_property_substitution_many/projects/testproject/stages/teststage/properties/references_references_00_02_03 +++ b/t/testdata/04_property_substitution_many/projects/testproject/stages/teststage/properties/references_references_00_02_03 @@ -1 +1 @@ -nested ${references_00_02} $(03) +nested $(references_00_02) $(03) diff --git a/t/testdata/05_property_substitution_escapecharacters/projects/testproject/stages/teststage/properties/property_containing_escape_characters_and_substitution b/t/testdata/05_property_substitution_escapecharacters/projects/testproject/stages/teststage/properties/property_containing_escape_characters_and_substitution index 54e7bbb5..110d7516 100644 --- a/t/testdata/05_property_substitution_escapecharacters/projects/testproject/stages/teststage/properties/property_containing_escape_characters_and_substitution +++ b/t/testdata/05_property_substitution_escapecharacters/projects/testproject/stages/teststage/properties/property_containing_escape_characters_and_substitution @@ -1 +1 @@ -here's a thing: $(source_property) and again: ${source_property} and backslash: \\ and dollar sign: \$ +here's a thing: $(source_property) and again: $(source_property) and backslash: \\ and dollar sign: \$ diff --git a/t/testdata/17_readenv/expected/projects/testproject/stages/teststage b/t/testdata/17_readenv/expected/projects/testproject/stages/teststage new file mode 100644 index 00000000..031d2641 --- /dev/null +++ b/t/testdata/17_readenv/expected/projects/testproject/stages/teststage @@ -0,0 +1,4 @@ +PULSE_BASE_DIR=BASE_DIR +QTQA_ENV_VS_PROP='env BASE_DIR should be same as prop BASE_DIR' +export PULSE_BASE_DIR QTQA_ENV_VS_PROP +testscript diff --git a/t/testdata/17_readenv/projects/testproject/script b/t/testdata/17_readenv/projects/testproject/script new file mode 100644 index 00000000..0fc57d42 --- /dev/null +++ b/t/testdata/17_readenv/projects/testproject/script @@ -0,0 +1 @@ +testscript diff --git a/t/testdata/17_readenv/projects/testproject/stages/teststage/properties/env_vs_prop b/t/testdata/17_readenv/projects/testproject/stages/teststage/properties/env_vs_prop new file mode 100644 index 00000000..481d8408 --- /dev/null +++ b/t/testdata/17_readenv/projects/testproject/stages/teststage/properties/env_vs_prop @@ -0,0 +1 @@ +env ${PULSE_BASE_DIR} should be same as prop $(base.dir) |