diff options
author | Marek Safar <marek.safar@gmail.com> | 2018-10-05 15:42:44 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-10-08 11:03:28 +0300 |
commit | 539b14892000f3c4b13657161819680dd9aa098c (patch) | |
tree | ee898c3758bd16034ab0705841632575d7a6de96 | |
parent | e64d8aaa721e0ca0c4c51c63063882aaaf20020c (diff) |
[linker] Adds more tests
-rw-r--r-- | mcs/tools/linker/Makefile | 25 | ||||
-rw-r--r-- | mcs/tools/linker/Tests/System.Net.Http/test-handler-01.cs | 13 | ||||
-rw-r--r-- | mcs/tools/linker/Tests/mscorlib/test-calendar-01.cs | 6 | ||||
-rw-r--r-- | mcs/tools/linker/Tests/mscorlib/test-calendar-02.cs | 17 |
4 files changed, 53 insertions, 8 deletions
diff --git a/mcs/tools/linker/Makefile b/mcs/tools/linker/Makefile index 7e6b4e291f2..91e9882c7a4 100644 --- a/mcs/tools/linker/Makefile +++ b/mcs/tools/linker/Makefile @@ -8,6 +8,8 @@ LIB_REFS = System System.Core System.Xml Mono.Cecil TEST_CASES := \ mscorlib/test-array.cs \ + mscorlib/test-calendar-01.cs \ + mscorlib/test-calendar-02.cs \ mscorlib/test-exception-01.cs \ mscorlib/test-locale-01.cs \ mscorlib/test-reflection-01.cs \ @@ -23,7 +25,8 @@ TEST_CASES := \ ifdef MOBILE_PROFILE TEST_CASES += \ - mscorlib/test-crypto-01.cs + mscorlib/test-crypto-01.cs \ + System.Net.Http/test-handler-01.cs endif ifndef AOT_FRIENDLY_PROFILE @@ -55,6 +58,9 @@ mscorlib/test-marshaling.cs: $(MARSHALING_TEST_NATIVE) System/test-%.cs: $(TESTS_COMPILER) -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/System.dll Tests/$@ /out:Tests/$(@:.cs=.exe) +System.Net.Http/test-%.cs: + $(TESTS_COMPILER) -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/System.dll -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/System.Net.Http.dll Tests/$@ /out:Tests/$(@:.cs=.exe) + run-tests: $(TEST_CASES:.cs=.exe) LINKER_PROFILE_OPTIONS := @@ -70,16 +76,25 @@ endif LINKER_OUTPUT := illink-output-$(PROFILE_DIRECTORY) PROFILE_PATH = $(topdir)/class/lib/$(PROFILE_DIRECTORY) -LINKER = MONO_PATH=$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE) $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/monolinker.exe -c link -out $(LINKER_OUTPUT) -b true -d $(PROFILE_PATH) $(LINKER_PROFILE_OPTIONS) +LINKER = MONO_PATH=$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE) $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/monolinker.exe -c link -out $(LINKER_OUTPUT) -b true -d $(PROFILE_PATH) +LINKER_DEFAULT = $(LINKER) -l none $(LINKER_PROFILE_OPTIONS) TEST_EXEC = MONO_PATH=$(LINKER_OUTPUT) $(RUNTIME) $(RUNTIME_FLAGS) --debug -O=-aot .NOTPARALLEL: -System/test-%.exe mscorlib/test-%.exe: +System.Net.Http/test-%.exe System/test-%.exe mscorlib/test-%.exe: + @rm -rf $(LINKER_OUTPUT) + @mkdir $(LINKER_OUTPUT) + @echo Testing $@ + $(LINKER_DEFAULT) -a Tests/$@ + $(TEST_EXEC) $(LINKER_OUTPUT)/$(@F) + @rm -rf $(LINKER_OUTPUT) + +mscorlib/test-calendar-01.exe: @rm -rf $(LINKER_OUTPUT) @mkdir $(LINKER_OUTPUT) @echo Testing $@ - $(LINKER) -a Tests/$@ + $(LINKER) -l mideast $(LINKER_PROFILE_OPTIONS) -a Tests/$@ $(TEST_EXEC) $(LINKER_OUTPUT)/$(@F) @rm -rf $(LINKER_OUTPUT) @@ -87,7 +102,7 @@ mscorlib/test-marshaling.exe: $(MARSHALING_TEST_NATIVE) @rm -rf $(LINKER_OUTPUT) @mkdir $(LINKER_OUTPUT) @echo Testing $@ - $(LINKER) -a Tests/$@ + $(LINKER_DEFAULT) -a Tests/$@ cp Tests/$(MARSHALING_TEST_NATIVE) $(LINKER_OUTPUT) (cd $(LINKER_OUTPUT); MONO_PATH=. $(RUNTIME) $(RUNTIME_FLAGS) --debug -O=-aot ./$(@F)) @rm -rf $(LINKER_OUTPUT) diff --git a/mcs/tools/linker/Tests/System.Net.Http/test-handler-01.cs b/mcs/tools/linker/Tests/System.Net.Http/test-handler-01.cs new file mode 100644 index 00000000000..d025334d941 --- /dev/null +++ b/mcs/tools/linker/Tests/System.Net.Http/test-handler-01.cs @@ -0,0 +1,13 @@ +using System; +using System.Net.Http; + +public class C +{ + public static int Main () + { + using (var handler = new HttpClientHandler ()) { + } + + return 0; + } +}
\ No newline at end of file diff --git a/mcs/tools/linker/Tests/mscorlib/test-calendar-01.cs b/mcs/tools/linker/Tests/mscorlib/test-calendar-01.cs index db790b21099..c1583b40b56 100644 --- a/mcs/tools/linker/Tests/mscorlib/test-calendar-01.cs +++ b/mcs/tools/linker/Tests/mscorlib/test-calendar-01.cs @@ -1,3 +1,4 @@ +// Linker options has to be: -l mideast using System; using System.Globalization; @@ -7,9 +8,8 @@ public class C { var ci = CultureInfo.GetCultureInfo ("ar"); - // FIXME: -// if (ci.Calendar.ToString () != "System.Globalization.UmAlQuraCalendar") -// return 1; + if (ci.Calendar.ToString () != "System.Globalization.UmAlQuraCalendar") + return 1; return 0; } diff --git a/mcs/tools/linker/Tests/mscorlib/test-calendar-02.cs b/mcs/tools/linker/Tests/mscorlib/test-calendar-02.cs new file mode 100644 index 00000000000..a22887349ca --- /dev/null +++ b/mcs/tools/linker/Tests/mscorlib/test-calendar-02.cs @@ -0,0 +1,17 @@ +// Linker options has to be: -l none +using System; +using System.Globalization; + +public class C +{ + public static unsafe int Main () + { + var ci = CultureInfo.GetCultureInfo ("ps"); + + // Should return System.Globalization.HijriCalendar without linker + if (ci.Calendar.ToString () != "System.Globalization.GregorianCalendar") + return 1; + + return 0; + } +}
\ No newline at end of file |