From 897b076960cb57b0811027ee641848d11ac30ed2 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Mon, 24 Aug 2015 16:04:23 -0400 Subject: [PATCH] tests: improve loader test with a more complex project1 directory Signed-off-by: Jean Privat --- tests/base_import.nit | 2 +- tests/project1/module1.nit | 14 ++++++++++++++ tests/project1/module2.nit | 14 ++++++++++++++ tests/project1/module3.nit | 15 +++++++++++++++ tests/project1/project1.nit | 14 ++++++++++++++ tests/project1/project2/foo.nit | 13 +++++++++++++ tests/project1/project2/project2.nit | 13 +++++++++++++ tests/project1/subdir/module4.nit | 15 +++++++++++++++ tests/sav/base_import_alt4.res | 1 + tests/sav/base_import_alt5.res | 1 + tests/sav/nitls_args1.res | 6 +++++- tests/sav/nitls_args2.res | 6 +++++- tests/sav/nitls_args3.res | 8 +++++++- tests/sav/nitls_args4.res | 3 +++ 14 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 tests/project1/module3.nit create mode 100644 tests/project1/project.ini create mode 100644 tests/project1/project2/foo.nit create mode 100644 tests/project1/project2/project.ini create mode 100644 tests/project1/project2/project2.nit create mode 100644 tests/project1/subdir/module4.nit create mode 100644 tests/sav/base_import_alt4.res create mode 100644 tests/sav/base_import_alt5.res diff --git a/tests/base_import.nit b/tests/base_import.nit index 7a057ab..8fb3e6c 100644 --- a/tests/base_import.nit +++ b/tests/base_import.nit @@ -1,3 +1,3 @@ -import project1 #alt1# import project1::module1 #alt2# import project1::module2 #alt3# import project1::fail +import project1 #alt1# import project1::module1 #alt2# import project1::module2 #alt3# import project1::fail #alt4# import project1::module4 #alt5# import project1::project2 foo diff --git a/tests/project1/module1.nit b/tests/project1/module1.nit index 576b35c..7f75de5 100644 --- a/tests/project1/module1.nit +++ b/tests/project1/module1.nit @@ -1,3 +1,17 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import kernel fun foo do 1.output diff --git a/tests/project1/module2.nit b/tests/project1/module2.nit index 4020f72..a7d5274 100644 --- a/tests/project1/module2.nit +++ b/tests/project1/module2.nit @@ -1,3 +1,17 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import project1 redef fun foo do 3.output diff --git a/tests/project1/module3.nit b/tests/project1/module3.nit new file mode 100644 index 0000000..e1509c9 --- /dev/null +++ b/tests/project1/module3.nit @@ -0,0 +1,15 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import module4 diff --git a/tests/project1/project.ini b/tests/project1/project.ini new file mode 100644 index 0000000..e69de29 diff --git a/tests/project1/project1.nit b/tests/project1/project1.nit index b70c23a..62a9576 100644 --- a/tests/project1/project1.nit +++ b/tests/project1/project1.nit @@ -1,3 +1,17 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import module1 redef fun foo do 2.output diff --git a/tests/project1/project2/foo.nit b/tests/project1/project2/foo.nit new file mode 100644 index 0000000..7058f2e --- /dev/null +++ b/tests/project1/project2/foo.nit @@ -0,0 +1,13 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tests/project1/project2/project.ini b/tests/project1/project2/project.ini new file mode 100644 index 0000000..e69de29 diff --git a/tests/project1/project2/project2.nit b/tests/project1/project2/project2.nit new file mode 100644 index 0000000..7058f2e --- /dev/null +++ b/tests/project1/project2/project2.nit @@ -0,0 +1,13 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tests/project1/subdir/module4.nit b/tests/project1/subdir/module4.nit new file mode 100644 index 0000000..ac6563a --- /dev/null +++ b/tests/project1/subdir/module4.nit @@ -0,0 +1,15 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import module1 diff --git a/tests/sav/base_import_alt4.res b/tests/sav/base_import_alt4.res new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/sav/base_import_alt4.res @@ -0,0 +1 @@ +1 diff --git a/tests/sav/base_import_alt5.res b/tests/sav/base_import_alt5.res new file mode 100644 index 0000000..7be428f --- /dev/null +++ b/tests/sav/base_import_alt5.res @@ -0,0 +1 @@ +alt/base_import_alt5.nit:1,8--25: Error: cannot find module `project2` from `project1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib. diff --git a/tests/sav/nitls_args1.res b/tests/sav/nitls_args1.res index accb0d6..b497cd5 100644 --- a/tests/sav/nitls_args1.res +++ b/tests/sav/nitls_args1.res @@ -2,4 +2,8 @@ project1 (project1) |--module1 (project1/module1.nit) |--module2 (project1/module2.nit) -`--project1 (project1/project1.nit) +|--module3 (project1/module3.nit) +|--project1 (project1/project1.nit) +`--subdir (project1/subdir) + `--module4 (project1/subdir/module4.nit) +project2 (project1/project2/project2.nit) diff --git a/tests/sav/nitls_args2.res b/tests/sav/nitls_args2.res index accb0d6..b497cd5 100644 --- a/tests/sav/nitls_args2.res +++ b/tests/sav/nitls_args2.res @@ -2,4 +2,8 @@ project1 (project1) |--module1 (project1/module1.nit) |--module2 (project1/module2.nit) -`--project1 (project1/project1.nit) +|--module3 (project1/module3.nit) +|--project1 (project1/project1.nit) +`--subdir (project1/subdir) + `--module4 (project1/subdir/module4.nit) +project2 (project1/project2/project2.nit) diff --git a/tests/sav/nitls_args3.res b/tests/sav/nitls_args3.res index accb0d6..52b93a0 100644 --- a/tests/sav/nitls_args3.res +++ b/tests/sav/nitls_args3.res @@ -2,4 +2,10 @@ project1 (project1) |--module1 (project1/module1.nit) |--module2 (project1/module2.nit) -`--project1 (project1/project1.nit) +|--module3 (project1/module3.nit) +|--project1 (project1/project1.nit) +`--subdir (project1/subdir) + `--module4 (project1/subdir/module4.nit) +project2 (project1/project2) +|--foo (project1/project2/foo.nit) +`--project2 (project1/project2/project2.nit) diff --git a/tests/sav/nitls_args4.res b/tests/sav/nitls_args4.res index f54c342..eeed2c7 100644 --- a/tests/sav/nitls_args4.res +++ b/tests/sav/nitls_args4.res @@ -1,4 +1,7 @@ base_simple3/base_simple3 (base_simple3.nit) project1/module1 (project1/module1.nit) project1/module2 (project1/module2.nit) +project1/module3 (project1/module3.nit) +project1/subdir/module4 (project1/subdir/module4.nit) project1/project1 (project1/project1.nit) +project2/project2 (project1/project2/project2.nit) -- 1.7.9.5