From 6e14708df611f21d538d59a86ca48021a23fad84 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Sun, 12 Apr 2020 08:53:14 -0700 Subject: [PATCH 01/40] Switching to another branch commit --- tests/libcxx/lit.site.cfg.in | 1 + tests/std/.expected_results.txt.swp | Bin 0 -> 12288 bytes tests/std/lit.site.cfg.in | 1 + tests/std/tests/.usual_latest_matrix.lst.swp | Bin 0 -> 12288 bytes .../Dev09_056375_locale_cleanup/.test.cpp.swp | Bin 0 -> 12288 bytes .../.testdll.cpp.swp | Bin 0 -> 12288 bytes .../test.dat | Bin 0 -> 12 bytes .../.env.lst.swp | Bin 0 -> 12288 bytes .../VSO_0474901_shift_jis_codecvt/japan.txt | 1 + tests/tr1/lit.site.cfg.in | 1 + tests/utils/stl/test/config.py | 19 +- tests/utils/stl/test/executor.py | 52 +++-- tests/utils/stl/test/format.py | 184 ++++++++++-------- 13 files changed, 163 insertions(+), 96 deletions(-) create mode 100644 tests/std/.expected_results.txt.swp create mode 100644 tests/std/tests/.usual_latest_matrix.lst.swp create mode 100644 tests/std/tests/Dev09_056375_locale_cleanup/.test.cpp.swp create mode 100644 tests/std/tests/Dev09_056375_locale_cleanup/.testdll.cpp.swp create mode 100644 tests/std/tests/VSO_0000000_wchar_t_filebuf_xsmeown/test.dat create mode 100644 tests/std/tests/VSO_0157762_feature_test_macros/.env.lst.swp create mode 100644 tests/std/tests/VSO_0474901_shift_jis_codecvt/japan.txt diff --git a/tests/libcxx/lit.site.cfg.in b/tests/libcxx/lit.site.cfg.in index 41cb71337fd..eaeef9eddd5 100644 --- a/tests/libcxx/lit.site.cfg.in +++ b/tests/libcxx/lit.site.cfg.in @@ -15,6 +15,7 @@ config.format_name = "LibcxxTestFormat" config.include_dirs = ["@LIBCXX_SOURCE_DIR@/test/support"] config.libcxx_obj_root = "@LIBCXX_TEST_OUTPUT_DIR@" config.msvc_toolset_libs_root = "@TOOLSET_LIB@" +config.step_provider = "STLDelayedExecutionStepProvider" config.stl_build_root = "@STL_BUILD_ROOT@" config.stl_src_root = "@STL_SOURCE_DIR@" config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" diff --git a/tests/std/.expected_results.txt.swp b/tests/std/.expected_results.txt.swp new file mode 100644 index 0000000000000000000000000000000000000000..51eb171781c4b31106b69a15cae08f959f4441a8 GIT binary patch literal 12288 zcmeI&Pfrs;6aetSyJ+<4;aNOr;&yjI3iO7BKw}F?TQDBnEVHldgze5cGs~ZoH@*20 zG=2fUh-VLe0>6X@-_jC^NtL6RH_6MSvv2=h8aQ^VZNFIbBT8^+&n$r9ZG}tlt_uU4OYc==fHbMxwuqg|>dL-|-z< zXMO7uA5ROE4wJ~BEi-59?$k{mp1-gF3rrIz-OyW}6$|rWP^HY(?!(C*qHy7<%o{}=cFZ?}Z_Nb!N9L-By($E*-vDLzxYqj*bEr}%Qw{~GR} zm&^hzzyd750xZA+EWiRRzykk_!1y)vUT-@J#wD`OsQfTGR(KMrBx{C?(0kV25p&Q_ z5!$VFI6;UFf<012L8;(UWuY1f4p7FWMbJZ_rd&I~*sAOd3>HQwrBnwQR{e9t1e^w` zvy9$gLsE_kTTQXMy47p<+uK`@VPn&4tSmuopQcK6nI(|M#|R^gb6d?Y>07Np>QSLG zG!W-BY_$?;Vw;YKrRV13UG4;pU}-mqRGz6EqvP19nAT&P^Wk`le@hFlloqaBPTSb5 zWEY<-(zG%w6O5|Gl3z1yTruz00bJ6dBlE&wWudVYK&^`-ZO(|nn6hw6=b&;}U)z9_ z6muYYiPlz7BYNkq3Oa-Sz>>=x^mf)>cpW7%x9GJK%$*u4G)-77Vws{hUk_lv-QR>x oXRqtwsl@Z~sb@fgM7{@(szy=7oFzsNv14C2lc1&oh*r6{GtCVh2Uj~{cBF}Z#K$?WuWh)0j zdP<;;mAm)-aRJlQ&^nxge1u^|B@fCP{L5QMa|4GFqN*bd(|dPQbOZ>$r~Y(WBm`ba_uU z4J|uCbcfRjc&Hq2k1}&j3Cb$fs}$=Qc-R_qf}8Ds#T)_I{T2Tb}m0(_g!Y=VTYzp=3@IJ~Lz++dhLSP?msWat4W} z@dU<`JdLA~Afs)QP)2-J;Vj7mA%pmOjBzuO#u(c;j)5IY*|x~-i#88!J#cpVI|L3* zLS1pE;3smkaymbg3;X31Ql#2g&s&yVtZvk5R=HL`dRaxgZ9ltwdl^!O9CbUCyjkNd zS@xW$i_@% literal 0 HcmV?d00001 diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/.test.cpp.swp b/tests/std/tests/Dev09_056375_locale_cleanup/.test.cpp.swp new file mode 100644 index 0000000000000000000000000000000000000000..db6785414c80d4b57fb16d549b0727cebd1eecdf GIT binary patch literal 12288 zcmeI2PmkL~7>B2oKv19{_yV)ZVJEP*v%4xRDZ5gdq}_m1s!g&*J=F5rlV+%6Tb@aF zqY7~X6;&KKAaN)M?i@fAap%H~GZNwpAi)_Sf%y4PcC(?o$4XVl(j(jB*W>qnX2wz! z?^So(9lBwz5^OIK^7h|XZyJn|uWN*O<3tIWUO0VgWN}85%iAi7PmZ-lp|U)yFL@%Z zM*mXlM!j!aG8!iyw|00ONvqqlEybmhmQ;Rm)Z~-un@;t@>+5e^aDvEl1MYYMcf)a< zMVMZE%0o|1M_!4@QJ^0L$Ii1G5w)7OmU-xlK^8ogBD_UIcf@7vdYpErQt=T&#K7kR>U5k& zt3^bp=*SfztI#`ys&bl39#8E$FBxdU8**pykDw zNhJI^Nx6~7DP0Urp6=Z6TuwN*#a`kjQ#LFP3bXO$ap=v)xX_%n(WOlqj)NdpNfFu` z@-+Bb5_vQa*`#c)u|ltKm0qp;e!`_ZeAEgpHG`msnO7>hQq!2H6C<Jv@X>Rf)iLo$ zd%=|6M8A}7Qr9=O(gN5l>zS-$nWf=AqUTa=B-~XzPn?ym^8Ng9cKaQYcJS~OTC45w zLBKsFqA*|f506`1$!U-ASV>lDxIvJv{nRk3J6b+y$Y)|111&h!1K-=mle+)3>tM+P(<=XkVJc zt+^|R6w&df{OvLylxL7e5zC_8Yt8ozTX;N_+-UneRAL}_QiF8Y8**dKtkUc4-Zr)E p-HyQzJRYY4(_0%+JWa%{p`y&I(2nquNJayN_9TuHR2zjR`40^!3X=c; literal 0 HcmV?d00001 diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/.testdll.cpp.swp b/tests/std/tests/Dev09_056375_locale_cleanup/.testdll.cpp.swp new file mode 100644 index 0000000000000000000000000000000000000000..b6bfa579289c36b22986745e3adeaaf7ad89f289 GIT binary patch literal 12288 zcmeI2L2uJA6o9>fgoIQ;aO8m3N;H*d(`}5whLA>EL{W+mYX=$=A#+|}rz?Vq zEBpue2VD3O`~kQi{sec#ftR#{3DI)mfc7kXagz7^Y=1pP^>%%u-Qibj^9^#Lpr0BQPtLV>BV!A@ry8_-7E+W6zUCJgG=-1^d$#pNY8RKg3v6(M+08s`~)7}i8QW!}jvq6ir{N(KsS zabdom?YLB&kO4A42FL&zAOmFJ$Qv;6410+dX2&MZkNcV5`tc)m zWPl8i0Wv@a$N(8217v^fDDjEidz-_{O7s{O5*2i2_jzx%=JNpItF3k0dW|{DlruXLjy^~ zi;W@~nhG(@gB~G_P43uQxW6bTijaG}Dmk&)EHZ$|R7tZbt7d(DScM+%5E zRNFp8Mg|g+6~2bQOdqNXwK{*$?%w8(v(c%-P(W;?in5^%6+cVlPTz1#RCq^<9C~+2H^H literal 0 HcmV?d00001 diff --git a/tests/std/tests/VSO_0000000_wchar_t_filebuf_xsmeown/test.dat b/tests/std/tests/VSO_0000000_wchar_t_filebuf_xsmeown/test.dat new file mode 100644 index 0000000000000000000000000000000000000000..ffbe3091410c3be582675805a98a0118af8e6a6d GIT binary patch literal 12 Tcmc~u&B@7ED9g5w7{_N33k%Bv;^njm4cQB;mE)w8?QWzBrLo&ua$XcWZMQ;eP3=iD;Mm49 z*))4#FCh2^To7>Jh{TZt7jB$5!G!}ymNQ=f@l2aGrcRo4r9G?|OMlso{ru;d-#ng4 z)Y&U-S#^A?SVnNXjL>_Ze{}cu->;$7Hxcp&sbE~*IQys_KBpO!e<#Ui()sC(6c#!&3Z_^~^y5riqpj>dBi(q`UC<2Or zBJe*UAd(B{0rd5$aeuY(`NFC5_)m3G1QY>9KoL*`6ahs*5l{pa0YyL&Py`f#Cy)RM z5c>XUgdSXkn2!NU909<4a;53o3r~gFenMb*v~sV)-L!PX4STvHE?b=7I58Y=Z)H~Yb_88 zosD98;L}97qlEIjQKM<@)XbLat#=wVnULq+X_@n^^FBu|5bw;3^|20Vk&x|2G-%La z-m7X`8x7#pFt-cn8g_dWcVhrLWYInjSwuM|DaG_aq=e%r7C1>Mr;)%c!UH}aA?%J5 zDLXjY87Hf#S#Mdk*6Go03OL{ zNZ7cPC5`zO_wSHf<^%iu!u1%!hSEeAmhD(z(Xc_F`V^bdHLot^eg|h z47TZFr)BJDHuGu3sb&SR#Ir7=X$4mk;`gYwR4n0b%iYAby;awa%8|tpMAqVDl(PMv az;FB4ah=J{@^M$d=V=nBu+Ya*5&a9mWqF_g literal 0 HcmV?d00001 diff --git a/tests/std/tests/VSO_0474901_shift_jis_codecvt/japan.txt b/tests/std/tests/VSO_0474901_shift_jis_codecvt/japan.txt new file mode 100644 index 00000000000..83292ec1243 --- /dev/null +++ b/tests/std/tests/VSO_0474901_shift_jis_codecvt/japan.txt @@ -0,0 +1 @@ +“ú–{ \ No newline at end of file diff --git a/tests/tr1/lit.site.cfg.in b/tests/tr1/lit.site.cfg.in index 56b631e9d68..8f25b2ab491 100644 --- a/tests/tr1/lit.site.cfg.in +++ b/tests/tr1/lit.site.cfg.in @@ -8,6 +8,7 @@ config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" config.expected_results_list_path = "@TR1_EXPECTED_RESULTS@" config.include_dirs = ["@STL_SOURCE_DIR@/tests/tr1/include"] config.msvc_toolset_libs_root = "@TOOLSET_LIB@" +config.step_provider = "STLDelayedExecutionStepProvider" config.stl_build_root = "@STL_BUILD_ROOT@" config.stl_src_root = "@STL_SOURCE_DIR@" config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" diff --git a/tests/utils/stl/test/config.py b/tests/utils/stl/test/config.py index cf9587846a2..a7383a9c9c7 100644 --- a/tests/utils/stl/test/config.py +++ b/tests/utils/stl/test/config.py @@ -11,7 +11,7 @@ import platform import shlex -from stl.test.executor import LocalExecutor +from stl.test.executor import ExternalExecutor from stl.compiler import CXXCompiler import stl.util import stl.test.file_parsing @@ -41,6 +41,7 @@ def __init__(self, lit_config, config): self.link_shared = True self.long_tests = None self.msvc_toolset_libs_root = None + self.step_provider = None self.stl_build_root = None self.stl_inc_env_var = None self.stl_lib_env_var = None @@ -93,6 +94,15 @@ def configure(self): self.configure_expected_results() self.configure_test_dirs() self.configure_test_format() + self.configure_step_provider() + + def configure_step_provider(self): + step_provider = self.get_lit_conf('step_provider', None) + + if step_provider is None: + step_provider = 'STLStepProvider' + + self.step_provider = step_provider def configure_test_format(self): format_name = self.get_lit_conf('format_name', None) @@ -350,8 +360,8 @@ def configure_default_compiler(self): # TRANSITION: Investigate using SSHExecutor for ARM def configure_executors(self): - self.build_executor = LocalExecutor() - self.test_executor = LocalExecutor() + self.build_executor = ExternalExecutor() + self.test_executor = ExternalExecutor() def configure_compile_flags(self): self.configure_compile_flags_header_includes() @@ -424,7 +434,8 @@ def get_test_format(self): self.default_compiler, self.execute_external, self.build_executor, - self.test_executor) + self.test_executor, + getattr(stl.test.format, self.step_provider)()) # TRANSITION: Might be nice to actually print something def print_config_info(self): diff --git a/tests/utils/stl/test/executor.py b/tests/utils/stl/test/executor.py index cee2b71bf7f..9130c8e44e6 100644 --- a/tests/utils/stl/test/executor.py +++ b/tests/utils/stl/test/executor.py @@ -6,6 +6,7 @@ # #===----------------------------------------------------------------------===## +from pathlib import Path import platform import os import posixpath @@ -19,17 +20,12 @@ class Executor: def __init__(self): self.target_info = None - def run(self, cmd, local_cwd, file_deps=None, env=None): + def run(self, test_info): """Execute a command. Be very careful not to change shared state in this function. Executor objects are shared between python processes in `lit -jN`. - Args: - cmd: [str]: subprocess.call style command - local_cwd: str: Local path to the working directory - file_deps: [str]: Files required by the cmd - env: {str: str}: Environment variables to execute under Returns: - cmd, out, err, exitCode + cmd, out, err, exitCode, delayedExecution """ raise NotImplementedError @@ -48,20 +44,48 @@ def merge_environments(self, current_env, updated_env): return result_env +class ExternalExecutor(Executor): + def run(self, test_info): + work_dir = Path() + if str(test_info.work_dir) == '.': + work_dir = Path(os.getcwd()) + else: + work_dir = test_info.work_dir + + env = {} + if test_info.env: + env = self.merge_environments(os.environ, test_info.env) + + out_cmd = 'cd "' + str(work_dir) + '"\n' + + if env is not None: + for k, v in env.items(): + out_cmd += 'set ' + k + '="' + v + '"\n' + + out_cmd += ('\"%s\"\n' % '\" \"'.join(test_info.cmd)) + print(out_cmd, file=test_info.out_handle) + + return (test_info.cmd, '', '', 0, True) + + class LocalExecutor(Executor): def __init__(self): super(LocalExecutor, self).__init__() self.is_windows = platform.system() == 'Windows' - def run(self, cmd, work_dir='.', file_deps=None, env=None): - if str(work_dir) == '.': - work_dir = os.getcwd() + def run(self, test_info): + work_dir = Path() + if str(test_info.work_dir) == '.': + work_dir = Path(os.getcwd()) + else: + work_dir = test_info.work_dir - if env: - env = self.merge_environments(os.environ, env) + env = {} + if test_info.env: + env = self.merge_environments(os.environ, test_info.env) - out, err, rc = executeCommand(cmd, cwd=work_dir, env=env) - return (cmd, out, err, rc) + out, err, rc = executeCommand(test_info.cmd, cwd=work_dir, env=env) + return (test_info.cmd, out, err, rc, False) class PrefixExecutor(Executor): diff --git a/tests/utils/stl/test/format.py b/tests/utils/stl/test/format.py index 24a34ea211f..2441356b4ad 100644 --- a/tests/utils/stl/test/format.py +++ b/tests/utils/stl/test/format.py @@ -31,6 +31,82 @@ class TestStep: file_deps: List[os.PathLike] = field(default_factory=list) env: Dict[str, str] = field(default_factory=dict) should_fail: bool = field(default=False) + step_num: int = field(default=0) + + +class STLStepProvider: + def getSteps(self, test, lit_config): + @dataclass + class SharedState: + exec_file: Optional[os.PathLike] = field(default=None) + exec_dir: os.PathLike = field(default_factory=Path) + count: int = field(default=0) + + shared = SharedState() + return self.getBuildSteps(test, lit_config, shared), \ + self.getTestSteps(test, lit_config, shared) + + def getBuildSteps(self, test, lit_config, shared): + if not test.path_in_suite[-1].endswith('.fail.cpp'): + shared.exec_dir = test.getExecDir() + output_base = test.getOutputBaseName() + output_dir = test.getOutputDir() + source_path = Path(test.getSourcePath()) + + cmd, out_files, shared.exec_file = \ + test.cxx.executeBasedOnFlagsCmd([source_path], output_dir, + shared.exec_dir, output_base, + [], [], []) + + yield TestStep(cmd, shared.exec_dir, [source_path], + test.cxx.compile_env) + + def getTestSteps(self, test, lit_config, shared): + if shared.exec_file is not None: + exec_env = test.cxx.compile_env + exec_env['TMP'] = str(shared.exec_dir) + + yield TestStep([str(shared.exec_file)], shared.exec_dir, + [shared.exec_file], exec_env) + elif test.path_in_suite[-1].endswith('.fail.cpp'): + exec_dir = test.getExecDir() + source_path = Path(test.getSourcePath()) + + flags = [] + if test.cxx.name == 'cl' and \ + ('/analyze' in test.cxx.flags or + '/analyze' in test.cxx.compile_flags): + output_base = test.getOutputBaseName() + output_dir = test.getOutputDir() + analyze_path = output_dir / (output_base + + '.nativecodeanalysis.xml') + flags.append('/analyze:log' + str(analyze_path)) + + cmd, _ = test.cxx.compileCmd([source_path], os.devnull, flags) + yield TestStep(cmd, exec_dir, [source_path], + test.cxx.compile_env, True) + + +class STLDelayedExecutionStepProvider(STLStepProvider): + def getBuildSteps(self, test, lit_config, shared): + buildSteps = super().getBuildSteps(test, lit_config, shared) + build_base_name = test.getOutputBaseName() + '.build.cmd.' + + for step, num in zip(buildSteps, itertools.count()): + build_file = test.getOutputDir() / (build_base_name + str(num)) + with build_file.open('w') as f: + step.out_handle = f + yield step + + def getTestSteps(self, test, lit_config, shared): + testSteps = super().getTestSteps(test, lit_config, shared) + test_base_name = test.getOutputBaseName() + '.test.cmd.' + + for step, num in zip(testSteps, itertools.count()): + test_file = test.getOutputDir() / (test_base_name + str(num)) + with test_file.open('w') as f: + step.out_handle = f + yield step class STLTestFormat: @@ -39,10 +115,12 @@ class STLTestFormat: """ def __init__(self, default_cxx, execute_external, - build_executor, test_executor): + build_executor, test_executor, + step_provider=STLStepProvider()): self.cxx = default_cxx self.execute_external = execute_external self.build_executor = build_executor + self.step_provider = step_provider self.test_executor = test_executor def isLegalDirectory(self, source_path, litConfig): @@ -124,8 +202,7 @@ def setup(self, test): os.link(path, exec_dir / path.name) def cleanup(self, test): - shutil.rmtree(test.getExecDir(), ignore_errors=True) - shutil.rmtree(test.getOutputDir(), ignore_errors=True) + pass def getIntegratedScriptResult(self, test, lit_config): if test.skipped: @@ -184,40 +261,41 @@ def _execute(self, test, lit_config): try: self.setup(test) pass_var, fail_var = test.getPassFailResultCodes() - buildSteps, testSteps = self.getSteps(test, lit_config) + buildSteps, testSteps = \ + self.step_provider.getSteps(test, lit_config) report = "" for step in buildSteps: - cmd, out, err, rc = \ - self.build_executor.run(step.cmd, step.work_dir, - step.file_deps, step.env) + cmd, out, err, rc, force_pass = \ + self.build_executor.run(step) - if step.should_fail and rc == 0: - report += "Build step succeeded unexpectedly.\n" - elif rc != 0: - report += "Build step failed unexpectedly.\n" + if not force_pass: + if step.should_fail and rc == 0: + report += "Build step succeeded unexpectedly.\n" + elif rc != 0: + report += "Build step failed unexpectedly.\n" - report += stl.util.makeReport(cmd, out, err, rc) - if (step.should_fail and rc == 0) or \ - (not step.should_fail and rc != 0): - lit_config.note(report) - return lit.Test.Result(fail_var, report) + report += stl.util.makeReport(cmd, out, err, rc) + if (step.should_fail and rc == 0) or \ + (not step.should_fail and rc != 0): + lit_config.note(report) + return lit.Test.Result(fail_var, report) for step in testSteps: - cmd, out, err, rc = \ - self.test_executor.run(step.cmd, step.work_dir, - step.file_deps, step.env) + cmd, out, err, rc, force_pass = \ + self.test_executor.run(step) - if step.should_fail and rc == 0: - report += "Test step succeeded unexpectedly.\n" - elif rc != 0: - report += "Test step failed unexpectedly.\n" + if not force_pass: + if step.should_fail and rc == 0: + report += "Test step succeeded unexpectedly.\n" + elif rc != 0: + report += "Test step failed unexpectedly.\n" - report += stl.util.makeReport(cmd, out, err, rc) - if (step.should_fail and rc == 0) or \ - (not step.should_fail and rc != 0): - lit_config.note(report) - return lit.Test.Result(fail_var, report) + report += stl.util.makeReport(cmd, out, err, rc) + if (step.should_fail and rc == 0) or \ + (not step.should_fail and rc != 0): + lit_config.note(report) + return lit.Test.Result(fail_var, report) return lit.Test.Result(pass_var, report) @@ -227,56 +305,6 @@ def _execute(self, test, lit_config): finally: self.cleanup(test) - def getSteps(self, test, lit_config): - @dataclass - class SharedState: - exec_file: Optional[os.PathLike] = field(default=None) - exec_dir: os.PathLike = field(default_factory=Path) - - shared = SharedState() - return self.getBuildSteps(test, lit_config, shared), \ - self.getTestSteps(test, lit_config, shared) - - def getBuildSteps(self, test, lit_config, shared): - if not test.path_in_suite[-1].endswith('.fail.cpp'): - shared.exec_dir = test.getExecDir() - output_base = test.getOutputBaseName() - output_dir = test.getOutputDir() - source_path = Path(test.getSourcePath()) - - cmd, out_files, shared.exec_file = \ - test.cxx.executeBasedOnFlagsCmd([source_path], output_dir, - shared.exec_dir, output_base, - [], [], []) - - yield TestStep(cmd, shared.exec_dir, [source_path], - test.cxx.compile_env) - - def getTestSteps(self, test, lit_config, shared): - if shared.exec_file is not None: - exec_env = test.cxx.compile_env - exec_env['TMP'] = str(shared.exec_dir) - - yield TestStep([str(shared.exec_file)], shared.exec_dir, - [shared.exec_file], exec_env) - elif test.path_in_suite[-1].endswith('.fail.cpp'): - exec_dir = test.getExecDir() - source_path = Path(test.getSourcePath()) - - flags = [] - if test.cxx.name == 'cl' and \ - ('/analyze' in test.cxx.flags or - '/analyze' in test.cxx.compile_flags): - output_base = test.getOutputBaseName() - output_dir = test.getOutputDir() - analyze_path = output_dir / (output_base + - '.nativecodeanalysis.xml') - flags.append('/analyze:log' + str(analyze_path)) - - cmd, _ = test.cxx.compileCmd([source_path], os.devnull, flags) - yield TestStep(cmd, exec_dir, [source_path], - test.cxx.compile_env, True) - class LibcxxTestFormat(STLTestFormat): """ From 6adb7131670dff65cbf7e6c73648f4984cd135da Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Sun, 12 Apr 2020 08:54:06 -0700 Subject: [PATCH 02/40] clean swp files --- tests/std/.expected_results.txt.swp | Bin 12288 -> 0 bytes tests/std/tests/.usual_latest_matrix.lst.swp | Bin 12288 -> 0 bytes .../Dev09_056375_locale_cleanup/.test.cpp.swp | Bin 12288 -> 0 bytes .../.testdll.cpp.swp | Bin 12288 -> 0 bytes .../.env.lst.swp | Bin 12288 -> 0 bytes 5 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/std/.expected_results.txt.swp delete mode 100644 tests/std/tests/.usual_latest_matrix.lst.swp delete mode 100644 tests/std/tests/Dev09_056375_locale_cleanup/.test.cpp.swp delete mode 100644 tests/std/tests/Dev09_056375_locale_cleanup/.testdll.cpp.swp delete mode 100644 tests/std/tests/VSO_0157762_feature_test_macros/.env.lst.swp diff --git a/tests/std/.expected_results.txt.swp b/tests/std/.expected_results.txt.swp deleted file mode 100644 index 51eb171781c4b31106b69a15cae08f959f4441a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI&Pfrs;6aetSyJ+<4;aNOr;&yjI3iO7BKw}F?TQDBnEVHldgze5cGs~ZoH@*20 zG=2fUh-VLe0>6X@-_jC^NtL6RH_6MSvv2=h8aQ^VZNFIbBT8^+&n$r9ZG}tlt_uU4OYc==fHbMxwuqg|>dL-|-z< zXMO7uA5ROE4wJ~BEi-59?$k{mp1-gF3rrIz-OyW}6$|rWP^HY(?!(C*qHy7<%o{}=cFZ?}Z_Nb!N9L-By($E*-vDLzxYqj*bEr}%Qw{~GR} zm&^hzzyd750xZA+EWiRRzykk_!1y)vUT-@J#wD`OsQfTGR(KMrBx{C?(0kV25p&Q_ z5!$VFI6;UFf<012L8;(UWuY1f4p7FWMbJZ_rd&I~*sAOd3>HQwrBnwQR{e9t1e^w` zvy9$gLsE_kTTQXMy47p<+uK`@VPn&4tSmuopQcK6nI(|M#|R^gb6d?Y>07Np>QSLG zG!W-BY_$?;Vw;YKrRV13UG4;pU}-mqRGz6EqvP19nAT&P^Wk`le@hFlloqaBPTSb5 zWEY<-(zG%w6O5|Gl3z1yTruz00bJ6dBlE&wWudVYK&^`-ZO(|nn6hw6=b&;}U)z9_ z6muYYiPlz7BYNkq3Oa-Sz>>=x^mf)>cpW7%x9GJK%$*u4G)-77Vws{hUk_lv-QR>x oXRqtwsl@Z~sb@fgM7{@(szy=7oFzsNv14C2lc1&oh*r6{GtCVh2Uj~{cBF}Z#K$?WuWh)0j zdP<;;mAm)-aRJlQ&^nxge1u^|B@fCP{L5QMa|4GFqN*bd(|dPQbOZ>$r~Y(WBm`ba_uU z4J|uCbcfRjc&Hq2k1}&j3Cb$fs}$=Qc-R_qf}8Ds#T)_I{T2Tb}m0(_g!Y=VTYzp=3@IJ~Lz++dhLSP?msWat4W} z@dU<`JdLA~Afs)QP)2-J;Vj7mA%pmOjBzuO#u(c;j)5IY*|x~-i#88!J#cpVI|L3* zLS1pE;3smkaymbg3;X31Ql#2g&s&yVtZvk5R=HL`dRaxgZ9ltwdl^!O9CbUCyjkNd zS@xW$i_@% diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/.test.cpp.swp b/tests/std/tests/Dev09_056375_locale_cleanup/.test.cpp.swp deleted file mode 100644 index db6785414c80d4b57fb16d549b0727cebd1eecdf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2PmkL~7>B2oKv19{_yV)ZVJEP*v%4xRDZ5gdq}_m1s!g&*J=F5rlV+%6Tb@aF zqY7~X6;&KKAaN)M?i@fAap%H~GZNwpAi)_Sf%y4PcC(?o$4XVl(j(jB*W>qnX2wz! z?^So(9lBwz5^OIK^7h|XZyJn|uWN*O<3tIWUO0VgWN}85%iAi7PmZ-lp|U)yFL@%Z zM*mXlM!j!aG8!iyw|00ONvqqlEybmhmQ;Rm)Z~-un@;t@>+5e^aDvEl1MYYMcf)a< zMVMZE%0o|1M_!4@QJ^0L$Ii1G5w)7OmU-xlK^8ogBD_UIcf@7vdYpErQt=T&#K7kR>U5k& zt3^bp=*SfztI#`ys&bl39#8E$FBxdU8**pykDw zNhJI^Nx6~7DP0Urp6=Z6TuwN*#a`kjQ#LFP3bXO$ap=v)xX_%n(WOlqj)NdpNfFu` z@-+Bb5_vQa*`#c)u|ltKm0qp;e!`_ZeAEgpHG`msnO7>hQq!2H6C<Jv@X>Rf)iLo$ zd%=|6M8A}7Qr9=O(gN5l>zS-$nWf=AqUTa=B-~XzPn?ym^8Ng9cKaQYcJS~OTC45w zLBKsFqA*|f506`1$!U-ASV>lDxIvJv{nRk3J6b+y$Y)|111&h!1K-=mle+)3>tM+P(<=XkVJc zt+^|R6w&df{OvLylxL7e5zC_8Yt8ozTX;N_+-UneRAL}_QiF8Y8**dKtkUc4-Zr)E p-HyQzJRYY4(_0%+JWa%{p`y&I(2nquNJayN_9TuHR2zjR`40^!3X=c; diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/.testdll.cpp.swp b/tests/std/tests/Dev09_056375_locale_cleanup/.testdll.cpp.swp deleted file mode 100644 index b6bfa579289c36b22986745e3adeaaf7ad89f289..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2L2uJA6o9>fgoIQ;aO8m3N;H*d(`}5whLA>EL{W+mYX=$=A#+|}rz?Vq zEBpue2VD3O`~kQi{sec#ftR#{3DI)mfc7kXagz7^Y=1pP^>%%u-Qibj^9^#Lpr0BQPtLV>BV!A@ry8_-7E+W6zUCJgG=-1^d$#pNY8RKg3v6(M+08s`~)7}i8QW!}jvq6ir{N(KsS zabdom?YLB&kO4A42FL&zAOmFJ$Qv;6410+dX2&MZkNcV5`tc)m zWPl8i0Wv@a$N(8217v^fDDjEidz-_{O7s{O5*2i2_jzx%=JNpItF3k0dW|{DlruXLjy^~ zi;W@~nhG(@gB~G_P43uQxW6bTijaG}Dmk&)EHZ$|R7tZbt7d(DScM+%5E zRNFp8Mg|g+6~2bQOdqNXwK{*$?%w8(v(c%-P(W;?in5^%6+cVlPTz1#RCq^<9C~+2H^H diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/.env.lst.swp b/tests/std/tests/VSO_0157762_feature_test_macros/.env.lst.swp deleted file mode 100644 index 7c075376d0cc72c01f825814e6ec7d981dd857b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2O>g5w7{_N33k%Bv;^njm4cQB;mE)w8?QWzBrLo&ua$XcWZMQ;eP3=iD;Mm49 z*))4#FCh2^To7>Jh{TZt7jB$5!G!}ymNQ=f@l2aGrcRo4r9G?|OMlso{ru;d-#ng4 z)Y&U-S#^A?SVnNXjL>_Ze{}cu->;$7Hxcp&sbE~*IQys_KBpO!e<#Ui()sC(6c#!&3Z_^~^y5riqpj>dBi(q`UC<2Or zBJe*UAd(B{0rd5$aeuY(`NFC5_)m3G1QY>9KoL*`6ahs*5l{pa0YyL&Py`f#Cy)RM z5c>XUgdSXkn2!NU909<4a;53o3r~gFenMb*v~sV)-L!PX4STvHE?b=7I58Y=Z)H~Yb_88 zosD98;L}97qlEIjQKM<@)XbLat#=wVnULq+X_@n^^FBu|5bw;3^|20Vk&x|2G-%La z-m7X`8x7#pFt-cn8g_dWcVhrLWYInjSwuM|DaG_aq=e%r7C1>Mr;)%c!UH}aA?%J5 zDLXjY87Hf#S#Mdk*6Go03OL{ zNZ7cPC5`zO_wSHf<^%iu!u1%!hSEeAmhD(z(Xc_F`V^bdHLot^eg|h z47TZFr)BJDHuGu3sb&SR#Ir7=X$4mk;`gYwR4n0b%iYAby;awa%8|tpMAqVDl(PMv az;FB4ah=J{@^M$d=V=nBu+Ya*5&a9mWqF_g From 6465ad53508d73b9ee77f3f54e0bdd214e6e80d4 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Sun, 12 Apr 2020 08:55:22 -0700 Subject: [PATCH 03/40] delete a data file --- .../VSO_0000000_wchar_t_filebuf_xsmeown/test.dat | Bin 12 -> 0 bytes .../tests/VSO_0474901_shift_jis_codecvt/japan.txt | 1 - 2 files changed, 1 deletion(-) delete mode 100644 tests/std/tests/VSO_0000000_wchar_t_filebuf_xsmeown/test.dat delete mode 100644 tests/std/tests/VSO_0474901_shift_jis_codecvt/japan.txt diff --git a/tests/std/tests/VSO_0000000_wchar_t_filebuf_xsmeown/test.dat b/tests/std/tests/VSO_0000000_wchar_t_filebuf_xsmeown/test.dat deleted file mode 100644 index ffbe3091410c3be582675805a98a0118af8e6a6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12 Tcmc~u&B@7ED9 Date: Wed, 22 Apr 2020 11:52:03 -0700 Subject: [PATCH 04/40] Get tr1 to test with ctest and Ninja --- tests/CMakeLists.txt | 31 ++- tests/libcxx/CMakeLists.txt | 12 -- tests/std/CMakeLists.txt | 12 -- tests/tr1/CMakeLists.txt | 12 -- tests/utils/stl/test/config.py | 29 +-- tests/utils/stl/test/executor.py | 320 ++++++++----------------------- tests/utils/stl/test/format.py | 225 ++++++++-------------- tests/utils/stl/test/tests.py | 144 +++++--------- 8 files changed, 252 insertions(+), 533 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 93bae8bf95e..bf06f9e2ef4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,15 +14,36 @@ set(LIBCXX_SOURCE_DIR "${LLVM_PROJECT_SOURCE_DIR}/libcxx" CACHE PATH set(LLVM_SOURCE_DIR "${LLVM_PROJECT_SOURCE_DIR}/llvm" CACHE PATH "Location of the llvm source tree") -set(STL_LIT ${CMAKE_CURRENT_BINARY_DIR}/utils/stl-lit/stl-lit.py) - -set(Python_FIND_STRATEGY VERSION) -find_package(Python3) - add_subdirectory(libcxx) add_subdirectory(std) add_subdirectory(tr1) +set(STL_LIT ${CMAKE_CURRENT_BINARY_DIR}/utils/stl-lit/stl-lit.py) # Add the stl-lit subdirectory last so all the test directories have had a # chance to add to the config map. add_subdirectory(utils/stl-lit) + +set(Python_FIND_STRATEGY VERSION) +find_package(Python3) + +execute_process( + COMMAND ${Python3_EXECUTABLE} + ${STL_LIT} + #"${LIBCXX_SOURCE_DIR}/test/std" + #"${CMAKE_CURRENT_SOURCE_DIR}/std" + "${CMAKE_CURRENT_SOURCE_DIR}/tr1") + + #include("${CMAKE_CURRENT_BINARY_DIR}/libcxx/tests.cmake") + #include("${CMAKE_CURRENT_BINARY_DIR}/std/tests.cmake") +include("${CMAKE_CURRENT_BINARY_DIR}/tr1/tests.cmake") + +get_property(STL_LIT_GENERATED_FILES GLOBAL PROPERTY STL_LIT_GENERATED_FILES) + +#add_custom_target( +# generate_test_files +# ${Python3_EXECUTABLE} +# ${STL_LIT} +# #"${LIBCXX_SOURCE_DIR}/test/std" +# #"${CMAKE_CURRENT_SOURCE_DIR}/std" +# "${CMAKE_CURRENT_SOURCE_DIR}/tr1" +# BYPRODUCTS ${STL_LIT_GENERATED_FILES}) diff --git a/tests/libcxx/CMakeLists.txt b/tests/libcxx/CMakeLists.txt index a792903757c..5df73ab1d53 100644 --- a/tests/libcxx/CMakeLists.txt +++ b/tests/libcxx/CMakeLists.txt @@ -12,15 +12,3 @@ configure_file( get_property(STL_LIT_CONFIG_MAP GLOBAL PROPERTY STL_LIT_CONFIG_MAP) string(APPEND STL_LIT_CONFIG_MAP "map_config(\"${LIBCXX_SOURCE_DIR}/test/lit.cfg\", \"${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg\")\n") set_property(GLOBAL PROPERTY STL_LIT_CONFIG_MAP ${STL_LIT_CONFIG_MAP}) - -if(ENABLE_XUNIT_OUTPUT) - list(APPEND LIBCXX_ADDITIONAL_LIT_FLAGS "--xunit-xml-output" "${CMAKE_CURRENT_BINARY_DIR}/libcxx.test.xml") -endif() - -list(APPEND LIBCXX_STL_LIT_COMMAND "${STL_LIT}" - "${ADDITIONAL_LIT_FLAGS}" - "${LIBCXX_ADDITIONAL_LIT_FLAGS}" - "${LIBCXX_SOURCE_DIR}/test") - -add_test(NAME libcxx COMMAND ${Python3_EXECUTABLE} ${LIBCXX_STL_LIT_COMMAND} COMMAND_EXPAND_LISTS) -set_tests_properties(libcxx PROPERTIES RUN_SERIAL TRUE) diff --git a/tests/std/CMakeLists.txt b/tests/std/CMakeLists.txt index 55fe345db9c..8fdccf77b3f 100644 --- a/tests/std/CMakeLists.txt +++ b/tests/std/CMakeLists.txt @@ -13,15 +13,3 @@ configure_file( get_property(STL_LIT_CONFIG_MAP GLOBAL PROPERTY STL_LIT_CONFIG_MAP) string(APPEND STL_LIT_CONFIG_MAP "map_config(\"${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg\", \"${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg\")\n") set_property(GLOBAL PROPERTY STL_LIT_CONFIG_MAP ${STL_LIT_CONFIG_MAP}) - -if(ENABLE_XUNIT_OUTPUT) - list(APPEND STD_ADDITIONAL_LIT_FLAGS "--xunit-xml-output" "${CMAKE_CURRENT_BINARY_DIR}/std.test.xml") -endif() - -list(APPEND STD_STL_LIT_COMMAND "${STL_LIT}" - "${ADDITIONAL_LIT_FLAGS}" - "${STD_ADDITIONAL_LIT_FLAGS}" - "${CMAKE_CURRENT_SOURCE_DIR}") - -add_test(NAME std COMMAND ${Python3_EXECUTABLE} ${STD_STL_LIT_COMMAND} COMMAND_EXPAND_LISTS) -set_tests_properties(std PROPERTIES RUN_SERIAL TRUE) diff --git a/tests/tr1/CMakeLists.txt b/tests/tr1/CMakeLists.txt index 2f9e967cb33..c7c3d790403 100644 --- a/tests/tr1/CMakeLists.txt +++ b/tests/tr1/CMakeLists.txt @@ -13,15 +13,3 @@ configure_file( get_property(STL_LIT_CONFIG_MAP GLOBAL PROPERTY STL_LIT_CONFIG_MAP) string(APPEND STL_LIT_CONFIG_MAP "map_config(\"${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg\", \"${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg\")\n") set_property(GLOBAL PROPERTY STL_LIT_CONFIG_MAP ${STL_LIT_CONFIG_MAP}) - -if(ENABLE_XUNIT_OUTPUT) - list(APPEND TR1_ADDITIONAL_LIT_FLAGS "--xunit-xml-output" "${CMAKE_CURRENT_BINARY_DIR}/tr1.test.xml") -endif() - -list(APPEND TR1_STL_LIT_COMMAND "${STL_LIT}" - "${ADDITIONAL_LIT_FLAGS}" - "${TR1_ADDITIONAL_LIT_FLAGS}" - "${CMAKE_CURRENT_SOURCE_DIR}") - -add_test(NAME tr1 COMMAND ${Python3_EXECUTABLE} ${TR1_STL_LIT_COMMAND} COMMAND_EXPAND_LISTS) -set_tests_properties(tr1 PROPERTIES RUN_SERIAL TRUE) diff --git a/tests/utils/stl/test/config.py b/tests/utils/stl/test/config.py index a7383a9c9c7..4f23caf9e28 100644 --- a/tests/utils/stl/test/config.py +++ b/tests/utils/stl/test/config.py @@ -11,7 +11,7 @@ import platform import shlex -from stl.test.executor import ExternalExecutor +from stl.test.executor import BuildStepWriter, LocalTestStepWriter from stl.compiler import CXXCompiler import stl.util import stl.test.file_parsing @@ -94,15 +94,6 @@ def configure(self): self.configure_expected_results() self.configure_test_dirs() self.configure_test_format() - self.configure_step_provider() - - def configure_step_provider(self): - step_provider = self.get_lit_conf('step_provider', None) - - if step_provider is None: - step_provider = 'STLStepProvider' - - self.step_provider = step_provider def configure_test_format(self): format_name = self.get_lit_conf('format_name', None) @@ -306,11 +297,6 @@ def configure_path_env_var(self): self.stl_path_env_var = stl_path_env_var def configure_test_env(self): - stl_test_env = self.get_lit_conf('stl_test_env', None) - - if stl_test_env is None: - stl_test_env = self.config.environment - if self.stl_lib_env_var is None: self.configure_inc_env_var() @@ -320,8 +306,10 @@ def configure_test_env(self): if self.stl_path_env_var is None: self.configure_path_env_var() + stl_test_env = {} stl_test_env['INCLUDE'] = self.stl_inc_env_var stl_test_env['LIB'] = self.stl_lib_env_var + stl_test_env['LIBPATH'] = self.stl_lib_env_var stl_test_env['PATH'] = self.stl_path_env_var self.config.environment = stl_test_env @@ -358,10 +346,9 @@ def configure_default_compiler(self): self.default_compiler.compile_env = self.config.environment - # TRANSITION: Investigate using SSHExecutor for ARM def configure_executors(self): - self.build_executor = ExternalExecutor() - self.test_executor = ExternalExecutor() + self.build_step_writer = BuildStepWriter() + self.test_step_writer = LocalTestStepWriter() def configure_compile_flags(self): self.configure_compile_flags_header_includes() @@ -433,9 +420,9 @@ def get_test_format(self): return getattr(stl.test.format, self.format_name)( self.default_compiler, self.execute_external, - self.build_executor, - self.test_executor, - getattr(stl.test.format, self.step_provider)()) + self.build_step_writer, + self.test_step_writer, + stl.test.format.STLStepProvider()) # TRANSITION: Might be nice to actually print something def print_config_info(self): diff --git a/tests/utils/stl/test/executor.py b/tests/utils/stl/test/executor.py index 9130c8e44e6..608fc1f5937 100644 --- a/tests/utils/stl/test/executor.py +++ b/tests/utils/stl/test/executor.py @@ -1,259 +1,109 @@ -#===----------------------------------------------------------------------===## -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===----------------------------------------------------------------------===## - from pathlib import Path -import platform import os -import posixpath -import ntpath - -from stl.test import tracing -from stl.util import executeCommand -class Executor: - def __init__(self): - self.target_info = None - - def run(self, test_info): - """Execute a command. - Be very careful not to change shared state in this function. - Executor objects are shared between python processes in `lit -jN`. - Returns: - cmd, out, err, exitCode, delayedExecution - """ - raise NotImplementedError +class StepWriter: + def get_working_directory(step): + work_dir = Path() + if str(step.work_dir) == '.': + work_dir = Path(os.getcwd()) + else: + work_dir = step.work_dir - def merge_environments(self, current_env, updated_env): - """Merges two execution environments. + return work_dir - If both environments contain the PATH variables, they are also merged - using the proper separator. - """ + def merge_environments(current_env, updated_env, appended_vars={'PATH'}): result_env = dict(current_env) for k, v in updated_env.items(): - if k == 'PATH' and self.target_info: - self.target_info.add_path(result_env, v) + if k in appended_vars: + current_v = result_env.get(k) + if current_v: + result_env[k] = v + ';' + current_v + else: + result_env[k] = v else: result_env[k] = v return result_env - -class ExternalExecutor(Executor): - def run(self, test_info): - work_dir = Path() - if str(test_info.work_dir) == '.': - work_dir = Path(os.getcwd()) - else: - work_dir = test_info.work_dir - + def write_step_file(self, step, step_file, test_file_handle): env = {} - if test_info.env: - env = self.merge_environments(os.environ, test_info.env) - - out_cmd = 'cd "' + str(work_dir) + '"\n' + if step.env: + env = StepWriter.merge_environments(os.environ, step.env) + out_cmd = '' if env is not None: for k, v in env.items(): - out_cmd += 'set ' + k + '="' + v + '"\n' - - out_cmd += ('\"%s\"\n' % '\" \"'.join(test_info.cmd)) - print(out_cmd, file=test_info.out_handle) - - return (test_info.cmd, '', '', 0, True) - - -class LocalExecutor(Executor): - def __init__(self): - super(LocalExecutor, self).__init__() - self.is_windows = platform.system() == 'Windows' - - def run(self, test_info): - work_dir = Path() - if str(test_info.work_dir) == '.': - work_dir = Path(os.getcwd()) - else: - work_dir = test_info.work_dir - - env = {} - if test_info.env: - env = self.merge_environments(os.environ, test_info.env) - - out, err, rc = executeCommand(test_info.cmd, cwd=work_dir, env=env) - return (test_info.cmd, out, err, rc, False) - - -class PrefixExecutor(Executor): - """Prefix an executor with some other command wrapper. - - Most useful for setting ulimits on commands, or running an emulator like - qemu and valgrind. - """ - def __init__(self, commandPrefix, chain): - super(PrefixExecutor, self).__init__() - - self.commandPrefix = commandPrefix - self.chain = chain + out_cmd += 'set ' + k + '=' + v + '\n' - def run(self, exe_path, cmd=None, work_dir='.', file_deps=None, env=None): - cmd = cmd or [exe_path] - return self.chain.run(exe_path, self.commandPrefix + cmd, work_dir, - file_deps, env=env) + out_cmd += ('\"%s\"\n' % '\" \"'.join(step.cmd)) + with step_file.open('w') as f: + print(out_cmd, file=f) -class PostfixExecutor(Executor): - """Postfix an executor with some args.""" - def __init__(self, commandPostfix, chain): - super(PostfixExecutor, self).__init__() + global_prop_string = \ + 'set_property(GLOBAL APPEND PROPERTY STL_LIT_GENERATED_FILES {cmd})' + print(global_prop_string.format(cmd=step_file.as_posix()), + file=test_file_handle) - self.commandPostfix = commandPostfix - self.chain = chain - def run(self, exe_path, cmd=None, work_dir='.', file_deps=None, env=None): - cmd = cmd or [exe_path] - return self.chain.run(cmd + self.commandPostfix, work_dir, file_deps, - env=env) +class BuildStepWriter(StepWriter): + def write(self, test, step, test_file_handle): + build_base_name = test.getOutputBaseName() + '.build.{}.cmd' + step_file = \ + test.getOutputDir() / build_base_name.format(str(step.num)) + self.write_step_file(step, step_file, test_file_handle) + work_dir = StepWriter.get_working_directory(step) -class RemoteExecutor(Executor): - def __init__(self): - super(RemoteExecutor, self).__init__() - self.local_run = executeCommand + pass_string = \ + 'add_custom_command(OUTPUT {out} COMMAND cmd ARGS /c {cmd} DEPENDS msvcpd_implib msvcp_implib libcpmt libcpmt1 libcpmtd libcpmtd1 libcpmtd0 {cmd} {deps} WORKING_DIRECTORY {cwd})\nadd_custom_target({name} ALL DEPENDS {out})' + fail_string = \ + 'add_test(NAME {name} COMMAND cmd /c {cmd} WORKING_DIRECTORY {cwd})\nset_property(TEST {name} PROPERTY WILL_FAIL TRUE)' - def remote_temp_dir(self): - return self._remote_temp(True) - - def remote_temp_file(self): - return self._remote_temp(False) - - def _remote_temp(self, is_dir): - raise NotImplementedError() - - def copy_in(self, local_srcs, remote_dsts): - # This could be wrapped up in a tar->scp->untar for performance - # if there are lots of files to be copied/moved - for src, dst in zip(local_srcs, remote_dsts): - self._copy_in_file(src, dst) - - def _copy_in_file(self, src, dst): - raise NotImplementedError() - - def delete_remote(self, remote): - try: - self._execute_command_remote(['rm', '-rf', remote]) - except OSError: - # TRANSITION: Log failure to delete? - pass - - def run(self, exe_path, cmd=None, work_dir='.', file_deps=None, env=None): - target_exe_path = None - target_cwd = None - try: - target_cwd = self.remote_temp_dir() - executable_name = 'libcxx_test.exe' - if self.target_info.is_windows(): - target_exe_path = ntpath.join(target_cwd, executable_name) - else: - target_exe_path = posixpath.join(target_cwd, executable_name) - - if cmd: - # Replace exe_path with target_exe_path. - cmd = [c if c != exe_path else target_exe_path for c in cmd] - else: - cmd = [target_exe_path] - - srcs = [exe_path] - dsts = [target_exe_path] - if file_deps is not None: - dev_paths = [os.path.join(target_cwd, os.path.basename(f)) - for f in file_deps] - srcs.extend(file_deps) - dsts.extend(dev_paths) - self.copy_in(srcs, dsts) - - # When testing executables that were cross-compiled on Windows for - # Linux, we may need to explicitly set the execution permission to - # avoid the 'Permission denied' error: - chmod_cmd = ['chmod', '+x', target_exe_path] - - return self._execute_command_remote(chmod_cmd + ['&&'] + cmd, - target_cwd, - env) - finally: - if target_cwd: - self.delete_remote(target_cwd) - - def _execute_command_remote(self, cmd, remote_work_dir='.', env=None): - raise NotImplementedError() - - -class SSHExecutor(RemoteExecutor): - def __init__(self, host, username=None): - super(SSHExecutor, self).__init__() - - self.user_prefix = username + '@' if username else '' - self.host = host - self.scp_command = 'scp' - self.ssh_command = 'ssh' - - if False: - self.local_run = tracing.trace_function( - self.local_run, log_calls=True, log_results=True, - label='ssh_local') - - def _remote_temp(self, is_dir): - # TRANSITION: detect what the target system is, and use the correct - # mktemp command for it. (linux and darwin differ here, and I'm - # sure windows has another way to do it) - - # Not sure how to do suffix on osx yet - dir_arg = '-d' if is_dir else '' - cmd = 'mktemp -q {} /tmp/stl.XXXXXXXXXX'.format(dir_arg) - _, temp_path, err, exitCode = self._execute_command_remote([cmd]) - temp_path = temp_path.strip() - if exitCode != 0: - raise RuntimeError(err) - return temp_path - - def _copy_in_file(self, src, dst): - scp = self.scp_command - remote = self.host - remote = self.user_prefix + remote - cmd = [scp, '-p', src, remote + ':' + dst] - self.local_run(cmd) - - def _export_command(self, env): - if not env: - return [] - - export_cmd = ['export'] - - for k, v in env.items(): - v = v.replace('\\', '\\\\') - if k == 'PATH': - # Pick up the existing paths, so we don't lose any commands - if self.target_info and self.target_info.is_windows(): - export_cmd.append('PATH="%s;%PATH%"' % v) - else: - export_cmd.append('PATH="%s:$PATH"' % v) - else: - export_cmd.append('"%s"="%s"' % (k, v)) - - return export_cmd - - def _execute_command_remote(self, cmd, remote_work_dir='.', env=None): - remote = self.user_prefix + self.host - ssh_cmd = [self.ssh_command, '-oBatchMode=yes', remote] - export_cmd = self._export_command(env) - remote_cmd = ' '.join(cmd) - if export_cmd: - remote_cmd = ' '.join(export_cmd) + ' && ' + remote_cmd - if remote_work_dir != '.': - remote_cmd = 'cd ' + remote_work_dir + ' && ' + remote_cmd - out, err, rc = self.local_run(ssh_cmd + [remote_cmd]) - return (remote_cmd, out, err, rc) + if not step.should_fail: + name = test.getFullName() + '_' + str(step.num) + print(pass_string.format(out=' '.join(map(lambda dep: dep.as_posix(), step.out_files)), + cmd=step_file.as_posix(), + deps=' '.join(map(lambda dep: dep.as_posix(), step.dependencies)), + cwd=work_dir.as_posix(), + name=name), + file=test_file_handle) + else: + print(fail_string.format(test.getFullName(), + cmd=step_file.as_posix(), + cwd=work_dir.as_posix()), + file=test_file_handle) + + +class LocalTestStepWriter(StepWriter): + def write(self, test, step, test_file_handle): + test_base_name = test.getOutputBaseName() + '.test.{}.cmd' + step_file = \ + test.getOutputDir() / test_base_name.format(str(step.num)) + self.write_step_file(step, step_file, test_file_handle) + + work_dir = StepWriter.get_working_directory(step) + + test_string = \ + 'add_test(NAME {name} COMMAND cmd /c {cmd} WORKING_DIRECTORY {cwd})' + fail_string = \ + 'set_property(TEST {name} PROPERTY WILL_FAIL TRUE)' + depends_string = \ + 'set_property(TEST {name} PROPERTY DEPENDS {prev_test})' + + test_name = '"' + test.getFullName() + '_' + str(step.num) + '"' + print(test_string.format(name=test_name, + cmd=step_file.as_posix(), + cwd=work_dir.as_posix()), + file=test_file_handle) + + if step.should_fail: + print(fail_string.format(name=test_name), + file=test_file_handle) + + if step.num != 0: + prev_test = \ + '"' + test.getFullName() + '_' + str(step.num - 1) + '"' + print(depends_string.format(name=test_name, + prev_test=prev_test), + file=test_file_handle) diff --git a/tests/utils/stl/test/format.py b/tests/utils/stl/test/format.py index f1038bf41dc..628e4d4da5c 100644 --- a/tests/utils/stl/test/format.py +++ b/tests/utils/stl/test/format.py @@ -8,18 +8,16 @@ from dataclasses import dataclass, field from pathlib import Path -from typing import Dict, List, Optional +from typing import Dict, List import copy import itertools -import errno import os import shutil -import time import lit.Test # pylint: disable=import-error import lit.TestRunner # pylint: disable=import-error -from stl.test.tests import STLTest, LibcxxTest +from stl.test.tests import STLTest, LibcxxTest, TestType import stl.test.file_parsing import stl.util @@ -27,86 +25,57 @@ @dataclass class TestStep: cmd: List[str] = field(default_factory=list) - work_dir: os.PathLike = field(default=Path('.')) - file_deps: List[os.PathLike] = field(default_factory=list) + dependencies: List[os.PathLike] = field(default_factory=list) env: Dict[str, str] = field(default_factory=dict) + num: int = field(default=0) + out_files: List[os.PathLike] = field(default_factory=list) should_fail: bool = field(default=False) - step_num: int = field(default=0) + work_dir: os.PathLike = field(default=Path('.')) class STLStepProvider: def getSteps(self, test, lit_config): - @dataclass class SharedState: - exec_file: Optional[os.PathLike] = field(default=None) - exec_dir: os.PathLike = field(default_factory=Path) - count: int = field(default=0) - - shared = SharedState() + def __init__(self, test): + self.exec_dir = test.getExecDir() + self.exec_env = test.cxx.compile_env + self.exec_env['TMP'] = str(self.exec_dir) + self.exec_env['TEMP'] = str(self.exec_dir) + self.exec_env['TMPDIR'] = str(self.exec_dir) + self.exec_env['TEMPDIR'] = str(self.exec_dir) + self.exec_file = None + + shared = SharedState(test) return self.getBuildSteps(test, lit_config, shared), \ self.getTestSteps(test, lit_config, shared) def getBuildSteps(self, test, lit_config, shared): - if not test.path_in_suite[-1].endswith('.fail.cpp'): - shared.exec_dir = test.getExecDir() - output_base = test.getOutputBaseName() - output_dir = test.getOutputDir() - source_path = Path(test.getSourcePath()) + output_base = test.getOutputBaseName() + output_dir = test.getOutputDir() + source_path = Path(test.getSourcePath()) - cmd, out_files, shared.exec_file = \ - test.cxx.executeBasedOnFlagsCmd([source_path], output_dir, - shared.exec_dir, output_base, - [], [], []) + cmd, out_files, shared.exec_file = \ + test.cxx.executeBasedOnFlagsCmd([source_path], output_dir, + shared.exec_dir, output_base, + [], [], []) - yield TestStep(cmd, shared.exec_dir, [source_path], - test.cxx.compile_env) + yield TestStep(cmd=cmd, env=shared.exec_env, out_files=out_files, + should_fail=not test.shouldBuild(), + dependencies=[source_path], work_dir=shared.exec_dir) def getTestSteps(self, test, lit_config, shared): - if shared.exec_file is not None: - exec_env = test.cxx.compile_env - exec_env['TMP'] = str(shared.exec_dir) - - yield TestStep([str(shared.exec_file)], shared.exec_dir, - [shared.exec_file], exec_env) - elif test.path_in_suite[-1].endswith('.fail.cpp'): - exec_dir = test.getExecDir() - source_path = Path(test.getSourcePath()) - - flags = [] - if test.cxx.name == 'cl' and \ - ('/analyze' in test.cxx.flags or - '/analyze' in test.cxx.compile_flags): - output_base = test.getOutputBaseName() - output_dir = test.getOutputDir() - analyze_path = output_dir / (output_base + - '.nativecodeanalysis.xml') - flags.append('/analyze:log' + str(analyze_path)) - - cmd, _ = test.cxx.compileCmd([source_path], os.devnull, flags) - yield TestStep(cmd, exec_dir, [source_path], - test.cxx.compile_env, True) - - -class STLDelayedExecutionStepProvider(STLStepProvider): - def getBuildSteps(self, test, lit_config, shared): - buildSteps = super().getBuildSteps(test, lit_config, shared) - build_base_name = test.getOutputBaseName() + '.build.cmd.' + if shared.exec_file is None: + return - for step, num in zip(buildSteps, itertools.count()): - build_file = test.getOutputDir() / (build_base_name + str(num)) - with build_file.open('w') as f: - step.out_handle = f - yield step + if test.test_type in (TestType.RUN_PASS, TestType.RUN_FAIL): + yield TestStep(cmd=[str(shared.exec_file)], + dependencies=[shared.exec_file], + env=shared.exec_env, + should_fail=test.test_type is TestType.RUN_FAIL, + work_dir=shared.exec_dir) - def getTestSteps(self, test, lit_config, shared): - testSteps = super().getTestSteps(test, lit_config, shared) - test_base_name = test.getOutputBaseName() + '.test.cmd.' - for step, num in zip(testSteps, itertools.count()): - test_file = test.getOutputDir() / (test_base_name + str(num)) - with test_file.open('w') as f: - step.out_handle = f - yield step +_test_suite_file_handles = {} class STLTestFormat: @@ -115,13 +84,13 @@ class STLTestFormat: """ def __init__(self, default_cxx, execute_external, - build_executor, test_executor, + build_step_writer, test_step_writer, step_provider=STLStepProvider()): self.cxx = default_cxx self.execute_external = execute_external - self.build_executor = build_executor + self.build_step_writer = build_step_writer self.step_provider = step_provider - self.test_executor = test_executor + self.test_step_writer = test_step_writer def isLegalDirectory(self, source_path, litConfig): found = False @@ -149,6 +118,14 @@ def getEnvLst(self, source_path, localConfig): def getTestsInDirectory(self, testSuite, path_in_suite, litConfig, localConfig, test_class=STLTest): + if testSuite.name not in _test_suite_file_handles: + test_list = Path(testSuite.exec_root) / 'tests.cmake' + _test_suite_file_handles[testSuite.name] = test_list.open('w') + + global_prop_string = \ + 'set_property(GLOBAL APPEND PROPERTY STL_LIT_GENERATED_FILES {})' + include_string = '\ninclude({})' + source_path = testSuite.getSourcePath(path_in_suite) if not self.isLegalDirectory(source_path, litConfig): @@ -173,17 +150,29 @@ def getTestsInDirectory(self, testSuite, path_in_suite, stl.test.file_parsing.parse_env_lst_file(envlst_path) format_string = "{:0" + str(len(str(len(env_entries)))) + \ "d}" + for env_entry, env_num \ in zip(env_entries, itertools.count()): test_config = copy.deepcopy(localConfig) test_path_in_suite = path_in_suite + (filename,) - yield test_class(testSuite, - test_path_in_suite, - litConfig, test_config, - env_entry, - format_string.format(env_num), - self.cxx) + test = test_class(testSuite, test_path_in_suite, + litConfig, test_config, env_entry, + format_string.format(env_num), + self.cxx) + + test.script_result = \ + self.getIntegratedScriptResult(test, litConfig) + + if test.script_result is None: + test_file = test.getTestFilePath().as_posix() + out_string = global_prop_string.format(test_file) + out_string += include_string.format(test_file) + out_handle = \ + _test_suite_file_handles[testSuite.name] + print(out_string, file=out_handle) + + yield test def setup(self, test): exec_dir = test.getExecDir() @@ -201,11 +190,8 @@ def setup(self, test): if path.is_file() and path.name.endswith('.dat'): shutil.copy2(path, exec_dir / path.name) - def cleanup(self, test): - pass - def getIntegratedScriptResult(self, test, lit_config): - if test.skipped: + if test.test_type is TestType.SKIPPED: return (lit.Test.SKIPPED, "Test was marked as skipped") name = test.path_in_suite[-1] @@ -228,82 +214,35 @@ def getIntegratedScriptResult(self, test, lit_config): if lit_config.noExecute: return lit.Test.Result(lit.Test.PASS) - if test.expected_result is None: - script = lit.TestRunner.parseIntegratedTestScript( - test, require_script=False) + script = lit.TestRunner.parseIntegratedTestScript( + test, require_script=False) - if isinstance(script, lit.Test.Result): - return script + if isinstance(script, lit.Test.Result): + return script return None def execute(self, test, lit_config): - result = None - while True: - try: - result = self._execute(test, lit_config) - break - except OSError as oe: - if oe.errno != errno.ETXTBSY: - raise - time.sleep(0.1) + if test.script_result is not None: + return test.script_result - return result + self.setup(test) + buildSteps, testSteps = self.step_provider.getSteps(test, lit_config) - def _execute(self, test, lit_config): - # TRANSITION: It is potentially wasteful that all the skipping and - # unsupported logic lives here when it is known at time of test - # discovery. Investigate - script_result = self.getIntegratedScriptResult(test, lit_config) - if script_result is not None: - return script_result + test_file = test.getTestFilePath() try: - self.setup(test) - pass_var, fail_var = test.getPassFailResultCodes() - buildSteps, testSteps = \ - self.step_provider.getSteps(test, lit_config) - - report = "" - for step in buildSteps: - cmd, out, err, rc, force_pass = \ - self.build_executor.run(step) - - if not force_pass: - if step.should_fail and rc == 0: - report += "Build step succeeded unexpectedly.\n" - elif rc != 0: - report += "Build step failed unexpectedly.\n" - - report += stl.util.makeReport(cmd, out, err, rc) - if (step.should_fail and rc == 0) or \ - (not step.should_fail and rc != 0): - lit_config.note(report) - return lit.Test.Result(fail_var, report) - - for step in testSteps: - cmd, out, err, rc, force_pass = \ - self.test_executor.run(step) - - if not force_pass: - if step.should_fail and rc == 0: - report += "Test step succeeded unexpectedly.\n" - elif rc != 0: - report += "Test step failed unexpectedly.\n" - - report += stl.util.makeReport(cmd, out, err, rc) - if (step.should_fail and rc == 0) or \ - (not step.should_fail and rc != 0): - lit_config.note(report) - return lit.Test.Result(fail_var, report) - - return lit.Test.Result(pass_var, report) - + with test_file.open('w') as f: + for step in buildSteps: + self.build_step_writer.write(test, step, f) + for step in testSteps: + self.test_step_writer.write(test, step, f) except Exception as e: lit_config.warning(str(e)) raise e - finally: - self.cleanup(test) + + return lit.Test.Result(lit.Test.PASS, + 'Command file was succesfully written') class LibcxxTestFormat(STLTestFormat): diff --git a/tests/utils/stl/test/tests.py b/tests/utils/stl/test/tests.py index 6555d652143..1f037321f87 100644 --- a/tests/utils/stl/test/tests.py +++ b/tests/utils/stl/test/tests.py @@ -9,17 +9,29 @@ from itertools import chain from pathlib import Path -from xml.sax.saxutils import quoteattr +import enum import os import shutil -from lit.Test import FAIL, PASS, SKIPPED, Test, UNSUPPORTED, XPASS, XFAIL +from lit.Test import Test from stl.compiler import CXXCompiler _compiler_path_cache = dict() +class TestType(enum.Enum): + COMPILE_PASS = enum.auto() + LINK_PASS = enum.auto() + RUN_PASS = enum.auto() + + COMPILE_FAIL = enum.auto() + LINK_FAIL = enum.auto() + RUN_FAIL = enum.auto() + + SKIPPED = enum.auto() + + class STLTest(Test): def __init__(self, suite, path_in_suite, lit_config, test_config, envlst_entry, env_num, default_cxx, file_path=None): @@ -27,9 +39,9 @@ def __init__(self, suite, path_in_suite, lit_config, test_config, self.skipped = False Test.__init__(self, suite, path_in_suite, test_config, file_path) - self._configure_expected_result(suite, path_in_suite, lit_config, - test_config, env_num) - if self.skipped: + self._configure_test_type(suite, path_in_suite, lit_config, + test_config, env_num) + if self.test_type is TestType.SKIPPED: return self._configure_cxx(lit_config, envlst_entry, default_cxx) @@ -54,35 +66,19 @@ def getExecDir(self): def getExecPath(self): return self.getExecDir() / (self.getOutputBaseName() + '.exe') + def getTestFilePath(self): + return self.getOutputDir() / 'test.cmake' + def getTestName(self): - return '/'.join(self.path_in_suite[:-1]) + ":" + self.env_num + return '-'.join(self.path_in_suite[:-1]) + "--" + self.env_num def getFullName(self): - return self.suite.config.name + ' :: ' + self.getTestName() + return self.suite.config.name + '--' + self.getTestName() - def getPassFailResultCodes(self): - should_fail = self.isExpectedToFail() - pass_var = XPASS if should_fail else PASS - fail_var = XFAIL if should_fail else FAIL - - return pass_var, fail_var - - def getXMLOutputTestName(self): - return ':'.join((self.path_in_suite[-2], self.env_num)) - - def getXMLOutputClassName(self): - safe_test_path = [x.replace(".", "_") for x in self.path_in_suite[:-1]] - safe_suite_name = self.suite.name.replace(".", "-") - - if safe_test_path: - return safe_suite_name + "." + "/".join(safe_test_path) - else: - return safe_suite_name + "." + safe_suite_name - - def _configure_expected_result(self, suite, path_in_suite, lit_config, - test_config, env_num): + def _configure_test_type(self, suite, path_in_suite, lit_config, + test_config, env_num): test_name = self.getTestName() - self.expected_result = None + self.test_type = None current_prefix = "" for prefix, result in \ @@ -90,23 +86,37 @@ def _configure_expected_result(self, suite, path_in_suite, lit_config, lit_config.expected_results.get(test_config.name, dict()).items()): if test_name == prefix: - self.expected_result = result - break + self.test_type = result + return elif test_name.startswith(prefix) and \ len(prefix) > len(current_prefix): current_prefix = prefix - self.expected_result = result + self.test_type = result - if test_name in test_config.expected_results: - self.expected_result = test_config.expected_results[test_name] - elif test_name in lit_config.expected_results: - self.expected_result = lit_config.expected_results[test_name] + if self.test_type is not None: + return - if self.expected_result is not None: - if self.expected_result == SKIPPED: - self.skipped = True - elif self.expected_result.isFailure: - self.xfails = ['*'] + filename = path_in_suite[-1] + if filename.endswith('.compile.pass.cpp'): + self.test_type = TestType.COMPILE_PASS + elif filename.endswith('.link.pass.cpp'): + self.test_type = TestType.LINK_PASS + elif filename.endswith('.pass.cpp'): + self.test_type = TestType.RUN_PASS + elif filename.endswith('.compile.fail.cpp'): + self.test_type = TestType.COMPILE_FAIL + elif filename.endswith('.link.fail.cpp'): + self.test_type = TestType.LINK_FAIL + elif filename.endswith('.run.fail.cpp'): + self.test_type = TestType.RUN_FAIL + elif filename.endswith('.fail.cpp'): + self.test_type = TestType.COMPILE_FAIL + else: + self.test_type = TestType.RUN_PASS + + def shouldBuild(self): + return self.test_type in (TestType.COMPILE_PASS, TestType.LINK_PASS, + TestType.RUN_PASS, TestType.RUN_FAIL) def _configure_cxx(self, lit_config, envlst_entry, default_cxx): env_compiler = envlst_entry.getEnvVal('PM_COMPILER', 'cl') @@ -143,52 +153,6 @@ def _configure_cxx(self, lit_config, envlst_entry, default_cxx): self.cxx = CXXCompiler(cxx, flags, compile_flags, link_flags, default_cxx.compile_env) - # This is partially lifted from lit's Test class. The changes here are to - # handle skipped tests, our env.lst format, and different naming schemes. - def writeJUnitXML(self, fil): - """Write the test's report xml representation to a file handle.""" - test_name = quoteattr(self.getXMLOutputTestName()) - class_name = quoteattr(self.getXMLOutputClassName()) - - testcase_template = \ - '\n\t", "]]]]>")) - fil.write("]]>\n") - elif self.result.code == UNSUPPORTED: - unsupported_features = self.getMissingRequiredFeatures() - if unsupported_features: - skip_message = \ - "Skipping because of: " + ", ".join(unsupported_features) - else: - skip_message = "Skipping because of configuration." - skip_message = quoteattr(skip_message) - - fil.write( - ">\n\t\n".format( - skip_message)) - elif self.result.code == SKIPPED: - message = quoteattr('Test is explicitly marked as skipped') - fil.write(">\n\t\n".format( - message)) - else: - fil.write("/>") - class LibcxxTest(STLTest): def getOutputBaseName(self): @@ -207,9 +171,3 @@ def getOutputDir(self): return Path(os.path.join( self.suite.getExecPath(self.path_in_suite[:-1]))) / dir_name / \ self.env_num - - def getXMLOutputTestName(self): - return ':'.join((self.path_in_suite[-1], self.env_num)) - - def getTestName(self): - return '/'.join(self.path_in_suite) + ':' + self.env_num From 9c3c5e4c4ac0f51758e42c134563663cdde1ae75 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 15:09:58 -0700 Subject: [PATCH 05/40] Some fixes --- tests/utils/stl/test/executor.py | 128 ++++++++++++++++--------------- 1 file changed, 67 insertions(+), 61 deletions(-) diff --git a/tests/utils/stl/test/executor.py b/tests/utils/stl/test/executor.py index 608fc1f5937..c8a0e2e870d 100644 --- a/tests/utils/stl/test/executor.py +++ b/tests/utils/stl/test/executor.py @@ -2,90 +2,95 @@ import os -class StepWriter: - def get_working_directory(step): - work_dir = Path() - if str(step.work_dir) == '.': - work_dir = Path(os.getcwd()) - else: - work_dir = step.work_dir - - return work_dir - - def merge_environments(current_env, updated_env, appended_vars={'PATH'}): - result_env = dict(current_env) - for k, v in updated_env.items(): - if k in appended_vars: - current_v = result_env.get(k) - if current_v: - result_env[k] = v + ';' + current_v - else: - result_env[k] = v +def get_working_directory(step): + work_dir = Path() + if str(step.work_dir) == '.': + work_dir = Path(os.getcwd()) + else: + work_dir = step.work_dir + + return work_dir + + +def merge_environments(current_env, updated_env, appended_vars={'PATH'}): + result_env = dict(current_env) + for k, v in updated_env.items(): + if k in appended_vars: + current_v = result_env.get(k) + if current_v: + result_env[k] = v + ';' + current_v else: result_env[k] = v - return result_env - - def write_step_file(self, step, step_file, test_file_handle): - env = {} - if step.env: - env = StepWriter.merge_environments(os.environ, step.env) - - out_cmd = '' - if env is not None: - for k, v in env.items(): - out_cmd += 'set ' + k + '=' + v + '\n' - - out_cmd += ('\"%s\"\n' % '\" \"'.join(step.cmd)) - - with step_file.open('w') as f: - print(out_cmd, file=f) - - global_prop_string = \ - 'set_property(GLOBAL APPEND PROPERTY STL_LIT_GENERATED_FILES {cmd})' - print(global_prop_string.format(cmd=step_file.as_posix()), - file=test_file_handle) + else: + result_env[k] = v + return result_env -class BuildStepWriter(StepWriter): +class BuildStepWriter: def write(self, test, step, test_file_handle): - build_base_name = test.getOutputBaseName() + '.build.{}.cmd' - step_file = \ - test.getOutputDir() / build_base_name.format(str(step.num)) - self.write_step_file(step, step_file, test_file_handle) + work_dir = get_working_directory(step) + + build_cmd = '"' + step.cmd[0] + '"' + args = '"' + '" "'.join(step.cmd[1:]) + '"' + build_cmd = build_cmd.replace('\\', '/') + args = args.replace('\\', '/') - work_dir = StepWriter.get_working_directory(step) + test_cmd = ('\"%s\"\n' % '\" \"'.join(step.cmd)) + test_cmd = test_cmd.replace('\\', '/').replace('"', '\\"') pass_string = \ - 'add_custom_command(OUTPUT {out} COMMAND cmd ARGS /c {cmd} DEPENDS msvcpd_implib msvcp_implib libcpmt libcpmt1 libcpmtd libcpmtd1 libcpmtd0 {cmd} {deps} WORKING_DIRECTORY {cwd})\nadd_custom_target({name} ALL DEPENDS {out})' + 'add_custom_command(OUTPUT {out} COMMAND {cmd} ARGS {args} DEPENDS msvcpd_implib msvcp_implib libcpmt libcpmt1 libcpmtd libcpmtd1 libcpmtd0 {deps} WORKING_DIRECTORY {cwd})\nadd_custom_target({name} ALL DEPENDS {out})' fail_string = \ - 'add_test(NAME {name} COMMAND cmd /c {cmd} WORKING_DIRECTORY {cwd})\nset_property(TEST {name} PROPERTY WILL_FAIL TRUE)' + 'add_test(NAME {name} COMMAND \"{cmd}\" WORKING_DIRECTORY {cwd})\nset_property(TEST {name} PROPERTY WILL_FAIL TRUE)\nset_property(TEST {name} PROPERTY ENVIRONMENT APPEND {env})' if not step.should_fail: name = test.getFullName() + '_' + str(step.num) print(pass_string.format(out=' '.join(map(lambda dep: dep.as_posix(), step.out_files)), - cmd=step_file.as_posix(), + cmd=build_cmd, + args=args, deps=' '.join(map(lambda dep: dep.as_posix(), step.dependencies)), cwd=work_dir.as_posix(), name=name), file=test_file_handle) else: - print(fail_string.format(test.getFullName(), - cmd=step_file.as_posix(), - cwd=work_dir.as_posix()), + env = {} + if step.env: + env = merge_environments(os.environ, step.env) + + env_list = [] + if env is not None: + for k, v in env.items(): + env_list.append(k + '=' + v) + cmake_env_list = \ + '\"' + '\" \"'.join(env_list).replace('\\', '/') + '\"' + + print(fail_string.format(name=test.getFullName(), + cmd=test_cmd, + cwd=work_dir.as_posix(), + env=cmake_env_list), file=test_file_handle) -class LocalTestStepWriter(StepWriter): +class LocalTestStepWriter: def write(self, test, step, test_file_handle): - test_base_name = test.getOutputBaseName() + '.test.{}.cmd' - step_file = \ - test.getOutputDir() / test_base_name.format(str(step.num)) - self.write_step_file(step, step_file, test_file_handle) + work_dir = get_working_directory(step) + + cmd = ('\"%s\"\n' % '\" \"'.join(step.cmd)) + cmd = cmd.replace('\\', '/').replace('\"', '\\\"') - work_dir = StepWriter.get_working_directory(step) + env = {} + if step.env: + env = merge_environments(os.environ, step.env) + + env_list = [] + if env is not None: + for k, v in env.items(): + env_list.append(k + '=' + v) + cmake_env_list = \ + '\"' + '\" \"'.join(env_list).replace('\\', '/') + '\"' test_string = \ - 'add_test(NAME {name} COMMAND cmd /c {cmd} WORKING_DIRECTORY {cwd})' + 'add_test(NAME {name} COMMAND cmd /c \"{cmd}\" WORKING_DIRECTORY {cwd})\nset_property(TEST {name} PROPERTY ENVIRONMENT {env})' fail_string = \ 'set_property(TEST {name} PROPERTY WILL_FAIL TRUE)' depends_string = \ @@ -93,8 +98,9 @@ def write(self, test, step, test_file_handle): test_name = '"' + test.getFullName() + '_' + str(step.num) + '"' print(test_string.format(name=test_name, - cmd=step_file.as_posix(), - cwd=work_dir.as_posix()), + cmd=cmd, + cwd=work_dir.as_posix(), + env=cmake_env_list), file=test_file_handle) if step.should_fail: From edb5e36828a77d81d8c375c7a2ddaacb2a9d87d1 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 15:17:03 -0700 Subject: [PATCH 06/40] Temporary yvals change --- stl/inc/yvals_core.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 4740700c227..d31dc1fb03c 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -439,7 +439,8 @@ _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ _Pragma("clang diagnostic ignored \"-Wignored-attributes\"") \ _Pragma("clang diagnostic ignored \"-Wuser-defined-literals\"") \ - _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") + _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") \ + _Pragma("clang diagnostic ignored \"-Wc++20-extensions\"") // clang-format on #else // __clang__ #define _STL_DISABLE_CLANG_WARNINGS From e8d01a1e0b72f3b8c05c5362e9e80ab67cd489d6 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 17:20:23 -0700 Subject: [PATCH 07/40] Resolve warning in algorithm --- stl/inc/algorithm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/algorithm b/stl/inc/algorithm index fc67058e8c8..b38bb066b12 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -46,7 +46,7 @@ struct _Optimistic_temporary_buffer { // temporary storage with _alloca-like att } const pair<_Ty*, ptrdiff_t> _Raw = _Get_temporary_buffer<_Ty>(_Attempt); - if (_Raw.second > _Optimistic_count) { // engage heap space + if (static_cast(_Raw.second) > _Optimistic_count) { // engage heap space _Data = _Raw.first; _Capacity = _Raw.second; return; From b6fd0b2935da682cb1ff3cbe4847d574ad9694e2 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 17:20:37 -0700 Subject: [PATCH 08/40] Resolve warning in random --- stl/inc/random | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stl/inc/random b/stl/inc/random index 941ab41595a..13748d3d143 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -591,7 +591,7 @@ private: // CLASS TEMPLATE _Circ_buf FOR subtract_with_carry, subtract_with_carry_01, AND mersenne_twister template struct _Circ_buf { // holds historical values for generators - _Ty _At(int _Ix) const { + _Ty _At(size_t _Ix) const { return _Ax[_Base(_Ix)]; } @@ -637,7 +637,7 @@ struct _Circ_buf { // holds historical values for generators return true; } - unsigned int _Base(int _Ix = 0) const { + size_t _Base(size_t _Ix = 0) const { return (_Ix += _Idx) < _Nw ? (_Ix + _Nw) : (_Ix - _Nw); } @@ -827,7 +827,7 @@ struct _Swc_traits { // traits for subtract_with_carry generator // otherwise compute from last value int _Kx = _Get_wc(); - for (int _Ix = 0; _Ix < _Nw; ++_Ix) { // pack _Kx words + for (size_t _Ix = 0; _Ix < _Nw; ++_Ix) { // pack _Kx words _Ax[_Ix] = _Gx(); for (int _Jx = 1; _Jx < _Kx; ++_Jx) { _Ax[_Ix] |= static_cast<_Ty>(_Gx()) << (32 * _Jx); @@ -846,7 +846,7 @@ struct _Swc_traits { // traits for subtract_with_carry generator #pragma warning(disable : 4724) // potential mod by 0 static _Cy_t _Reduce(_Ty* _Ax) { // reduce values to allowed range if _CONSTEXPR_IF (_Mx != 0) { - for (int _Ix = 0; _Ix < _Nw; ++_Ix) { + for (size_t _Ix = 0; _Ix < _Nw; ++_Ix) { _Ax[_Ix] = _Ax[_Ix] % _Mx; } } @@ -860,7 +860,7 @@ struct _Swc_traits { // traits for subtract_with_carry generator basic_ostream<_Elem, _Traits>& _Ostr, const _Circ_buf<_Ty, _Nw>& _Buf, _Cy_t _Cy) { // write state to _Ostr int _Kx = _Get_wc(); - for (int _Ix = 0; _Ix < _Nw; ++_Ix) { + for (size_t _Ix = 0; _Ix < _Nw; ++_Ix) { for (int _Jx = 1; _Jx <= _Kx; ++_Jx) { // unpack into _Kx words unsigned int _Word = static_cast(_Buf._At(_Ix) >> ((_Kx - _Jx) * 32)); _Ostr << _Word << ' '; From 7c552667a2af7ff02db5b9410b7383afa4a9d69f Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 17:21:15 -0700 Subject: [PATCH 09/40] Resolve warning in tfuns --- tests/tr1/include/tfuns.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/tr1/include/tfuns.h b/tests/tr1/include/tfuns.h index f365a8987e8..042041ed73d 100644 --- a/tests/tr1/include/tfuns.h +++ b/tests/tr1/include/tfuns.h @@ -6,6 +6,11 @@ #pragma warning(push) #pragma warning(disable : 5215) // '%s' a function parameter with volatile qualified type is deprecated in C++20 +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-volatile" +#endif + struct funobj; static int f0(); static int f1(const volatile funobj); @@ -629,3 +634,7 @@ const T& fake_lvalue(const T&& t) { // C++11 12.2 [class.temporary]/5: "A tempor } #pragma warning(pop) + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif From 1aa37d8d9374a037a61140d1b70453547de103ce Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 17:24:13 -0700 Subject: [PATCH 10/40] Another sign mismatch fix in algorithm --- stl/inc/algorithm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/algorithm b/stl/inc/algorithm index b38bb066b12..c856f33f372 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -62,7 +62,7 @@ struct _Optimistic_temporary_buffer { // temporary storage with _alloca-like att _Optimistic_temporary_buffer& operator=(const _Optimistic_temporary_buffer&) = delete; ~_Optimistic_temporary_buffer() noexcept { - if (_Capacity > _Optimistic_count) { + if (static_cast(_Capacity) > _Optimistic_count) { _Return_temporary_buffer(_Data); } } From 90c0aafaa1cb0362f9656b68243cb2c20f8669ce Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 17:28:15 -0700 Subject: [PATCH 11/40] Another sign mismatch fix in random --- stl/inc/random | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/random b/stl/inc/random index 13748d3d143..ab20dc3bb39 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -975,7 +975,7 @@ struct _Swc_01_traits { // traits for subtract_with_carry_01 generator static _Cy_t _Reset(_Gen& _Gx, _Ty* _Ax, bool _Readcy) { // set initial values of _Ax from generator _Gx // return value of _Cy from range if _Readcy is true, // otherwise from last value - for (int _Ix = 0; _Ix < _Rx; ++_Ix) { // read values + for (size_t _Ix = 0; _Ix < _Rx; ++_Ix) { // read values _Ty _Factor = 1; _Ty _Val = 0; for (int _Jx = 0; _Jx < _Nwords - 1; ++_Jx) { // read components of value From b2eae2ad9ee08665e19e1acde8fc6830bdd91cc3 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 17:32:04 -0700 Subject: [PATCH 12/40] More fixes in random --- stl/inc/random | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/stl/inc/random b/stl/inc/random index ab20dc3bb39..cf59539401f 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -736,7 +736,7 @@ protected: this->_Idx = _Rx; } - void _Setx(unsigned int _Ix, _Ty _Xis, _Ty _Xir) { // update _Ax[_Ix] and _Carry + void _Setx(unsigned size_t _Ix, _Ty _Xis, _Ty _Xir) { // update _Ax[_Ix] and _Carry bool _Underflowed = false; _Ty _Newx = _Xis; if (_Newx < _Xir) { @@ -931,8 +931,8 @@ public: unsigned long _Arr[_Kx * _Rx]; _Seq.generate(&_Arr[0], &_Arr[_Kx * _Rx]); - int _Idx0 = 0; - for (int _Ix = 0; _Ix < _Rx; ++_Ix, _Idx0 += _Kx) { // pack _Kx words + size_t _Idx0 = 0; + for (size_t _Ix = 0; _Ix < _Rx; ++_Ix, _Idx0 += _Kx) { // pack _Kx words this->_Ax[_Ix] = _Arr[_Idx0]; for (int _Jx = 1; _Jx < _Kx; ++_Jx) { this->_Ax[_Ix] |= static_cast<_Ty>(_Arr[_Idx0 + _Jx]) << (32 * _Jx); @@ -996,7 +996,7 @@ struct _Swc_01_traits { // traits for subtract_with_carry_01 generator template static void _Write( basic_ostream<_Elem, _Traits>& _Ostr, const _Circ_buf<_Ty, _Rx>& _Buf, _Cy_t _Cy) { // write state to _Ostr - for (int _Ix = 0; _Ix < _Rx; ++_Ix) { // write values + for (size_t _Ix = 0; _Ix < _Rx; ++_Ix) { // write values _Ty _Val = _Buf._At(_Ix); unsigned long _Temp; for (int _Jx = 0; _Jx < _Nwords - 1; ++_Jx) { // write components of value @@ -1090,7 +1090,7 @@ public: void seed(_Ty _X0 = default_seed, _Ty _Fx = static_cast<_Ty>(1812433253)) { // set initial values from specified value _Ty _Prev = this->_Ax[0] = _X0 & _WMSK; - for (int _Ix = 1; _Ix < _Nx; ++_Ix) { + for (size_t _Ix = 1; _Ix < _Nx; ++_Ix) { _Prev = this->_Ax[_Ix] = (_Ix + _Fx * (_Prev ^ (_Prev >> (_Wx - 2)))) & _WMSK; } @@ -1099,7 +1099,7 @@ public: template = 0> void seed(_Gen& _Gx, bool = false) { // set initial values from range - for (int _Ix = 0; _Ix < _Nx; ++_Ix) { + for (size_t _Ix = 0; _Ix < _Nx; ++_Ix) { this->_Ax[_Ix] = _Gx() & _WMSK; } @@ -1108,7 +1108,7 @@ public: template basic_ostream<_Elem, _S_Traits>& _Write(basic_ostream<_Elem, _S_Traits>& _Ostr) const { // write state to _Ostr - for (int _Ix = 0; _Ix < _Nx; ++_Ix) { + for (size_t _Ix = 0; _Ix < _Nx; ++_Ix) { _Ostr << this->_At(_Ix) << ' '; } @@ -1148,7 +1148,7 @@ protected: _Post_satisfies_(this->_Idx == 0) void _Refill_lower() { // compute values for the lower half of the history array - int _Ix; + size_t _Ix; for (_Ix = 0; _Ix < _Nx - _Mx; ++_Ix) { // fill in lower region _Ty _Tmp = (this->_Ax[_Ix + _Nx] & _HMSK) | (this->_Ax[_Ix + _Nx + 1] & _LMSK); this->_Ax[_Ix] = (_Tmp >> 1) ^ (_Tmp & 1 ? _Px : 0) ^ this->_Ax[_Ix + _Nx + _Mx]; @@ -1165,7 +1165,7 @@ protected: } void _Refill_upper() { // compute values for the upper half of the history array - int _Ix; + size_t _Ix; for (_Ix = _Nx; _Ix < 2 * _Nx; ++_Ix) { // fill in values _Ty _Tmp = (this->_Ax[_Ix - _Nx] & _HMSK) | (this->_Ax[_Ix - _Nx + 1] & _LMSK); this->_Ax[_Ix] = (_Tmp >> 1) ^ (_Tmp & 1 ? _Px : 0) ^ this->_Ax[_Ix - _Nx + _Mx]; From c76ff8568dc53c8e989fc898afd05d9d5e1cef12 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 17:34:26 -0700 Subject: [PATCH 13/40] fixup --- stl/inc/random | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/random b/stl/inc/random index cf59539401f..d80c8bee302 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -736,7 +736,7 @@ protected: this->_Idx = _Rx; } - void _Setx(unsigned size_t _Ix, _Ty _Xis, _Ty _Xir) { // update _Ax[_Ix] and _Carry + void _Setx(size_t _Ix, _Ty _Xis, _Ty _Xir) { // update _Ax[_Ix] and _Carry bool _Underflowed = false; _Ty _Newx = _Xis; if (_Newx < _Xir) { From a3cbdff12cdc13d396e242d30ea05ecbe5269eb9 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 17:49:19 -0700 Subject: [PATCH 14/40] Add a default copy constructor to avoid deprecation warning --- stl/inc/vector | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stl/inc/vector b/stl/inc/vector index 8b6f54bca9a..34f5ef91a24 100644 --- a/stl/inc/vector +++ b/stl/inc/vector @@ -1846,6 +1846,8 @@ class _Vb_reference : public _Vb_iter_base<_Alvbase_wrapped> { _Vb_reference() = default; public: + _Vb_reference(const _Vb_reference&) = default; + _Vb_reference(const _Mybase& _Right) noexcept : _Mybase(_Right._Myptr, _Right._Myoff, _Right._Getcont()) {} _Vb_reference& operator=(const _Vb_reference& _Right) noexcept { From 3e563bef4964ab7709d111d034ff062dd1dcfd82 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 22 Apr 2020 18:00:38 -0700 Subject: [PATCH 15/40] default copy assignment in tuple --- stl/inc/tuple | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stl/inc/tuple b/stl/inc/tuple index e907f02ffd3..a860730e621 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -208,6 +208,8 @@ public: constexpr tuple(const tuple&) noexcept /* strengthened */ {} // TRANSITION, ABI: should be defaulted + constexpr tuple& operator=(const tuple&) = default; + template tuple(allocator_arg_t, const _Alloc&) noexcept /* strengthened */ {} From 9861a931d5f8522db4dac91a00dde0853a9c976d Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 10:42:27 -0700 Subject: [PATCH 16/40] WIP --- tests/utils/stl/test/executor.py | 71 +++++++++++++++----------------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/tests/utils/stl/test/executor.py b/tests/utils/stl/test/executor.py index c8a0e2e870d..f57078b5d2a 100644 --- a/tests/utils/stl/test/executor.py +++ b/tests/utils/stl/test/executor.py @@ -35,81 +35,78 @@ def write(self, test, step, test_file_handle): build_cmd = build_cmd.replace('\\', '/') args = args.replace('\\', '/') - test_cmd = ('\"%s\"\n' % '\" \"'.join(step.cmd)) - test_cmd = test_cmd.replace('\\', '/').replace('"', '\\"') - pass_string = \ - 'add_custom_command(OUTPUT {out} COMMAND {cmd} ARGS {args} DEPENDS msvcpd_implib msvcp_implib libcpmt libcpmt1 libcpmtd libcpmtd1 libcpmtd0 {deps} WORKING_DIRECTORY {cwd})\nadd_custom_target({name} ALL DEPENDS {out})' + 'add_custom_command(OUTPUT {out} COMMAND {cmd} ARGS {args} DEPENDS msvcpd_implib msvcp_implib libcpmt libcpmt1 libcpmtd libcpmtd1 libcpmtd0 {deps} WORKING_DIRECTORY "{cwd}")\nadd_custom_target({name} ALL DEPENDS {out})' fail_string = \ - 'add_test(NAME {name} COMMAND \"{cmd}\" WORKING_DIRECTORY {cwd})\nset_property(TEST {name} PROPERTY WILL_FAIL TRUE)\nset_property(TEST {name} PROPERTY ENVIRONMENT APPEND {env})' + 'add_test(NAME {name} COMMAND {cmd} WORKING_DIRECTORY "{cwd}")\nset_property(TEST {name} PROPERTY WILL_FAIL TRUE)' + env_prop = \ + 'set_property(TEST {name} PROPERTY ENVIRONMENT APPEND {env})' if not step.should_fail: name = test.getFullName() + '_' + str(step.num) print(pass_string.format(out=' '.join(map(lambda dep: dep.as_posix(), step.out_files)), cmd=build_cmd, args=args, - deps=' '.join(map(lambda dep: dep.as_posix(), step.dependencies)), + deps='"' + '" "'.join(map(lambda dep: dep.as_posix(), step.dependencies)) + '"', cwd=work_dir.as_posix(), name=name), file=test_file_handle) else: - env = {} - if step.env: - env = merge_environments(os.environ, step.env) + print(fail_string.format(name=test.getFullName(), + cmd=build_cmd + ' ' + args, + cwd=work_dir.as_posix()), + file=test_file_handle) - env_list = [] - if env is not None: - for k, v in env.items(): + if len(step.env): + env_list = [] + for k, v in step.env.items(): env_list.append(k + '=' + v) - cmake_env_list = \ - '\"' + '\" \"'.join(env_list).replace('\\', '/') + '\"' + cmake_env_list = \ + '"' + '" "'.join(env_list).replace('\\', '/') + '"' - print(fail_string.format(name=test.getFullName(), - cmd=test_cmd, - cwd=work_dir.as_posix(), - env=cmake_env_list), - file=test_file_handle) + print(env_prop.format(name=test.getFullName(), + env=cmake_env_list), + file=test_file_handle) class LocalTestStepWriter: def write(self, test, step, test_file_handle): work_dir = get_working_directory(step) - cmd = ('\"%s\"\n' % '\" \"'.join(step.cmd)) - cmd = cmd.replace('\\', '/').replace('\"', '\\\"') - - env = {} - if step.env: - env = merge_environments(os.environ, step.env) - - env_list = [] - if env is not None: - for k, v in env.items(): - env_list.append(k + '=' + v) - cmake_env_list = \ - '\"' + '\" \"'.join(env_list).replace('\\', '/') + '\"' + cmd = '"' + '" "'.join(step.cmd).replace('\\', '/') + '"' test_string = \ - 'add_test(NAME {name} COMMAND cmd /c \"{cmd}\" WORKING_DIRECTORY {cwd})\nset_property(TEST {name} PROPERTY ENVIRONMENT {env})' + 'add_test(NAME {name} COMMAND {cmd} WORKING_DIRECTORY "{cwd}")' + env_prop = \ + 'set_property(TEST {name} PROPERTY ENVIRONMENT {env})' fail_string = \ 'set_property(TEST {name} PROPERTY WILL_FAIL TRUE)' depends_string = \ 'set_property(TEST {name} PROPERTY DEPENDS {prev_test})' - test_name = '"' + test.getFullName() + '_' + str(step.num) + '"' + test_name = test.getFullName() + '_' + str(step.num) print(test_string.format(name=test_name, cmd=cmd, - cwd=work_dir.as_posix(), - env=cmake_env_list), + cwd=work_dir.as_posix()), file=test_file_handle) + if len(step.env): + env_list = [] + for k, v in step.env.items(): + env_list.append(k + '=' + v) + cmake_env_list = \ + '\"' + '\" \"'.join(env_list).replace('\\', '/') + '\"' + + print(env_prop.format(name=test_name, env=cmake_env_list), + file=test_file_handle) + if step.should_fail: print(fail_string.format(name=test_name), file=test_file_handle) if step.num != 0: prev_test = \ - '"' + test.getFullName() + '_' + str(step.num - 1) + '"' + test.getFullName() + '_' + str(step.num - 1) print(depends_string.format(name=test_name, prev_test=prev_test), file=test_file_handle) From 4e18902ebe630146630c6bc735cc8b3076ab14f3 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 11:56:34 -0700 Subject: [PATCH 17/40] WIP --- tests/CMakeLists.txt | 6 +++--- .../custom_format.py | 19 ++++++++++--------- .../Dev09_056375_locale_cleanup/lit.local.cfg | 4 ++-- .../custom_format.py | 5 +++-- .../GH_000545_include_compare/lit.local.cfg | 4 ++-- .../P0607R0_inline_variables/custom_format.py | 5 +++-- .../P0607R0_inline_variables/lit.local.cfg | 4 ++-- .../custom_format.py | 12 ++++++++---- .../lit.local.cfg | 4 ++-- tests/utils/stl/test/format.py | 5 +++-- 10 files changed, 38 insertions(+), 30 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bf06f9e2ef4..b553c3bb06a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -30,11 +30,11 @@ execute_process( COMMAND ${Python3_EXECUTABLE} ${STL_LIT} #"${LIBCXX_SOURCE_DIR}/test/std" - #"${CMAKE_CURRENT_SOURCE_DIR}/std" + "${CMAKE_CURRENT_SOURCE_DIR}/std" "${CMAKE_CURRENT_SOURCE_DIR}/tr1") - #include("${CMAKE_CURRENT_BINARY_DIR}/libcxx/tests.cmake") - #include("${CMAKE_CURRENT_BINARY_DIR}/std/tests.cmake") +#include("${CMAKE_CURRENT_BINARY_DIR}/libcxx/tests.cmake") +include("${CMAKE_CURRENT_BINARY_DIR}/std/tests.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/tr1/tests.cmake") get_property(STL_LIT_GENERATED_FILES GLOBAL PROPERTY STL_LIT_GENERATED_FILES) diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/custom_format.py b/tests/std/tests/Dev09_056375_locale_cleanup/custom_format.py index 9d7c64eeaec..04f4556e853 100644 --- a/tests/std/tests/Dev09_056375_locale_cleanup/custom_format.py +++ b/tests/std/tests/Dev09_056375_locale_cleanup/custom_format.py @@ -10,10 +10,8 @@ class CustomTestFormat(STLTestFormat): def getBuildSteps(self, test, lit_config, shared): exe_source = Path(test.getSourcePath()) dll_source = exe_source.parent / 'TestDll.cpp' - shared.exec_dir = test.getExecDir() output_base = test.getOutputBaseName() output_dir = test.getOutputDir() - pass_var, fail_var = test.getPassFailResultCodes() dll_output = output_dir / 'TestDll.DLL' dll_compile_cmd, out_files, exec_file = \ @@ -24,19 +22,22 @@ def getBuildSteps(self, test, lit_config, shared): shared.dll_file = dll_output - yield TestStep(dll_compile_cmd, shared.exec_dir, [dll_source], - test.cxx.compile_env) + yield TestStep(cmd=dll_compile_cmd, dependencies=[dll_source], + env=shared.exec_dir, out_files=out_files, + work_dir=shared.exec_dir) exe_compile_cmd, out_files, shared.exec_file = \ test.cxx.executeBasedOnFlagsCmd([exe_source], output_dir, shared.exec_dir, output_base, [], [], []) - yield TestStep(exe_compile_cmd, shared.exec_dir, [exe_source], - test.cxx.compile_env) + yield TestStep(cmd=exe_compile_cmd, dependencies=[exe_source], + env=shared.exec_dir, out_files=out_files, + work_dir=shared.exec_dir, num=1) def getTestSteps(self, test, lit_config, shared): if shared.exec_file is not None: - yield TestStep([str(shared.exec_file)], shared.exec_dir, - [shared.exec_file, shared.dll_file], - test.cxx.compile_env) + yield TestStep(cmd=[str(shared.exec_file)], + dependencies=[shared.exec_file, shared.dll_file], + env=shared.exec_env, + work_dir=shared.exec_dir) diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/lit.local.cfg b/tests/std/tests/Dev09_056375_locale_cleanup/lit.local.cfg index 5a7c740f058..c24deb0f6e5 100644 --- a/tests/std/tests/Dev09_056375_locale_cleanup/lit.local.cfg +++ b/tests/std/tests/Dev09_056375_locale_cleanup/lit.local.cfg @@ -6,5 +6,5 @@ import Dev09_056375_locale_cleanup.custom_format config.test_format = \ Dev09_056375_locale_cleanup.custom_format.CustomTestFormat(config.test_format.cxx, config.test_format.execute_external, - config.test_format.build_executor, - config.test_format.test_executor) + config.test_format.build_step_writer, + config.test_format.test_step_writer) diff --git a/tests/std/tests/GH_000545_include_compare/custom_format.py b/tests/std/tests/GH_000545_include_compare/custom_format.py index 05c32016fde..44326483d24 100644 --- a/tests/std/tests/GH_000545_include_compare/custom_format.py +++ b/tests/std/tests/GH_000545_include_compare/custom_format.py @@ -24,5 +24,6 @@ def getBuildSteps(self, test, lit_config, shared): shared.exec_dir, output_base, [], [], []) - yield TestStep(cmd, shared.exec_dir, source_files, - test.cxx.compile_env) + yield TestStep(cmd=cmd, dependencies=source_files, + env=shared.exec_env, out_files=out_files, + work_dir=shared.exec_dir) diff --git a/tests/std/tests/GH_000545_include_compare/lit.local.cfg b/tests/std/tests/GH_000545_include_compare/lit.local.cfg index cbdcadad3d6..45a876991e2 100644 --- a/tests/std/tests/GH_000545_include_compare/lit.local.cfg +++ b/tests/std/tests/GH_000545_include_compare/lit.local.cfg @@ -6,5 +6,5 @@ import GH_000545_include_compare.custom_format config.test_format = \ GH_000545_include_compare.custom_format.CustomTestFormat(config.test_format.cxx, config.test_format.execute_external, - config.test_format.build_executor, - config.test_format.test_executor) + config.test_format.build_step_writer, + config.test_format.test_step_writer) diff --git a/tests/std/tests/P0607R0_inline_variables/custom_format.py b/tests/std/tests/P0607R0_inline_variables/custom_format.py index 323790ec7cb..fe7a685b08f 100644 --- a/tests/std/tests/P0607R0_inline_variables/custom_format.py +++ b/tests/std/tests/P0607R0_inline_variables/custom_format.py @@ -19,5 +19,6 @@ def getBuildSteps(self, test, lit_config, shared): output_dir, shared.exec_dir, output_base, [], [], []) - yield TestStep(cmd, shared.exec_dir, [exe_source, test2_source], - test.cxx.compile_env) + yield TestStep(cmd=cmd, dependencies=[exe_source, test2_source], + env=shared.exec_env, out_files=out_files, + work_dir=shared.exec_dir) diff --git a/tests/std/tests/P0607R0_inline_variables/lit.local.cfg b/tests/std/tests/P0607R0_inline_variables/lit.local.cfg index 55628eacde9..c6131e9e801 100644 --- a/tests/std/tests/P0607R0_inline_variables/lit.local.cfg +++ b/tests/std/tests/P0607R0_inline_variables/lit.local.cfg @@ -6,5 +6,5 @@ import P0607R0_inline_variables.custom_format config.test_format = \ P0607R0_inline_variables.custom_format.CustomTestFormat(config.test_format.cxx, config.test_format.execute_external, - config.test_format.build_executor, - config.test_format.test_executor) + config.test_format.build_step_writer, + config.test_format.test_step_writer) diff --git a/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py b/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py index 07b7dff9cfe..4fefc67422b 100644 --- a/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py +++ b/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py @@ -37,8 +37,9 @@ def getBuildSteps(self, test, lit_config, shared): [test.calling_convention_a, '/c'], [], []) - yield TestStep(a_compile_cmd, shared.exec_dir, [a_source], - test.cxx.compile_env) + yield TestStep(cmd=a_compile_cmd, dependencies=[a_source], + env=shared.exec_env, out_files=out_files, + work_dir=shared.exec_dir) a_output = output_dir / 'a.obj' @@ -48,5 +49,8 @@ def getBuildSteps(self, test, lit_config, shared): [test.calling_convention_b, str(a_output)], [], []) - yield TestStep(exe_compile_cmd, shared.exec_dir, - [a_output, exe_source], test.cxx.compile_env) + yield TestStep(cmd=exe_compile_cmd, + dependencies=[a_output, exe_source], + env=shared.exec_env, + out_files=out_files, + work_dir=shared.exec_dir) diff --git a/tests/std/tests/VSO_0000000_any_calling_conventions/lit.local.cfg b/tests/std/tests/VSO_0000000_any_calling_conventions/lit.local.cfg index 9f4ac1b16d8..6928db9f865 100644 --- a/tests/std/tests/VSO_0000000_any_calling_conventions/lit.local.cfg +++ b/tests/std/tests/VSO_0000000_any_calling_conventions/lit.local.cfg @@ -8,5 +8,5 @@ import VSO_0000000_any_calling_conventions.custom_format config.test_format = \ VSO_0000000_any_calling_conventions.custom_format.CustomTestFormat(config.test_format.cxx, config.test_format.execute_external, - config.test_format.build_executor, - config.test_format.test_executor) + config.test_format.build_step_writer, + config.test_format.test_step_writer) diff --git a/tests/utils/stl/test/format.py b/tests/utils/stl/test/format.py index 628e4d4da5c..d882ac7229c 100644 --- a/tests/utils/stl/test/format.py +++ b/tests/utils/stl/test/format.py @@ -59,9 +59,10 @@ def getBuildSteps(self, test, lit_config, shared): shared.exec_dir, output_base, [], [], []) - yield TestStep(cmd=cmd, env=shared.exec_env, out_files=out_files, + yield TestStep(cmd=cmd, dependencies=[source_path], + env=shared.exec_env, out_files=out_files, should_fail=not test.shouldBuild(), - dependencies=[source_path], work_dir=shared.exec_dir) + work_dir=shared.exec_dir) def getTestSteps(self, test, lit_config, shared): if shared.exec_file is None: From ee300ce32ae4c5b10e1ee751ef07f53377dd9206 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 12:20:37 -0700 Subject: [PATCH 18/40] Make _Raise [[noreturn]] --- stl/inc/exception | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/exception b/stl/inc/exception index 95a16c6e8da..09e285d6d13 100644 --- a/stl/inc/exception +++ b/stl/inc/exception @@ -104,7 +104,7 @@ public: return _Ptr ? _Ptr : "unknown exception"; } - void __CLR_OR_THIS_CALL _Raise() const { // raise the exception + [[noreturn]] void __CLR_OR_THIS_CALL _Raise() const { // raise the exception if (_STD _Raise_handler) { (*_STD _Raise_handler)(*this); // call raise handler if present } From 1a2af387e7d2399862554e1fd99f0861e493dfca Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 14:38:23 -0700 Subject: [PATCH 19/40] Make _HAS_EXCEPTIONS=0 terminate call _CSTD abort() --- stl/inc/exception | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stl/inc/exception b/stl/inc/exception index 09e285d6d13..42539ed38d0 100644 --- a/stl/inc/exception +++ b/stl/inc/exception @@ -171,7 +171,8 @@ inline terminate_handler __CRTDECL set_terminate(terminate_handler) noexcept { / return nullptr; } -inline void __CRTDECL terminate() noexcept { // handle exception termination +[[noreturn]] inline void __CRTDECL terminate() noexcept { // handle exception termination + _CSTD abort(); } _NODISCARD inline terminate_handler __CRTDECL get_terminate() noexcept { // get current terminate handler From 7811ae563920fc026f224baaa691f9c875e6fce7 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 14:39:31 -0700 Subject: [PATCH 20/40] Don't override /Od with /O2 --- tests/std/tests/fast_matrix.lst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/std/tests/fast_matrix.lst b/tests/std/tests/fast_matrix.lst index 3fbd3356cf7..0be33c5b9fa 100644 --- a/tests/std/tests/fast_matrix.lst +++ b/tests/std/tests/fast_matrix.lst @@ -2,6 +2,4 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # This is for tests that take a long time to execute, so run only one configuration. -RUNALL_INCLUDE .\prefix.lst -RUNALL_CROSSLIST -PM_CL="/EHsc /MT /O2 /GL /std:c++latest /analyze /w14640 /Zc:threadSafeInit-" +PM_CL="/nologo /W4 /w14061 /w14242 /w14265 /w14365 /w14582 /w14583 /w14587 /w14588 /w14749 /w14841 /w14842 /w15038 /w15214 /w15215 /w15216 /w15217 /sdl /WX /Zc:strictStrings /D_ENABLE_STL_INTERNAL_CHECK /D_ENFORCE_FACET_SPECIALIZATIONS=1 /bigobj /EHsc /MT /O2 /GL /std:c++latest /analyze /w14640 /Zc:threadSafeInit-" From 887d37b451e31a60e0b9444c4b250b2453767b09 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 15:06:56 -0700 Subject: [PATCH 21/40] fixups for custom formats --- tests/utils/stl/test/config.py | 4 +--- tests/utils/stl/test/format.py | 36 +++++++++++++++------------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/tests/utils/stl/test/config.py b/tests/utils/stl/test/config.py index 4f23caf9e28..53ecdd764b5 100644 --- a/tests/utils/stl/test/config.py +++ b/tests/utils/stl/test/config.py @@ -41,7 +41,6 @@ def __init__(self, lit_config, config): self.link_shared = True self.long_tests = None self.msvc_toolset_libs_root = None - self.step_provider = None self.stl_build_root = None self.stl_inc_env_var = None self.stl_lib_env_var = None @@ -421,8 +420,7 @@ def get_test_format(self): self.default_compiler, self.execute_external, self.build_step_writer, - self.test_step_writer, - stl.test.format.STLStepProvider()) + self.test_step_writer) # TRANSITION: Might be nice to actually print something def print_config_info(self): diff --git a/tests/utils/stl/test/format.py b/tests/utils/stl/test/format.py index d882ac7229c..3c9f1c17300 100644 --- a/tests/utils/stl/test/format.py +++ b/tests/utils/stl/test/format.py @@ -33,7 +33,21 @@ class TestStep: work_dir: os.PathLike = field(default=Path('.')) -class STLStepProvider: +_test_suite_file_handles = {} + + +class STLTestFormat: + """ + Custom test format handler to run MSVC tests. + """ + + def __init__(self, default_cxx, execute_external, + build_step_writer, test_step_writer): + self.cxx = default_cxx + self.execute_external = execute_external + self.build_step_writer = build_step_writer + self.test_step_writer = test_step_writer + def getSteps(self, test, lit_config): class SharedState: def __init__(self, test): @@ -75,24 +89,6 @@ def getTestSteps(self, test, lit_config, shared): should_fail=test.test_type is TestType.RUN_FAIL, work_dir=shared.exec_dir) - -_test_suite_file_handles = {} - - -class STLTestFormat: - """ - Custom test format handler to run MSVC tests. - """ - - def __init__(self, default_cxx, execute_external, - build_step_writer, test_step_writer, - step_provider=STLStepProvider()): - self.cxx = default_cxx - self.execute_external = execute_external - self.build_step_writer = build_step_writer - self.step_provider = step_provider - self.test_step_writer = test_step_writer - def isLegalDirectory(self, source_path, litConfig): found = False for prefix in getattr(litConfig, 'test_subdirs', []): @@ -228,7 +224,7 @@ def execute(self, test, lit_config): return test.script_result self.setup(test) - buildSteps, testSteps = self.step_provider.getSteps(test, lit_config) + buildSteps, testSteps = self.getSteps(test, lit_config) test_file = test.getTestFilePath() From 0bc36e0efad57a31e9a7673e2d555ac8b892ae68 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 15:09:49 -0700 Subject: [PATCH 22/40] Another fixup --- .../tests/VSO_0000000_any_calling_conventions/custom_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py b/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py index 4fefc67422b..51d685d686a 100644 --- a/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py +++ b/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py @@ -53,4 +53,4 @@ def getBuildSteps(self, test, lit_config, shared): dependencies=[a_output, exe_source], env=shared.exec_env, out_files=out_files, - work_dir=shared.exec_dir) + work_dir=shared.exec_dir, num=1) From 6184fdceb963192c291bf77e293c0c4cad8d7e58 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 15:25:40 -0700 Subject: [PATCH 23/40] Fixup output files --- tests/utils/stl/compiler.py | 90 ++++--------------------------------- 1 file changed, 8 insertions(+), 82 deletions(-) diff --git a/tests/utils/stl/compiler.py b/tests/utils/stl/compiler.py index 6a638046938..84a909cb8d4 100644 --- a/tests/utils/stl/compiler.py +++ b/tests/utils/stl/compiler.py @@ -11,8 +11,6 @@ from typing import List import os -import stl.util - class CXXCompiler: CM_Default = 0 @@ -35,7 +33,7 @@ def __init__(self, path, flags=None, compile_flags=None, self.compile_env = compile_env - def _basicCmd(self, source_files: List[Path], out: Path, + def _basicCmd(self, source_files: List[Path], out: Path, cwd: Path, mode=CM_Default, flags=[], compile_flags=[], link_flags=[], skip_mode_flags=False): out_files = [] @@ -59,7 +57,7 @@ def _basicCmd(self, source_files: List[Path], out: Path, else: for source_file in source_files: out_files.append( - Path(source_file.name.rsplit('.', 1)[0] + '.obj')) + cwd / (source_file.name.rsplit('.', 1)[0] + '.obj')) elif mode == self.CM_Analyze: if not skip_mode_flags: cmd.append('/analyze:only') @@ -68,8 +66,8 @@ def _basicCmd(self, source_files: List[Path], out: Path, else: for source_file in source_files: out_files.append( - Path(source_file.name.rsplit('.', 1)[0] + - '.nativecodeanalysis.xml')) + cwd / (source_file.name.rsplit('.', 1)[0] + + '.nativecodeanalysis.xml')) elif out is not None: cmd.append('/Fe' + str(out)) @@ -80,7 +78,7 @@ def _basicCmd(self, source_files: List[Path], out: Path, else: for source_file in source_files: out_files.append( - Path(source_file.name.rsplit('.', 1)[0] + '.obj')) + cwd / (source_file.name.rsplit('.', 1)[0] + '.obj')) if mode in (self.CM_Analyze, self.CM_Compile, self.CM_Default): cmd.extend(self.compile_flags) @@ -97,7 +95,7 @@ def _basicCmd(self, source_files: List[Path], out: Path, return cmd, out_files - def executeBasedOnFlagsCmd(self, source_files, out_dir, cwd=None, + def executeBasedOnFlagsCmd(self, source_files, out_dir, cwd, out_base=None, flags=[], compile_flags=[], link_flags=[]): mode = self.CM_Default @@ -133,78 +131,6 @@ def executeBasedOnFlagsCmd(self, source_files, out_dir, cwd=None, flags.append('/analyze:log' + str(out_dir / (out_base + '.nativecodeanalysis.xml'))) - cmd, out_files = self._basicCmd(source_files, output_file, mode, flags, - compile_flags, link_flags, True) + cmd, out_files = self._basicCmd(source_files, output_file, cwd, mode, + flags, compile_flags, link_flags, True) return cmd, out_files, exec_file - - def executeBasedOnFlags(self, source_files, out_dir, cwd=None, - out_base=None, flags=[], compile_flags=[], - link_flags=[]): - cmd, out_files, exec_file = \ - self.executeBasedOnFlagsCmd(source_files, out_dir, cwd, out_base, - flags, compile_flags, link_flags) - out, err, rc = stl.util.executeCommand(cmd, env=self.compile_env, - cwd=cwd) - return cmd, out, err, rc, out_files, exec_file - - def preprocessCmd(self, source_files, out=None, flags=[]): - return self._basicCmd(source_files, out, flags=flags, compile_flags=[], - link_flags=[], mode=self.CM_PreProcess) - - def compileCmd(self, source_files, out=None, flags=[]): - return self._basicCmd(source_files, out, flags=flags, compile_flags=[], - link_flags=[], mode=self.CM_Compile) - - def linkCmd(self, source_files, out=None, flags=[]): - return self._basicCmd(source_files, out, flags=flags, compile_flags=[], - link_flags=[], mode=self.CM_Link) - - def compileLinkCmd(self, source_files, out=None, flags=[]): - return self._basicCmd(source_files, out, flags=flags, compile_flags=[], - link_flags=[]) - - def preprocess(self, source_files, out=None, flags=[], cwd=None): - cmd, _ = self.preprocessCmd(source_files, out, flags) - out, err, rc = stl.util.executeCommand(cmd, env=self.compile_env, - cwd=cwd) - return cmd, out, err, rc - - def compile(self, source_files, out=None, flags=[], cwd=None): - cmd, _ = self.compileCmd(source_files, out, flags) - out, err, rc = stl.util.executeCommand(cmd, env=self.compile_env, - cwd=cwd) - return cmd, out, err, rc - - def link(self, source_files, exec_path=None, flags=[], cwd=None): - cmd, _ = self.linkCmd(source_files, exec_path, flags) - out, err, rc = stl.util.executeCommand(cmd, env=self.compile_env, - cwd=cwd) - return cmd, out, err, rc - - def compileLink(self, source_files, exec_path=None, flags=[], - cwd=None): - cmd, _ = self.compileLinkCmd(source_files, exec_path, flags) - out, err, rc = stl.util.executeCommand(cmd, env=self.compile_env, - cwd=cwd) - return cmd, out, err, rc - - def compileLinkTwoSteps(self, source_file, out=None, object_file=None, - flags=[], cwd=None): - if not isinstance(source_file, str): - raise TypeError('This function only accepts a single input file') - if object_file is None: - # Create, use, and delete a temporary object file if none is given. - def with_fn(): return stl.util.guardedTempFilename(suffix='.obj') - else: - # Otherwise wrap the filename in a context manager function. - def with_fn(): return stl.util.nullContext(object_file) - with with_fn() as object_file: - cc_cmd, cc_stdout, cc_stderr, rc = self.compile( - source_file, object_file, flags=flags, cwd=cwd) - if rc != 0: - return cc_cmd, cc_stdout, cc_stderr, rc - - link_cmd, link_stdout, link_stderr, rc = self.link( - object_file, exec_path=out, flags=flags, cwd=cwd) - return (cc_cmd + ['&'] + link_cmd, cc_stdout + link_stdout, - cc_stderr + link_stderr, rc) From c25d001b2c533032aec68583f660ff4a9d60af5d Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 15:30:17 -0700 Subject: [PATCH 24/40] fixup charconv env.lst --- tests/std/tests/P0067R5_charconv/env.lst | 30 +++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/std/tests/P0067R5_charconv/env.lst b/tests/std/tests/P0067R5_charconv/env.lst index 7194073a8e2..a71642859de 100644 --- a/tests/std/tests/P0067R5_charconv/env.lst +++ b/tests/std/tests/P0067R5_charconv/env.lst @@ -1,6 +1,34 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -RUNALL_INCLUDE ..\usual_17_matrix.lst +PM_CL="/nologo /W4 /w14061 /w14242 /w14265 /w14365 /w14582 /w14583 /w14587 /w14588 /w14749 /w14841 /w14842 /w15038 /w15214 /w15215 /w15216 /w15217 /sdl /WX /Zc:strictStrings /D_ENABLE_STL_INTERNAL_CHECK /D_ENFORCE_FACET_SPECIALIZATIONS=1 /bigobj" +RUNALL_CROSSLIST +PM_CL="/w14640 /Zc:threadSafeInit-" +RUNALL_CROSSLIST +PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest" +PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++17" +PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest" +PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /Zc:char8_t-" +PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /Zc:wchar_t-" +PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest" +PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++latest /fp:except" +PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++17 /permissive-" +PM_CL="/EHsc /MT /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /await" +PM_CL="/EHsc /MT /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /analyze:only" +PM_CL="/EHsc /MT /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest" +PM_CL="/EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /fp:strict" +PM_CL="/EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest" +PM_CL="/EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++latest /await" +PM_CL="/EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++latest /analyze:only" +PM_CL="/Za /EHsc /MD /std:c++latest /permissive-" +PM_CL="/Za /EHsc /MDd /std:c++latest /permissive-" +PM_CL="/clr /MD /std:c++17" +PM_CL="/clr /MDd /std:c++17" +PM_CL="/BE /c /EHsc /MD /std:c++latest" +PM_CL="/BE /c /EHsc /MDd /std:c++17 /permissive-" +PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive-" +PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MD /std:c++latest" +PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MDd /std:c++17" +PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MTd /std:c++latest /fp:strict" RUNALL_CROSSLIST PM_CL="/O2 /wd4793" From 28a8b8e56d4611a05b719089e3bc439239316b58 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 15:40:32 -0700 Subject: [PATCH 25/40] Suppress deprecation warnings --- tests/std/tests/P0758R1_is_nothrow_convertible/test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/std/tests/P0758R1_is_nothrow_convertible/test.cpp b/tests/std/tests/P0758R1_is_nothrow_convertible/test.cpp index 7318e562b7d..379f2e097e3 100644 --- a/tests/std/tests/P0758R1_is_nothrow_convertible/test.cpp +++ b/tests/std/tests/P0758R1_is_nothrow_convertible/test.cpp @@ -42,6 +42,11 @@ struct ConvertibleToAnything { struct Tiger : Cat {}; +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-volatile" +#endif + STATIC_ASSERT(!is_nothrow_convertible::value); STATIC_ASSERT(!is_nothrow_convertible_v); STATIC_ASSERT(!is_nothrow_convertible::value); @@ -107,5 +112,9 @@ STATIC_ASSERT(is_nothrow_convertible_v); STATIC_ASSERT(!is_nothrow_convertible_v); STATIC_ASSERT(!is_nothrow_convertible_v); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + // VSO_0105317_expression_sfinae and VSO_0000000_type_traits provide // additional coverage of this machinery From d9829e29e6c57bb603c74598918525dcbb885c72 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 15:47:06 -0700 Subject: [PATCH 26/40] Rever test change --- tests/std/tests/P0758R1_is_nothrow_convertible/test.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/std/tests/P0758R1_is_nothrow_convertible/test.cpp b/tests/std/tests/P0758R1_is_nothrow_convertible/test.cpp index 379f2e097e3..7318e562b7d 100644 --- a/tests/std/tests/P0758R1_is_nothrow_convertible/test.cpp +++ b/tests/std/tests/P0758R1_is_nothrow_convertible/test.cpp @@ -42,11 +42,6 @@ struct ConvertibleToAnything { struct Tiger : Cat {}; -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-volatile" -#endif - STATIC_ASSERT(!is_nothrow_convertible::value); STATIC_ASSERT(!is_nothrow_convertible_v); STATIC_ASSERT(!is_nothrow_convertible::value); @@ -112,9 +107,5 @@ STATIC_ASSERT(is_nothrow_convertible_v); STATIC_ASSERT(!is_nothrow_convertible_v); STATIC_ASSERT(!is_nothrow_convertible_v); -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - // VSO_0105317_expression_sfinae and VSO_0000000_type_traits provide // additional coverage of this machinery From 84370c54231b54d8fab3f15873a5d4ed92815c0e Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 15:47:30 -0700 Subject: [PATCH 27/40] Suppress volatile deprecation warning in type_traits --- stl/inc/type_traits | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index d2c65b34ebe..723cb498562 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -823,6 +823,12 @@ struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty template _INLINE_VAR constexpr bool is_trivially_destructible_v = __is_trivially_destructible(_Ty); + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-volatile" +#endif + // NOTHROW TRAITS // STRUCT TEMPLATE is_nothrow_constructible template @@ -1665,6 +1671,12 @@ struct _Invoker_ret<_Unforced, false> { // selected for _Rx being _Unforced #pragma warning(disable : 4244) // 'argument': conversion from '_From' to '_To', possible loss of data #pragma warning(disable : 4365) // 'argument': conversion from '_From' to '_To', signed/unsigned mismatch (/Wall) #pragma warning(disable : 5215) // '%s' a function parameter with a volatile qualified type is deprecated in C++20 + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-volatile" +#endif + template void _Implicitly_convert_to(_To) noexcept; // not defined @@ -2360,5 +2372,10 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + #endif // _STL_COMPILER_PREPROCESSOR #endif // _TYPE_TRAITS_ From 0c2111179f40e53a21dc839803eb886170f9cfec Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 15:52:54 -0700 Subject: [PATCH 28/40] Fixup bad sign compare in cvt/one_one --- stl/inc/cvt/one_one | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stl/inc/cvt/one_one b/stl/inc/cvt/one_one index 52d7e72c0c6..de4c7e09e8f 100644 --- a/stl/inc/cvt/one_one +++ b/stl/inc/cvt/one_one @@ -58,7 +58,8 @@ namespace stdext { _Mid1 = _First1; _Mid2 = _First2; - while (_Bytes_per_word <= _Last1 - _Mid1 && _Mid2 != _Last2) { // convert a multibyte sequence + while (_Bytes_per_word <= static_cast(_Last1 - _Mid1) && _Mid2 != _Last2) { + // convert a multibyte sequence const auto _Ptr = reinterpret_cast(_Mid1); unsigned long _Ch = 0; @@ -147,7 +148,8 @@ namespace stdext { } } - while (_Mid1 != _Last1 && _Bytes_per_word <= _Last2 - _Mid2) { // convert and put a wide char + while (_Mid1 != _Last1 && _Bytes_per_word <= static_cast(_Last2 - _Mid2)) { + // convert and put a wide char unsigned long _Ch = static_cast(*_Mid1++); if (_Maxcode < _Ch) { From 5bd08d623b8c00b7489e028391686b59f90bd149 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Thu, 23 Apr 2020 16:07:37 -0700 Subject: [PATCH 29/40] Suppress volatile deprecation warning --- tests/std/tests/P0088R3_variant/env.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/P0088R3_variant/env.lst b/tests/std/tests/P0088R3_variant/env.lst index 2d80e9188f7..e1f7d138ae9 100644 --- a/tests/std/tests/P0088R3_variant/env.lst +++ b/tests/std/tests/P0088R3_variant/env.lst @@ -7,7 +7,7 @@ RUNALL_INCLUDE ..\prefix.lst RUNALL_CROSSLIST -PM_CL="/w14640 /Zc:threadSafeInit-" +PM_CL="/w14640 /Zc:threadSafeInit- /D_SILENCE_CXX20_VOLATILE_DEPRECATION_WARNING" RUNALL_CROSSLIST PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /DCONSTEXPR_NOTHROW" PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++17 /DCONSTEXPR_NOTHROW" From 05e4d9ae04ee1531ebd6598794eae0714ccdc421 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 24 Apr 2020 13:53:27 -0700 Subject: [PATCH 30/40] Fix VSO-609129 and provide test coverage --- stl/inc/cvt/sjis_0208 | 2 +- tests/tr1/tests/cvt/sjis_0208/test.cpp | 95 +++++++++++++++++++++++++- 2 files changed, 93 insertions(+), 4 deletions(-) diff --git a/stl/inc/cvt/sjis_0208 b/stl/inc/cvt/sjis_0208 index df52f0ab242..d2b2d89ac07 100644 --- a/stl/inc/cvt/sjis_0208 +++ b/stl/inc/cvt/sjis_0208 @@ -57,7 +57,7 @@ namespace stdext { // convert 2-byte code unsigned char _By2 = static_cast(*++_Mid1); - if ((_By2 < 0x40 || 0x7e < _By2) && (_By2 < 0x80 && 0xfc < _By2)) { // TRANSITION, VSO-609129 + if (_By2 < 0x40 || _By2 == 0x7f || _By2 > 0xfc) { return _Mybase::error; // bad second byte } diff --git a/tests/tr1/tests/cvt/sjis_0208/test.cpp b/tests/tr1/tests/cvt/sjis_0208/test.cpp index 1b889584c24..27984cf0caf 100644 --- a/tests/tr1/tests/cvt/sjis_0208/test.cpp +++ b/tests/tr1/tests/cvt/sjis_0208/test.cpp @@ -1,11 +1,100 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#include + #include "tdefs.h" #include -#define NCHARS 0x10000 -#define MYWC_MAX 0x7e7e #define MYFILE "sjis_0208" -#define MYNAME stdext::cvt::codecvt_sjis_0208 +#define MYNAME stdext::cvt::codecvt_sjis_0208 +#define MYMAKE mymake +#define MYWCHAR wchar_t + +using namespace std; + +using Myistream = basic_istream; +using Myostream = basic_ostream; +using Mystring = basic_string; +using Mysconvert = stdext::cvt::wstring_convert; + +Mystring mymake() { + Mystring mystring; + Mysconvert myconv(""); + + // All ASCII and modified ASCII characters single byte characters + for (unsigned long ch = 0; ch <= 0x7f; ++ch) { + string buf = myconv.to_bytes((MYWCHAR) ch); + if (0 < buf.size() && ch != static_cast(WEOF)) { + mystring.insert(mystring.end(), (MYWCHAR) ch); + } + } + + // All single byte katakana + for (unsigned long ch = 0xa1; ch <= 0xe0; ++ch) { + string buf = myconv.to_bytes((MYWCHAR) ch); + if (0 < buf.size() && ch != static_cast(WEOF)) { + mystring.insert(mystring.end(), (MYWCHAR) ch); + } + } + + // First set of two byte characters with odd first bytes + for (unsigned long ch = 0x8100; ch <= 0xa000; ch += 0x0200) { + for (unsigned long offset = 0x40; offset < 0x7f; ++offset) { + string buf = myconv.to_bytes((MYWCHAR) (ch + offset)); + if (0 < buf.size() && (ch + offset) != static_cast(WEOF)) { + mystring.insert(mystring.end(), (MYWCHAR) (ch + offset)); + } + } + + for (unsigned long offset = 0x8A; offset < 0x9f; ++offset) { + string buf = myconv.to_bytes((MYWCHAR) (ch + offset)); + if (0 < buf.size() && (ch + offset) != static_cast(WEOF)) { + mystring.insert(mystring.end(), (MYWCHAR) (ch + offset)); + } + } + } + + // First set of two byte characters with even first bytes + for (unsigned long ch = 0x8200; ch <= 0xa000; ch += 0x0200) { + for (unsigned long offset = 0x9f; offset < 0xfd; ++offset) { + string buf = myconv.to_bytes((MYWCHAR) (ch + offset)); + if (0 < buf.size() && (ch + offset) != static_cast(WEOF)) { + mystring.insert(mystring.end(), (MYWCHAR) (ch + offset)); + } + } + } + + // Second set of two byte characters with odd first bytes + for (unsigned long ch = 0xe100; ch <= 0xf000; ch += 0x0200) { + for (unsigned long offset = 0x40; offset < 0x7f; ++offset) { + string buf = myconv.to_bytes((MYWCHAR) (ch + offset)); + if (0 < buf.size() && (ch + offset) != static_cast(WEOF)) { + mystring.insert(mystring.end(), (MYWCHAR) (ch + offset)); + } + } + + for (unsigned long offset = 0x8A; offset < 0x9f; ++offset) { + string buf = myconv.to_bytes((MYWCHAR) (ch + offset)); + if (0 < buf.size() && (ch + offset) != static_cast(WEOF)) { + mystring.insert(mystring.end(), (MYWCHAR) (ch + offset)); + } + } + } + + // Second set of two byte characters with even first bytes + for (unsigned long ch = 0xe000; ch <= 0xf000; ch += 0x0200) { + for (unsigned long offset = 0x9f; offset < 0xfd; ++offset) { + string buf = myconv.to_bytes((MYWCHAR) (ch + offset)); + if (0 < buf.size() && (ch + offset) != static_cast(WEOF)) { + mystring.insert(mystring.end(), (MYWCHAR) (ch + offset)); + } + } + } + + return mystring; +} + #include From e48ddaa83ccf4d2cfeae0f18a5671f785459fad2 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 24 Apr 2020 13:53:48 -0700 Subject: [PATCH 31/40] Silence warnings in xutility --- stl/inc/xutility | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stl/inc/xutility b/stl/inc/xutility index 83693c452fe..5ae7c01a9a7 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -4941,7 +4941,8 @@ _NODISCARD _CONSTEXPR20 _InIt _Find_unchecked1(_InIt _First, const _InIt _Last, #ifdef __cpp_lib_is_constant_evaluated if (_STD is_constant_evaluated()) { - return _Find_unchecked1(_First, _Last, _Val, false_type{}); + using _Elem = remove_pointer_t<_InIt>; + return _Find_unchecked1(_First, _Last, static_cast<_Elem>(_Val), false_type{}); } #endif // __cpp_lib_is_constant_evaluated _First = From bb447f60af65812c372785af956f87f8bea5344c Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 24 Apr 2020 13:54:05 -0700 Subject: [PATCH 32/40] silence warnings in yvals.h --- stl/inc/yvals.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index 4c4394d642c..a9e456e6e7b 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -184,6 +184,20 @@ _STL_DISABLE_CLANG_WARNINGS _CRT_SECURE_INVALID_PARAMETER(mesg); \ } while (false) +#ifdef __clang__ +#define _STL_VERIFY(cond, mesg) \ +_Pragma("clang diagnostic push") \ +_Pragma("clang diagnostic ignored \"-Wassume\"") \ + do { \ + if (cond) { /* contextually convertible to bool paranoia */ \ + } else { \ + _STL_REPORT_ERROR(mesg); \ + } \ + \ + _Analysis_assume_(cond); \ + } while (false) \ +_Pragma("clang diagnostic pop") +#else // ^^^ clang // msvc vvv #define _STL_VERIFY(cond, mesg) \ do { \ if (cond) { /* contextually convertible to bool paranoia */ \ @@ -193,6 +207,7 @@ _STL_DISABLE_CLANG_WARNINGS \ _Analysis_assume_(cond); \ } while (false) +#endif // msvc #ifdef _DEBUG #define _STL_ASSERT(cond, mesg) _STL_VERIFY(cond, mesg) From 389e857ccb2b130eb609e9ff5396ca9b09007d44 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 24 Apr 2020 13:54:42 -0700 Subject: [PATCH 33/40] Silence warning in memchr opt test --- tests/std/tests/Dev11_0316853_find_memchr_optimization/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/Dev11_0316853_find_memchr_optimization/test.cpp b/tests/std/tests/Dev11_0316853_find_memchr_optimization/test.cpp index 0dafea350eb..6e6475be2f9 100644 --- a/tests/std/tests/Dev11_0316853_find_memchr_optimization/test.cpp +++ b/tests/std/tests/Dev11_0316853_find_memchr_optimization/test.cpp @@ -79,7 +79,7 @@ int main() { // Make sure we don't look for 0x11 bytes in the range! assert(find(v.begin(), v.end(), 0xAABBCCDDUL) == v.begin() + 2); - assert(find(v.begin(), v.end(), 0x11) == v.end()); + assert(find(v.begin(), v.end(), 0x11UL) == v.end()); } { // Optimization inapplicable due to bogus value type (although the element type is good) From f3444632beb4c3451d252a99d9222e956295a812 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 24 Apr 2020 13:55:15 -0700 Subject: [PATCH 34/40] Don't set LIB, LIBPATH or INCLUDE for tests --- tests/utils/stl/test/config.py | 46 ---------------------------------- 1 file changed, 46 deletions(-) diff --git a/tests/utils/stl/test/config.py b/tests/utils/stl/test/config.py index 53ecdd764b5..677d83176a7 100644 --- a/tests/utils/stl/test/config.py +++ b/tests/utils/stl/test/config.py @@ -42,7 +42,6 @@ def __init__(self, lit_config, config): self.long_tests = None self.msvc_toolset_libs_root = None self.stl_build_root = None - self.stl_inc_env_var = None self.stl_lib_env_var = None self.stl_path_env_var = None self.stl_src_root = None @@ -237,42 +236,6 @@ def configure_library_roots(self): self.cxx_runtime_root = Path(cxx_runtime_root) self.cxx_library_root = Path(cxx_library_root) - def configure_inc_env_var(self): - stl_inc_env_var = self.get_lit_conf('stl_inc_env_var', None) - - if stl_inc_env_var is None: - stl_inc_env_var = self.config.environment.get('INCLUDE', '') - - if self.cxx_headers is None: - self.configure_cxx_headers() - - include_dirs = self.get_lit_conf('include_dirs', []) - - if stl_inc_env_var != '': - stl_inc_env_var = ';'.join((str(self.cxx_headers), - *include_dirs, - stl_inc_env_var)) - else: - stl_inc_env_var = ';'.join((str(self.cxx_headers), - *include_dirs)) - - self.stl_inc_env_var = stl_inc_env_var - - # Note: This relies on kernel32.lib and ucrt.lib being in the LIB env var - def configure_lib_env_var(self): - stl_lib_env_var = self.get_lit_conf('stl_lib_env_var', None) - - if stl_lib_env_var is None: - stl_lib_env_var = self.config.environment.get('LIB', '') - - if stl_lib_env_var != '': - stl_lib_env_var = ';'.join((str(self.cxx_library_root), - stl_lib_env_var)) - else: - stl_lib_env_var = str(self.cxx_library_root) - - self.stl_lib_env_var = stl_lib_env_var - def configure_path_env_var(self): stl_path_env_var = self.get_lit_conf('stl_path_env_var', None) @@ -296,19 +259,10 @@ def configure_path_env_var(self): self.stl_path_env_var = stl_path_env_var def configure_test_env(self): - if self.stl_lib_env_var is None: - self.configure_inc_env_var() - - if self.stl_lib_env_var is None: - self.configure_lib_env_var() - if self.stl_path_env_var is None: self.configure_path_env_var() stl_test_env = {} - stl_test_env['INCLUDE'] = self.stl_inc_env_var - stl_test_env['LIB'] = self.stl_lib_env_var - stl_test_env['LIBPATH'] = self.stl_lib_env_var stl_test_env['PATH'] = self.stl_path_env_var self.config.environment = stl_test_env From 1b25e55841cb1b8e12275899b02379d10685fd74 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 24 Apr 2020 13:55:39 -0700 Subject: [PATCH 35/40] Silence warning in include each header alone test --- tests/std/tests/include_each_header_alone_matrix.lst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/std/tests/include_each_header_alone_matrix.lst b/tests/std/tests/include_each_header_alone_matrix.lst index 5aeec3dee49..57333f82ea8 100644 --- a/tests/std/tests/include_each_header_alone_matrix.lst +++ b/tests/std/tests/include_each_header_alone_matrix.lst @@ -60,7 +60,7 @@ PM_CL="/DMEOW_HEADER=stdexcept" PM_CL="/DMEOW_HEADER=streambuf" PM_CL="/DMEOW_HEADER=string" PM_CL="/DMEOW_HEADER=string_view" -PM_CL="/DMEOW_HEADER=strstream" +PM_CL="/DMEOW_HEADER=strstream /D_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING" PM_CL="/DMEOW_HEADER=system_error" PM_CL="/DMEOW_HEADER=thread" PM_CL="/DMEOW_HEADER=tuple" @@ -84,7 +84,7 @@ PM_CL="/DMEOW_HEADER=experimental/unordered_map" PM_CL="/DMEOW_HEADER=experimental/unordered_set" PM_CL="/DMEOW_HEADER=experimental/vector" PM_CL="/DMEOW_HEADER=cassert" -PM_CL="/DMEOW_HEADER=ccomplex" +PM_CL="/DMEOW_HEADER=ccomplex /D_SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING" PM_CL="/DMEOW_HEADER=cctype" PM_CL="/DMEOW_HEADER=cerrno" PM_CL="/DMEOW_HEADER=cfenv" @@ -96,15 +96,15 @@ PM_CL="/DMEOW_HEADER=clocale" PM_CL="/DMEOW_HEADER=cmath" PM_CL="/DMEOW_HEADER=csetjmp" PM_CL="/DMEOW_HEADER=csignal" -PM_CL="/DMEOW_HEADER=cstdalign" +PM_CL="/DMEOW_HEADER=cstdalign /D_SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING" PM_CL="/DMEOW_HEADER=cstdarg" -PM_CL="/DMEOW_HEADER=cstdbool" +PM_CL="/DMEOW_HEADER=cstdbool /D_SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING" PM_CL="/DMEOW_HEADER=cstddef" PM_CL="/DMEOW_HEADER=cstdint" PM_CL="/DMEOW_HEADER=cstdio" PM_CL="/DMEOW_HEADER=cstdlib" PM_CL="/DMEOW_HEADER=cstring" -PM_CL="/DMEOW_HEADER=ctgmath" +PM_CL="/DMEOW_HEADER=ctgmath /D_SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING" PM_CL="/DMEOW_HEADER=ctime" PM_CL="/DMEOW_HEADER=cuchar" PM_CL="/DMEOW_HEADER=cwchar" From 358d6c723daa3cc0303df13833d831477b4bd7e5 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 24 Apr 2020 14:14:09 -0700 Subject: [PATCH 36/40] Move to test type overrides --- tests/CMakeLists.txt | 4 +- tests/libcxx/CMakeLists.txt | 2 +- tests/libcxx/lit.site.cfg.in | 35 +- ...ed_results.txt => test_type_overrides.txt} | 482 +++++++++--------- tests/std/CMakeLists.txt | 2 +- tests/std/lit.site.cfg.in | 27 +- ...ed_results.txt => test_type_overrides.txt} | 0 tests/tr1/CMakeLists.txt | 2 +- tests/tr1/lit.site.cfg.in | 28 +- ...ed_results.txt => test_type_overrides.txt} | 0 tests/utils/stl/test/config.py | 41 +- tests/utils/stl/test/file_parsing.py | 21 +- 12 files changed, 320 insertions(+), 324 deletions(-) rename tests/libcxx/{expected_results.txt => test_type_overrides.txt} (85%) rename tests/std/{expected_results.txt => test_type_overrides.txt} (100%) rename tests/tr1/{expected_results.txt => test_type_overrides.txt} (100%) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b553c3bb06a..770895a4553 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -29,11 +29,11 @@ find_package(Python3) execute_process( COMMAND ${Python3_EXECUTABLE} ${STL_LIT} - #"${LIBCXX_SOURCE_DIR}/test/std" + "${LIBCXX_SOURCE_DIR}/test/std" "${CMAKE_CURRENT_SOURCE_DIR}/std" "${CMAKE_CURRENT_SOURCE_DIR}/tr1") -#include("${CMAKE_CURRENT_BINARY_DIR}/libcxx/tests.cmake") +include("${CMAKE_CURRENT_BINARY_DIR}/libcxx/tests.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/std/tests.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/tr1/tests.cmake") diff --git a/tests/libcxx/CMakeLists.txt b/tests/libcxx/CMakeLists.txt index 5df73ab1d53..762debdc4ee 100644 --- a/tests/libcxx/CMakeLists.txt +++ b/tests/libcxx/CMakeLists.txt @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set(LIBCXX_ENVLST "${CMAKE_CURRENT_SOURCE_DIR}/usual_matrix.lst") -set(LIBCXX_EXPECTED_RESULTS "${CMAKE_CURRENT_SOURCE_DIR}/expected_results.txt") set(LIBCXX_TEST_OUTPUT_DIR "${STL_TEST_OUTPUT_DIR}/libcxx") +set(LIBCXX_TEST_TYPE_OVERRIDES "${CMAKE_CURRENT_SOURCE_DIR}/test_type_overrides.txt") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in diff --git a/tests/libcxx/lit.site.cfg.in b/tests/libcxx/lit.site.cfg.in index 15af372638d..42aaea4cb4e 100644 --- a/tests/libcxx/lit.site.cfg.in +++ b/tests/libcxx/lit.site.cfg.in @@ -4,26 +4,25 @@ import site site.addsitedir("@STL_TEST_UTILS_DIR@") -config.configuration_variant = "stl" -config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" -config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" -config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" -config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" -config.envlst_path = "@LIBCXX_ENVLST@" -config.expected_results_list_path = "@LIBCXX_EXPECTED_RESULTS@" -config.format_name = "LibcxxTestFormat" -config.include_dirs = ["@LIBCXX_SOURCE_DIR@/test/support"] -config.libcxx_obj_root = "@LIBCXX_TEST_OUTPUT_DIR@" -config.msvc_toolset_libs_root = "@TOOLSET_LIB@" -config.step_provider = "STLDelayedExecutionStepProvider" -config.stl_build_root = "@STL_BUILD_ROOT@" -config.stl_src_root = "@STL_SOURCE_DIR@" -config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" -config.test_subdirs = ["@LIBCXX_SOURCE_DIR@/test/std"] +config.configuration_variant = "stl" +config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" +config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" +config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" +config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" +config.envlst_path = "@LIBCXX_ENVLST@" +config.test_type_overrides_list_path = "@LIBCXX_TEST_TYPE_OVERRIDES@" +config.format_name = "LibcxxTestFormat" +config.include_dirs = ["@LIBCXX_SOURCE_DIR@/test/support"] +config.libcxx_obj_root = "@LIBCXX_TEST_OUTPUT_DIR@" +config.msvc_toolset_libs_root = "@TOOLSET_LIB@" +config.stl_build_root = "@STL_BUILD_ROOT@" +config.stl_src_root = "@STL_SOURCE_DIR@" +config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" +config.test_subdirs = ["@LIBCXX_SOURCE_DIR@/test/std"] lit_config.params['use_old_format'] = True config.loaded_site_config = True lit_config.load_config(config, "@LIBCXX_SOURCE_DIR@/test/lit.cfg") -config.suffixes = [".pass.cpp", ".fail.cpp"] -config.test_exec_root = "@LIBCXX_TEST_OUTPUT_DIR@" +config.suffixes = [".pass.cpp", ".fail.cpp"] +config.test_exec_root = "@LIBCXX_TEST_OUTPUT_DIR@" diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/test_type_overrides.txt similarity index 85% rename from tests/libcxx/expected_results.txt rename to tests/libcxx/test_type_overrides.txt index a91dbd2300e..bef0372074f 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/test_type_overrides.txt @@ -545,98 +545,98 @@ std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp # *** STL BUGS *** # STL bug: VSO-121977 ": the enum value of std::money_base is not correct[libcxx]" -std/localization/locale.categories/category.monetary/locale.moneypunct/money_base.pass.cpp FAIL +std/localization/locale.categories/category.monetary/locale.moneypunct/money_base.pass.cpp COMPILE_FAIL # STL Bug: VSO-595631 basic_filebuf doesn't comply with setbuf(0,0) requirement in the standard -std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp FAIL -std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp FAIL +std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp COMPILE_FAIL +std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp COMPILE_FAIL # STL bug: We don't have tgmath.h. std/depr/depr.c.headers/tgmath_h.pass.cpp SKIPPED # STL bug: Our inheritance implementation is allowing this to compile when it shouldn't. -std/numerics/complex.number/complex.special/double_long_double_implicit.fail.cpp FAIL -std/numerics/complex.number/complex.special/float_double_implicit.fail.cpp FAIL -std/numerics/complex.number/complex.special/float_long_double_implicit.fail.cpp FAIL +std/numerics/complex.number/complex.special/double_long_double_implicit.fail.cpp COMPILE_FAIL +std/numerics/complex.number/complex.special/float_double_implicit.fail.cpp COMPILE_FAIL +std/numerics/complex.number/complex.special/float_long_double_implicit.fail.cpp COMPILE_FAIL # STL bug: regex_traits::transform() isn't following the Standard. -std/re/re.traits/transform.pass.cpp FAIL +std/re/re.traits/transform.pass.cpp COMPILE_FAIL # STL bug: Incorrect return types. -std/numerics/complex.number/cmplx.over/conj.pass.cpp FAIL -std/numerics/complex.number/cmplx.over/pow.pass.cpp FAIL -std/numerics/complex.number/cmplx.over/proj.pass.cpp FAIL +std/numerics/complex.number/cmplx.over/conj.pass.cpp COMPILE_FAIL +std/numerics/complex.number/cmplx.over/pow.pass.cpp COMPILE_FAIL +std/numerics/complex.number/cmplx.over/proj.pass.cpp COMPILE_FAIL # STL bug: Missing assignment operators. -std/numerics/numarray/template.mask.array/mask.array.assign/mask_array.pass.cpp FAIL -std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp FAIL +std/numerics/numarray/template.mask.array/mask.array.assign/mask_array.pass.cpp COMPILE_FAIL +std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp COMPILE_FAIL # STL bug: We allow fill() and swap() for array. -std/containers/sequences/array/array.fill/fill.fail.cpp FAIL -std/containers/sequences/array/array.swap/swap.fail.cpp FAIL +std/containers/sequences/array/array.fill/fill.fail.cpp COMPILE_FAIL +std/containers/sequences/array/array.swap/swap.fail.cpp COMPILE_FAIL # STL bug: VSO-207715 We reject array. -std/containers/sequences/array/array.cons/default.pass.cpp FAIL -std/containers/sequences/array/array.cons/implicit_copy.pass.cpp FAIL -std/containers/sequences/array/array.data/data_const.pass.cpp FAIL -std/containers/sequences/array/array.data/data.pass.cpp FAIL -std/containers/sequences/array/begin.pass.cpp FAIL +std/containers/sequences/array/array.cons/default.pass.cpp COMPILE_FAIL +std/containers/sequences/array/array.cons/implicit_copy.pass.cpp COMPILE_FAIL +std/containers/sequences/array/array.data/data_const.pass.cpp COMPILE_FAIL +std/containers/sequences/array/array.data/data.pass.cpp COMPILE_FAIL +std/containers/sequences/array/begin.pass.cpp COMPILE_FAIL # STL bug: string_view doesn't enforce "non-array trivial standard-layout", related to LWG-3034. -std/strings/string.view/char.bad.fail.cpp:0 FAIL +std/strings/string.view/char.bad.fail.cpp:0 COMPILE_FAIL # Predicate count assertions - IDL2 is slightly bending the Standard's rules here. -std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp FAIL -std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp FAIL -std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp FAIL +std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp COMPILE_FAIL +std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp COMPILE_FAIL +std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp COMPILE_FAIL # STL bug: We don't match strtod / strtof when doing field extraction for hexfloats, or special cases like inf -std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp FAIL -std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp FAIL -std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp FAIL +std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp COMPILE_FAIL # STL bug: We don't match numpunct groups correctly in do_get -std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp FAIL +std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp COMPILE_FAIL # STL test bug: We don't have the locale names libcxx wants specialized in platform_support.hpp # More bugs may be uncovered when the locale names are present. -std/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp FAIL -std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp FAIL -std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp FAIL -std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp FAIL +std/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp COMPILE_FAIL +std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp COMPILE_FAIL +std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp COMPILE_FAIL # STL Bug? Our wbuffer_convert does not implement seek. [depr.conversions.buffer] is completely underspecified. -std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp FAIL +std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp COMPILE_FAIL # STL Bug: error_category's default ctor isn't constexpr. (Should be fixed in vNext.) -std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp:1 FAIL +std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp:1 COMPILE_FAIL # STL Bug: future incorrectly uses copy assignment instead of copy construction in set_value. (Should be fixed in vNext.) -std/thread/futures/futures.promise/set_value_const.pass.cpp FAIL +std/thread/futures/futures.promise/set_value_const.pass.cpp COMPILE_FAIL # *** CRT BUGS *** @@ -811,228 +811,228 @@ std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp S # *** LIKELY STL BUGS *** # Not yet analyzed, likely STL bugs. Assertions and other runtime failures. -std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval_param.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval_param.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval_param.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/max.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/min.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/max.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/min.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/max.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval_param.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/max.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/min.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/max.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/min.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval_param.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/max.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/min.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/max.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval_param.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/max.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/min.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eq.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval_param.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/max.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/min.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval_param.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/max.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_init_func.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_iterator.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_init_func.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_iterator.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_func.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_iterator.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_param.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_default.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_func.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_iterator.pass.cpp FAIL -std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/param_ctor.pass.cpp FAIL +std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval_param.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval_param.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval_param.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/max.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/min.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/max.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/min.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/max.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval_param.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/max.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/min.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/max.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/min.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval_param.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/max.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/min.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/max.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval_param.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/max.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/min.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eq.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval_param.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/max.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/min.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval_param.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/max.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_init_func.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_iterator.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_init_func.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_iterator.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_func.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_iterator.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_param.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_default.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_func.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_iterator.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/param_ctor.pass.cpp COMPILE_FAIL # Not yet analyzed, likely STL bugs. Various assertions. -std/re/re.alg/re.alg.match/awk.pass.cpp FAIL -std/re/re.alg/re.alg.match/basic.pass.cpp FAIL -std/re/re.alg/re.alg.match/ecma.pass.cpp FAIL -std/re/re.alg/re.alg.match/extended.pass.cpp FAIL -std/re/re.alg/re.alg.search/awk.pass.cpp FAIL -std/re/re.alg/re.alg.search/basic.pass.cpp FAIL -std/re/re.alg/re.alg.search/ecma.pass.cpp FAIL -std/re/re.alg/re.alg.search/extended.pass.cpp FAIL -std/re/re.alg/re.alg.search/no_update_pos.pass.cpp FAIL -std/re/re.badexp/regex_error.pass.cpp FAIL -std/re/re.const/re.synopt/syntax_option_type.pass.cpp FAIL -std/re/re.grammar/excessive_brace_count.pass.cpp FAIL -std/re/re.regex/re.regex.construct/bad_backref.pass.cpp FAIL -std/re/re.regex/re.regex.construct/bad_escape.pass.cpp FAIL -std/re/re.regex/re.regex.construct/bad_range.pass.cpp FAIL -std/re/re.regex/re.regex.construct/default.pass.cpp FAIL -std/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp FAIL -std/re/re.regex/re.regex.swap/swap.pass.cpp FAIL -std/re/re.traits/lookup_collatename.pass.cpp FAIL -std/re/re.traits/transform_primary.pass.cpp FAIL +std/re/re.alg/re.alg.match/awk.pass.cpp COMPILE_FAIL +std/re/re.alg/re.alg.match/basic.pass.cpp COMPILE_FAIL +std/re/re.alg/re.alg.match/ecma.pass.cpp COMPILE_FAIL +std/re/re.alg/re.alg.match/extended.pass.cpp COMPILE_FAIL +std/re/re.alg/re.alg.search/awk.pass.cpp COMPILE_FAIL +std/re/re.alg/re.alg.search/basic.pass.cpp COMPILE_FAIL +std/re/re.alg/re.alg.search/ecma.pass.cpp COMPILE_FAIL +std/re/re.alg/re.alg.search/extended.pass.cpp COMPILE_FAIL +std/re/re.alg/re.alg.search/no_update_pos.pass.cpp COMPILE_FAIL +std/re/re.badexp/regex_error.pass.cpp COMPILE_FAIL +std/re/re.const/re.synopt/syntax_option_type.pass.cpp COMPILE_FAIL +std/re/re.grammar/excessive_brace_count.pass.cpp COMPILE_FAIL +std/re/re.regex/re.regex.construct/bad_backref.pass.cpp COMPILE_FAIL +std/re/re.regex/re.regex.construct/bad_escape.pass.cpp COMPILE_FAIL +std/re/re.regex/re.regex.construct/bad_range.pass.cpp COMPILE_FAIL +std/re/re.regex/re.regex.construct/default.pass.cpp COMPILE_FAIL +std/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp COMPILE_FAIL +std/re/re.regex/re.regex.swap/swap.pass.cpp COMPILE_FAIL +std/re/re.traits/lookup_collatename.pass.cpp COMPILE_FAIL +std/re/re.traits/transform_primary.pass.cpp COMPILE_FAIL # Not yet analyzed, likely STL bugs. Various assertions. -std/numerics/complex.number/complex.member.ops/divide_equal_complex.pass.cpp FAIL -std/numerics/complex.number/complex.ops/complex_divide_complex.pass.cpp FAIL -std/numerics/complex.number/complex.ops/complex_times_complex.pass.cpp FAIL -std/numerics/complex.number/complex.ops/scalar_divide_complex.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/acos.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/asin.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/atanh.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/cos.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/exp.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/log10.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/sin.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/sqrt.pass.cpp FAIL -std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp FAIL -std/numerics/complex.number/complex.value.ops/norm.pass.cpp FAIL -std/numerics/complex.number/complex.value.ops/polar.pass.cpp FAIL -std/numerics/complex.number/complex.value.ops/proj.pass.cpp FAIL +std/numerics/complex.number/complex.member.ops/divide_equal_complex.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.ops/complex_divide_complex.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.ops/complex_times_complex.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.ops/scalar_divide_complex.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/acos.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/asin.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/atanh.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/cos.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/exp.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/log10.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/sin.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/sqrt.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.value.ops/norm.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.value.ops/polar.pass.cpp COMPILE_FAIL +std/numerics/complex.number/complex.value.ops/proj.pass.cpp COMPILE_FAIL # Not yet analyzed, likely STL bugs. Many various assertions. -std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp FAIL -std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp FAIL -std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.pass.cpp FAIL -std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_one.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday.pass.cpp FAIL -std/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf16_in.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf16.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf8_in.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp FAIL -std/localization/locale.stdcvt/codecvt_utf8.pass.cpp FAIL -std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp FAIL -std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp FAIL -std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp FAIL -std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp FAIL +std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_one.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf16_in.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf16.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf8_in.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp COMPILE_FAIL +std/localization/locale.stdcvt/codecvt_utf8.pass.cpp COMPILE_FAIL +std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp COMPILE_FAIL +std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp COMPILE_FAIL +std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp COMPILE_FAIL +std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp COMPILE_FAIL # Not yet analyzed, likely STL bugs. Various assertions. -std/input.output/iostream.format/ext.manip/get_money.pass.cpp FAIL -std/input.output/iostream.format/ext.manip/put_money.pass.cpp FAIL -std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp FAIL +std/input.output/iostream.format/ext.manip/get_money.pass.cpp COMPILE_FAIL +std/input.output/iostream.format/ext.manip/put_money.pass.cpp COMPILE_FAIL +std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp COMPILE_FAIL # Not yet analyzed, likely STL bugs. Assertion failed: os.str() == a -std/numerics/rand/rand.adapt/rand.adapt.disc/ctor_result_type.pass.cpp FAIL -std/numerics/rand/rand.adapt/rand.adapt.disc/ctor_sseq.pass.cpp FAIL -std/numerics/rand/rand.adapt/rand.adapt.ibits/ctor_result_type.pass.cpp FAIL -std/numerics/rand/rand.adapt/rand.adapt.ibits/ctor_sseq.pass.cpp FAIL -std/numerics/rand/rand.eng/rand.eng.mers/ctor_result_type.pass.cpp FAIL -std/numerics/rand/rand.eng/rand.eng.mers/ctor_sseq.pass.cpp FAIL -std/numerics/rand/rand.eng/rand.eng.sub/ctor_result_type.pass.cpp FAIL -std/numerics/rand/rand.eng/rand.eng.sub/ctor_sseq.pass.cpp FAIL +std/numerics/rand/rand.adapt/rand.adapt.disc/ctor_result_type.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.adapt/rand.adapt.disc/ctor_sseq.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.adapt/rand.adapt.ibits/ctor_result_type.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.adapt/rand.adapt.ibits/ctor_sseq.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.eng/rand.eng.mers/ctor_result_type.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.eng/rand.eng.mers/ctor_sseq.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.eng/rand.eng.sub/ctor_result_type.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.eng/rand.eng.sub/ctor_sseq.pass.cpp COMPILE_FAIL # Not yet analyzed, likely STL bugs. Assertion failed: e1 == e2 -std/numerics/rand/rand.adapt/rand.adapt.disc/io.pass.cpp FAIL -std/numerics/rand/rand.adapt/rand.adapt.ibits/io.pass.cpp FAIL -std/numerics/rand/rand.eng/rand.eng.sub/io.pass.cpp FAIL +std/numerics/rand/rand.adapt/rand.adapt.disc/io.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.adapt/rand.adapt.ibits/io.pass.cpp COMPILE_FAIL +std/numerics/rand/rand.eng/rand.eng.sub/io.pass.cpp COMPILE_FAIL # Likely STL bug: Looks like we shouldn't be using assignment. -std/thread/futures/futures.promise/set_rvalue.pass.cpp FAIL +std/thread/futures/futures.promise/set_rvalue.pass.cpp COMPILE_FAIL # Possible STL bugs in pair and tuple. -std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp:0 FAIL -std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp FAIL +std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp:0 COMPILE_FAIL +std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp COMPILE_FAIL # Likely STL bugs in mersenne_twister; also fails at runtime # random(1186,26): error: constexpr variable '_WMSK' must be initialized by a constant expression # static constexpr _Ty _WMSK = ~((~_Ty(0) << (_Wx - 1)) << 1); # ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -std/numerics/rand/rand.eng/rand.eng.mers/ctor_sseq_all_zero.pass.cpp FAIL +std/numerics/rand/rand.eng/rand.eng.mers/ctor_sseq_all_zero.pass.cpp COMPILE_FAIL # Bugs/questionable choices in codecvt, which we probably will not fix since # (1) they are deprecated, and (2) we don't want to break existing users. -std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_max_length.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_encoding.pass.cpp FAIL -std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_max_length.pass.cpp FAIL +std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_max_length.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_encoding.pass.cpp COMPILE_FAIL +std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_max_length.pass.cpp COMPILE_FAIL # Likely STL bug in : "result type of conditional expression is ambiguous" -std/utilities/time/time.duration/time.duration.alg/abs.pass.cpp FAIL +std/utilities/time/time.duration/time.duration.alg/abs.pass.cpp COMPILE_FAIL # *** NOT YET ANALYZED *** # Not yet analyzed. Asserting about alloc_count. -std/thread/futures/futures.promise/alloc_ctor.pass.cpp FAIL -std/thread/futures/futures.promise/move_assign.pass.cpp FAIL -std/thread/futures/futures.promise/move_ctor.pass.cpp FAIL -std/thread/futures/futures.promise/swap.pass.cpp FAIL -std/thread/futures/futures.shared_future/dtor.pass.cpp FAIL -std/thread/futures/futures.unique_future/dtor.pass.cpp FAIL +std/thread/futures/futures.promise/alloc_ctor.pass.cpp COMPILE_FAIL +std/thread/futures/futures.promise/move_assign.pass.cpp COMPILE_FAIL +std/thread/futures/futures.promise/move_ctor.pass.cpp COMPILE_FAIL +std/thread/futures/futures.promise/swap.pass.cpp COMPILE_FAIL +std/thread/futures/futures.shared_future/dtor.pass.cpp COMPILE_FAIL +std/thread/futures/futures.unique_future/dtor.pass.cpp COMPILE_FAIL # Not yet analyzed. libc++ seems to have a different opinion about what tuple_size should do. -std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp FAIL -std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp FAIL +std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp COMPILE_FAIL +std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp COMPILE_FAIL # Not yet analyzed. Possibly testing nonstandard deduction guides. -std/containers/associative/map/map.cons/deduct_const.pass.cpp FAIL -std/containers/associative/multimap/multimap.cons/deduct_const.pass.cpp FAIL -std/containers/unord/unord.map/unord.map.cnstr/deduct_const.pass.cpp FAIL -std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct.pass.cpp:0 FAIL -std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp FAIL -std/utilities/tuple/tuple.tuple/tuple.cnstr/deduct.pass.cpp:0 FAIL +std/containers/associative/map/map.cons/deduct_const.pass.cpp COMPILE_FAIL +std/containers/associative/multimap/multimap.cons/deduct_const.pass.cpp COMPILE_FAIL +std/containers/unord/unord.map/unord.map.cnstr/deduct_const.pass.cpp COMPILE_FAIL +std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct.pass.cpp:0 COMPILE_FAIL +std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp COMPILE_FAIL +std/utilities/tuple/tuple.tuple/tuple.cnstr/deduct.pass.cpp:0 COMPILE_FAIL # Not yet analyzed. Assertion failed: f16_8.out(mbs, c16, c_c16p, c_c16p, c8, c8+4, c8p) == F32_8::ok -std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp FAIL +std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp COMPILE_FAIL # Not yet analyzed. Frequent timeouts containers\sequences\deque\deque.modifiers\insert_iter_iter.pass.cpp SKIPPED -# *** XFAILs WHICH PASS *** +# *** XFAILs which PASS in MSVC *** # Not yet implemented in libcxx and marked as XFAIL -std/strings/c.strings/cuchar.pass.cpp PASS -std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp PASS -std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp PASS -std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp PASS -std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp PASS -std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp PASS -std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp PASS -std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp PASS -std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp PASS +std/strings/c.strings/cuchar.pass.cpp SKIPPED +std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp SKIPPED +std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp SKIPPED +std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp SKIPPED +std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp SKIPPED +std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp SKIPPED +std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp SKIPPED +std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp SKIPPED +std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp SKIPPED diff --git a/tests/std/CMakeLists.txt b/tests/std/CMakeLists.txt index 8fdccf77b3f..0d282d8ce92 100644 --- a/tests/std/CMakeLists.txt +++ b/tests/std/CMakeLists.txt @@ -1,10 +1,10 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -set(STD_EXPECTED_RESULTS "${CMAKE_CURRENT_SOURCE_DIR}/expected_results.txt") set(STD_TEST_OUTPUT_DIR "${STL_TEST_OUTPUT_DIR}/std") set(STD_TEST_SUBDIRS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.lst") set(STD_TEST_SUBDIRS_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") +set(STD_TEST_TYPE_OVERRIDES "${CMAKE_CURRENT_SOURCE_DIR}/test_type_overrides.txt") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in diff --git a/tests/std/lit.site.cfg.in b/tests/std/lit.site.cfg.in index e9730a0e4b7..28b22757118 100644 --- a/tests/std/lit.site.cfg.in +++ b/tests/std/lit.site.cfg.in @@ -1,19 +1,18 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" -config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" -config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" -config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" -config.expected_results_list_path = "@STD_EXPECTED_RESULTS@" -config.include_dirs = ["@LIBCXX_SOURCE_DIR@/test/support", "@STL_SOURCE_DIR@/tests/std/include"] -config.msvc_toolset_libs_root = "@TOOLSET_LIB@" -config.step_provider = "STLDelayedExecutionStepProvider" -config.stl_build_root = "@STL_BUILD_ROOT@" -config.stl_src_root = "@STL_SOURCE_DIR@" -config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" -config.test_exec_root = "@STD_TEST_OUTPUT_DIR@" -config.test_subdirs_file = "@STD_TEST_SUBDIRS_FILE@" -config.test_subdirs_root = "@STD_TEST_SUBDIRS_ROOT@" +config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" +config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" +config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" +config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" +config.test_type_overrides_list_path = "@STD_TEST_TYPE_OVERRIDES@" +config.include_dirs = ["@LIBCXX_SOURCE_DIR@/test/support", "@STL_SOURCE_DIR@/tests/std/include"] +config.msvc_toolset_libs_root = "@TOOLSET_LIB@" +config.stl_build_root = "@STL_BUILD_ROOT@" +config.stl_src_root = "@STL_SOURCE_DIR@" +config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" +config.test_exec_root = "@STD_TEST_OUTPUT_DIR@" +config.test_subdirs_file = "@STD_TEST_SUBDIRS_FILE@" +config.test_subdirs_root = "@STD_TEST_SUBDIRS_ROOT@" lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") diff --git a/tests/std/expected_results.txt b/tests/std/test_type_overrides.txt similarity index 100% rename from tests/std/expected_results.txt rename to tests/std/test_type_overrides.txt diff --git a/tests/tr1/CMakeLists.txt b/tests/tr1/CMakeLists.txt index c7c3d790403..58f4500a8bd 100644 --- a/tests/tr1/CMakeLists.txt +++ b/tests/tr1/CMakeLists.txt @@ -1,9 +1,9 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -set(TR1_EXPECTED_RESULTS "${CMAKE_CURRENT_SOURCE_DIR}/expected_results.txt") set(TR1_TEST_OUTPUT_DIR "${STL_TEST_OUTPUT_DIR}/tr1") set(TR1_TEST_SUBDIRS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.lst") +set(TR1_TEST_TYPE_OVERRIDES "${CMAKE_CURRENT_SOURCE_DIR}/test_type_overrides.txt") set(TR1_TEST_SUBDIRS_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") configure_file( diff --git a/tests/tr1/lit.site.cfg.in b/tests/tr1/lit.site.cfg.in index 8f25b2ab491..a770aefc0ba 100644 --- a/tests/tr1/lit.site.cfg.in +++ b/tests/tr1/lit.site.cfg.in @@ -1,19 +1,19 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" -config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" -config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" -config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" -config.expected_results_list_path = "@TR1_EXPECTED_RESULTS@" -config.include_dirs = ["@STL_SOURCE_DIR@/tests/tr1/include"] -config.msvc_toolset_libs_root = "@TOOLSET_LIB@" -config.step_provider = "STLDelayedExecutionStepProvider" -config.stl_build_root = "@STL_BUILD_ROOT@" -config.stl_src_root = "@STL_SOURCE_DIR@" -config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" -config.test_exec_root = "@TR1_TEST_OUTPUT_DIR@" -config.test_subdirs_file = "@TR1_TEST_SUBDIRS_FILE@" -config.test_subdirs_root = "@TR1_TEST_SUBDIRS_ROOT@" +config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" +config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" +config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" +config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" +config.test_type_overrides_list_path = "@TR1_TEST_TYPE_OVERRIDES@" +config.include_dirs = ["@STL_SOURCE_DIR@/tests/tr1/include"] +config.msvc_toolset_libs_root = "@TOOLSET_LIB@" +config.step_provider = "STLDelayedExecutionStepProvider" +config.stl_build_root = "@STL_BUILD_ROOT@" +config.stl_src_root = "@STL_SOURCE_DIR@" +config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" +config.test_exec_root = "@TR1_TEST_OUTPUT_DIR@" +config.test_subdirs_file = "@TR1_TEST_SUBDIRS_FILE@" +config.test_subdirs_root = "@TR1_TEST_SUBDIRS_ROOT@" lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") diff --git a/tests/tr1/expected_results.txt b/tests/tr1/test_type_overrides.txt similarity index 100% rename from tests/tr1/expected_results.txt rename to tests/tr1/test_type_overrides.txt diff --git a/tests/utils/stl/test/config.py b/tests/utils/stl/test/config.py index 677d83176a7..4161f16c4e8 100644 --- a/tests/utils/stl/test/config.py +++ b/tests/utils/stl/test/config.py @@ -34,8 +34,8 @@ def __init__(self, lit_config, config): self.cxx_runtime_root = None self.default_compiler = None self.execute_external = False - self.expected_results_list_path = None - self.expected_results_list_root = None + self.test_type_override_path = None + self.test_type_override_root = None self.format_name = None self.lit_config = lit_config self.link_shared = True @@ -89,7 +89,7 @@ def configure(self): self.configure_features() self.configure_default_compiler() self.configure_executors() - self.configure_expected_results() + self.configure_test_type_overrides() self.configure_test_dirs() self.configure_test_format() @@ -267,29 +267,30 @@ def configure_test_env(self): self.config.environment = stl_test_env - def configure_expected_results_list_location(self): - expected_results_list_path = self.get_lit_conf( - 'expected_results_list_path', None) + def configure_test_type_overrides_location(self): + test_type_overrides_list_path = self.get_lit_conf( + 'test_type_overrides_path', None) - if expected_results_list_path is not None: - self.expected_results_list_path = Path( - expected_results_list_path) + if test_type_overrides_list_path is not None: + self.test_type_overrides_list_path = Path( + test_type_overrides_list_path) else: - self.expected_results_list_path = Path(os.devnull) + self.test_type_overrides_list_path = Path(os.devnull) - def configure_expected_results(self): - expected_results = getattr(self.lit_config, 'expected_results', dict()) + def configure_test_type_overrides(self): + test_type_overrides = getattr(self.lit_config, 'test_type_overrides', + dict()) - if self.expected_results_list_path is None: - self.configure_expected_results_list_location() + if self.test_type_overrides_list_path is None: + self.configure_test_type_overrides_list_location() - expected_results[self.config.name] = \ - stl.test.file_parsing.parse_result_file( - self.expected_results_list_path) + test_type_overrides[self.config.name] = \ + stl.test.file_parsing.parse_test_type_file( + self.test_type_overrides_list_path) - self.lit_config.expected_results = expected_results - self.config.expected_results = \ - getattr(self.config, 'expected_results', dict()) + self.lit_config.test_type_overrides = test_type_overrides + self.config.test_type_overrides = \ + getattr(self.config, 'test_type_overrides', dict()) def configure_default_compiler(self): self.default_compiler = CXXCompiler(None) diff --git a/tests/utils/stl/test/file_parsing.py b/tests/utils/stl/test/file_parsing.py index 9a1308b9d5a..f97ffb0cc24 100644 --- a/tests/utils/stl/test/file_parsing.py +++ b/tests/utils/stl/test/file_parsing.py @@ -11,11 +11,11 @@ import lit.Test -import stl.test.tests +from stl.test.tests import TestType _envlst_cache = dict() _preprocessed_file_cache = dict() -_expected_result_entry_cache = dict() +_test_type_entry_cache = dict() @dataclass @@ -52,7 +52,7 @@ class _ParseCtx: _INCLUDE_REGEX = re.compile(r'^RUNALL_INCLUDE (?P.+$)') _ENV_VAR_MULTI_ITEM_REGEX = re.compile(r'(?P\w+)="(?P.*?)"') _CROSSLIST_REGEX = re.compile(r'^RUNALL_CROSSLIST$') -_EXPECTED_RESULT_REGEX = re.compile(r'^(?P.*) (?P.*?)$') +_EXPECTED_RESULT_REGEX = re.compile(r'^(?P.*) (?P.*?)$') def _parse_env_line(line: str) -> Optional[_TmpEnvEntry]: @@ -110,22 +110,19 @@ def parse_commented_file(filename: Union[str, bytes, os.PathLike]) \ return result -def parse_result_file(filename: Union[str, bytes, os.PathLike]) \ +def parse_test_type_file(filename: Union[str, bytes, os.PathLike]) \ -> Dict[str, lit.Test.ResultCode]: - if str(filename) in _expected_result_entry_cache: - return _expected_result_entry_cache[str(filename)] + if str(filename) in _test_type_entry_cache: + return _test_type_entry_cache[str(filename)] res = dict() for line in parse_commented_file(filename): m = _EXPECTED_RESULT_REGEX.match(line) prefix = m.group("prefix") - result = m.group("result") - result_code = getattr(lit.Test, result, None) - if result_code is None: - result_code = getattr(stl.test.tests, result) - res[prefix] = result_code + type = getattr(TestType, m.group("type")) + res[prefix] = type - _expected_result_entry_cache[str(filename)] = res + _test_type_entry_cache[str(filename)] = res return res From ee745536f7e649476d2173b65f85bf0ad513ca75 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 24 Apr 2020 14:14:56 -0700 Subject: [PATCH 37/40] Silence warning in execution --- stl/inc/execution | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/execution b/stl/inc/execution index 4fa6bdfa22e..edc68279a98 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -773,8 +773,8 @@ struct _Static_partition_team { // common data for all static partitioned ops _Diff _Unchunked_items; _Static_partition_team(const _Diff _Count_, const size_t _Chunks_) - : _Consumed_chunks{0}, _Chunks{_Chunks_}, _Count{_Count_}, _Chunk_size{_Count_ / static_cast<_Diff>(_Chunks_)}, - _Unchunked_items{_Count_ % static_cast<_Diff>(_Chunks_)} { + : _Consumed_chunks{0}, _Chunks{_Chunks_}, _Count{_Count_}, _Chunk_size{static_cast<_Diff>(_Count_ / static_cast<_Diff>(_Chunks_))}, + _Unchunked_items{static_cast<_Diff>(_Count_ % static_cast<_Diff>(_Chunks_))} { // Calculate common data for statically partitioning iterator ranges. // pre: _Count_ >= _Chunks_ && _Chunks_ >= 1 } From 518670412c114eec9b741e66a370029d5741e619 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 24 Apr 2020 22:20:25 -0700 Subject: [PATCH 38/40] More fixups --- tests/libcxx/lit.site.cfg.in | 30 +++++------ tests/libcxx/test_type_overrides.txt | 20 ++++---- tests/std/lit.site.cfg.in | 26 +++++----- tests/tr1/lit.site.cfg.in | 27 +++++----- tests/utils/stl/test/config.py | 23 +++++---- tests/utils/stl/test/executor.py | 10 ++-- tests/utils/stl/test/format.py | 35 ------------- tests/utils/stl/test/tests.py | 77 ++++++++++++++++++++++++---- 8 files changed, 137 insertions(+), 111 deletions(-) diff --git a/tests/libcxx/lit.site.cfg.in b/tests/libcxx/lit.site.cfg.in index 42aaea4cb4e..473379b9b91 100644 --- a/tests/libcxx/lit.site.cfg.in +++ b/tests/libcxx/lit.site.cfg.in @@ -4,21 +4,21 @@ import site site.addsitedir("@STL_TEST_UTILS_DIR@") -config.configuration_variant = "stl" -config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" -config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" -config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" -config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" -config.envlst_path = "@LIBCXX_ENVLST@" -config.test_type_overrides_list_path = "@LIBCXX_TEST_TYPE_OVERRIDES@" -config.format_name = "LibcxxTestFormat" -config.include_dirs = ["@LIBCXX_SOURCE_DIR@/test/support"] -config.libcxx_obj_root = "@LIBCXX_TEST_OUTPUT_DIR@" -config.msvc_toolset_libs_root = "@TOOLSET_LIB@" -config.stl_build_root = "@STL_BUILD_ROOT@" -config.stl_src_root = "@STL_SOURCE_DIR@" -config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" -config.test_subdirs = ["@LIBCXX_SOURCE_DIR@/test/std"] +config.configuration_variant = "stl" +config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" +config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" +config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" +config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" +config.envlst_path = "@LIBCXX_ENVLST@" +config.test_type_overrides_path = "@LIBCXX_TEST_TYPE_OVERRIDES@" +config.format_name = "LibcxxTestFormat" +config.include_dirs = ["@LIBCXX_SOURCE_DIR@/test/support"] +config.libcxx_obj_root = "@LIBCXX_TEST_OUTPUT_DIR@" +config.msvc_toolset_libs_root = "@TOOLSET_LIB@" +config.stl_build_root = "@STL_BUILD_ROOT@" +config.stl_src_root = "@STL_SOURCE_DIR@" +config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" +config.test_subdirs = ["@LIBCXX_SOURCE_DIR@/test/std"] lit_config.params['use_old_format'] = True config.loaded_site_config = True diff --git a/tests/libcxx/test_type_overrides.txt b/tests/libcxx/test_type_overrides.txt index bef0372074f..20a169d8265 100644 --- a/tests/libcxx/test_type_overrides.txt +++ b/tests/libcxx/test_type_overrides.txt @@ -548,8 +548,8 @@ std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp std/localization/locale.categories/category.monetary/locale.moneypunct/money_base.pass.cpp COMPILE_FAIL # STL Bug: VSO-595631 basic_filebuf doesn't comply with setbuf(0,0) requirement in the standard -std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp COMPILE_FAIL -std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp COMPILE_FAIL +std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp RUN_FAIL +std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp RUN_FAIL # STL bug: We don't have tgmath.h. std/depr/depr.c.headers/tgmath_h.pass.cpp SKIPPED @@ -572,8 +572,8 @@ std/numerics/numarray/template.mask.array/mask.array.assign/mask_array.pass.cpp std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp COMPILE_FAIL # STL bug: We allow fill() and swap() for array. -std/containers/sequences/array/array.fill/fill.fail.cpp COMPILE_FAIL -std/containers/sequences/array/array.swap/swap.fail.cpp COMPILE_FAIL +std/containers/sequences/array/array.fill/fill.fail.cpp RUN_FAIL +std/containers/sequences/array/array.swap/swap.fail.cpp RUN_FAIL # STL bug: VSO-207715 We reject array. std/containers/sequences/array/array.cons/default.pass.cpp COMPILE_FAIL @@ -586,9 +586,9 @@ std/containers/sequences/array/begin.pass.cpp COMPILE_FAIL std/strings/string.view/char.bad.fail.cpp:0 COMPILE_FAIL # Predicate count assertions - IDL2 is slightly bending the Standard's rules here. -std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp COMPILE_FAIL -std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp COMPILE_FAIL -std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp COMPILE_FAIL +std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp RUN_FAIL +std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp RUN_FAIL +std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp RUN_FAIL # STL bug: We don't match strtod / strtof when doing field extraction for hexfloats, or special cases like inf std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp COMPILE_FAIL @@ -954,9 +954,9 @@ std/localization/locales/locale.convenience/conversions/conversions.buffer/under std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp COMPILE_FAIL # Not yet analyzed, likely STL bugs. Various assertions. -std/input.output/iostream.format/ext.manip/get_money.pass.cpp COMPILE_FAIL -std/input.output/iostream.format/ext.manip/put_money.pass.cpp COMPILE_FAIL -std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp COMPILE_FAIL +std/input.output/iostream.format/ext.manip/get_money.pass.cpp RUN_FAIL +std/input.output/iostream.format/ext.manip/put_money.pass.cpp RUN_FAIL +std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp RUN_FAIL # Not yet analyzed, likely STL bugs. Assertion failed: os.str() == a std/numerics/rand/rand.adapt/rand.adapt.disc/ctor_result_type.pass.cpp COMPILE_FAIL diff --git a/tests/std/lit.site.cfg.in b/tests/std/lit.site.cfg.in index 28b22757118..5aaafaf8557 100644 --- a/tests/std/lit.site.cfg.in +++ b/tests/std/lit.site.cfg.in @@ -1,18 +1,18 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" -config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" -config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" -config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" -config.test_type_overrides_list_path = "@STD_TEST_TYPE_OVERRIDES@" -config.include_dirs = ["@LIBCXX_SOURCE_DIR@/test/support", "@STL_SOURCE_DIR@/tests/std/include"] -config.msvc_toolset_libs_root = "@TOOLSET_LIB@" -config.stl_build_root = "@STL_BUILD_ROOT@" -config.stl_src_root = "@STL_SOURCE_DIR@" -config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" -config.test_exec_root = "@STD_TEST_OUTPUT_DIR@" -config.test_subdirs_file = "@STD_TEST_SUBDIRS_FILE@" -config.test_subdirs_root = "@STD_TEST_SUBDIRS_ROOT@" +config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" +config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" +config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" +config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" +config.test_type_overrides_path = "@STD_TEST_TYPE_OVERRIDES@" +config.include_dirs = ["@LIBCXX_SOURCE_DIR@/test/support", "@STL_SOURCE_DIR@/tests/std/include"] +config.msvc_toolset_libs_root = "@TOOLSET_LIB@" +config.stl_build_root = "@STL_BUILD_ROOT@" +config.stl_src_root = "@STL_SOURCE_DIR@" +config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" +config.test_exec_root = "@STD_TEST_OUTPUT_DIR@" +config.test_subdirs_file = "@STD_TEST_SUBDIRS_FILE@" +config.test_subdirs_root = "@STD_TEST_SUBDIRS_ROOT@" lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") diff --git a/tests/tr1/lit.site.cfg.in b/tests/tr1/lit.site.cfg.in index a770aefc0ba..961d571ab22 100644 --- a/tests/tr1/lit.site.cfg.in +++ b/tests/tr1/lit.site.cfg.in @@ -1,19 +1,18 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" -config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" -config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" -config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" -config.test_type_overrides_list_path = "@TR1_TEST_TYPE_OVERRIDES@" -config.include_dirs = ["@STL_SOURCE_DIR@/tests/tr1/include"] -config.msvc_toolset_libs_root = "@TOOLSET_LIB@" -config.step_provider = "STLDelayedExecutionStepProvider" -config.stl_build_root = "@STL_BUILD_ROOT@" -config.stl_src_root = "@STL_SOURCE_DIR@" -config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" -config.test_exec_root = "@TR1_TEST_OUTPUT_DIR@" -config.test_subdirs_file = "@TR1_TEST_SUBDIRS_FILE@" -config.test_subdirs_root = "@TR1_TEST_SUBDIRS_ROOT@" +config.cxx_archive_root = "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" +config.cxx_headers = "@STL_TESTED_HEADERS_DIR@" +config.cxx_library_root = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" +config.cxx_runtime_root = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" +config.test_type_overrides_path = "@TR1_TEST_TYPE_OVERRIDES@" +config.include_dirs = ["@STL_SOURCE_DIR@/tests/tr1/include"] +config.msvc_toolset_libs_root = "@TOOLSET_LIB@" +config.stl_build_root = "@STL_BUILD_ROOT@" +config.stl_src_root = "@STL_SOURCE_DIR@" +config.target_arch = "@VCLIBS_TARGET_ARCHITECTURE@" +config.test_exec_root = "@TR1_TEST_OUTPUT_DIR@" +config.test_subdirs_file = "@TR1_TEST_SUBDIRS_FILE@" +config.test_subdirs_root = "@TR1_TEST_SUBDIRS_ROOT@" lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") diff --git a/tests/utils/stl/test/config.py b/tests/utils/stl/test/config.py index 4161f16c4e8..fa4c8cb1e42 100644 --- a/tests/utils/stl/test/config.py +++ b/tests/utils/stl/test/config.py @@ -9,6 +9,7 @@ from pathlib import Path import os import platform +import re import shlex from stl.test.executor import BuildStepWriter, LocalTestStepWriter @@ -34,8 +35,6 @@ def __init__(self, lit_config, config): self.cxx_runtime_root = None self.default_compiler = None self.execute_external = False - self.test_type_override_path = None - self.test_type_override_root = None self.format_name = None self.lit_config = lit_config self.link_shared = True @@ -50,6 +49,8 @@ def __init__(self, lit_config, config): self.target_info = stl.test.target_info.WindowsLocalTI(lit_config) self.test_executor = None self.test_source_root = None + self.test_type_overrides_path = None + self.test_type_overrides_root = None def get_lit_conf(self, name, default=None): val = self.lit_config.params.get(name, None) @@ -252,7 +253,7 @@ def configure_path_env_var(self): config_env = self.config.environment.get('PATH', None) if config_env is not None: - path_list.append(config_env) + path_list.append(config_env.strip('; ').replace(';;', ';')) stl_path_env_var = ';'.join(path_list) @@ -268,25 +269,25 @@ def configure_test_env(self): self.config.environment = stl_test_env def configure_test_type_overrides_location(self): - test_type_overrides_list_path = self.get_lit_conf( + test_type_overrides_path = self.get_lit_conf( 'test_type_overrides_path', None) - if test_type_overrides_list_path is not None: - self.test_type_overrides_list_path = Path( - test_type_overrides_list_path) + if test_type_overrides_path is not None: + self.test_type_overrides_path = Path( + test_type_overrides_path) else: - self.test_type_overrides_list_path = Path(os.devnull) + self.test_type_overrides_path = Path(os.devnull) def configure_test_type_overrides(self): test_type_overrides = getattr(self.lit_config, 'test_type_overrides', dict()) - if self.test_type_overrides_list_path is None: - self.configure_test_type_overrides_list_location() + if self.test_type_overrides_path is None: + self.configure_test_type_overrides_location() test_type_overrides[self.config.name] = \ stl.test.file_parsing.parse_test_type_file( - self.test_type_overrides_list_path) + self.test_type_overrides_path) self.lit_config.test_type_overrides = test_type_overrides self.config.test_type_overrides = \ diff --git a/tests/utils/stl/test/executor.py b/tests/utils/stl/test/executor.py index f57078b5d2a..5e22af081b7 100644 --- a/tests/utils/stl/test/executor.py +++ b/tests/utils/stl/test/executor.py @@ -40,7 +40,7 @@ def write(self, test, step, test_file_handle): fail_string = \ 'add_test(NAME {name} COMMAND {cmd} WORKING_DIRECTORY "{cwd}")\nset_property(TEST {name} PROPERTY WILL_FAIL TRUE)' env_prop = \ - 'set_property(TEST {name} PROPERTY ENVIRONMENT APPEND {env})' + 'set_property(TEST {name} PROPERTY ENVIRONMENT {env})' if not step.should_fail: name = test.getFullName() + '_' + str(step.num) @@ -62,7 +62,9 @@ def write(self, test, step, test_file_handle): for k, v in step.env.items(): env_list.append(k + '=' + v) cmake_env_list = \ - '"' + '" "'.join(env_list).replace('\\', '/') + '"' + '"' + \ + '" "'.join(env_list).replace('\\', '/').replace(';', '\\;') + \ + '"' print(env_prop.format(name=test.getFullName(), env=cmake_env_list), @@ -95,7 +97,9 @@ def write(self, test, step, test_file_handle): for k, v in step.env.items(): env_list.append(k + '=' + v) cmake_env_list = \ - '\"' + '\" \"'.join(env_list).replace('\\', '/') + '\"' + '"' + \ + '" "'.join(env_list).replace('\\', '/').replace(';', '\\;') + \ + '"' print(env_prop.format(name=test_name, env=cmake_env_list), file=test_file_handle) diff --git a/tests/utils/stl/test/format.py b/tests/utils/stl/test/format.py index 3c9f1c17300..5460c8bae4b 100644 --- a/tests/utils/stl/test/format.py +++ b/tests/utils/stl/test/format.py @@ -158,9 +158,6 @@ def getTestsInDirectory(self, testSuite, path_in_suite, format_string.format(env_num), self.cxx) - test.script_result = \ - self.getIntegratedScriptResult(test, litConfig) - if test.script_result is None: test_file = test.getTestFilePath().as_posix() out_string = global_prop_string.format(test_file) @@ -187,38 +184,6 @@ def setup(self, test): if path.is_file() and path.name.endswith('.dat'): shutil.copy2(path, exec_dir / path.name) - def getIntegratedScriptResult(self, test, lit_config): - if test.test_type is TestType.SKIPPED: - return (lit.Test.SKIPPED, "Test was marked as skipped") - - name = test.path_in_suite[-1] - name_root, name_ext = os.path.splitext(name) - is_sh_test = name_root.endswith('.sh') - is_objcxx_test = name.endswith('.mm') - - if is_sh_test: - return (lit.Test.UNSUPPORTED, - "Sh tests are currently unsupported") - - if is_objcxx_test: - return (lit.Test.UNSUPPORTED, - "Objective-C tests are unsupported") - - if test.config.unsupported: - return (lit.Test.UNSUPPORTED, - "A lit.local.cfg marked this unsupported") - - if lit_config.noExecute: - return lit.Test.Result(lit.Test.PASS) - - script = lit.TestRunner.parseIntegratedTestScript( - test, require_script=False) - - if isinstance(script, lit.Test.Result): - return script - - return None - def execute(self, test, lit_config): if test.script_result is not None: return test.script_result diff --git a/tests/utils/stl/test/tests.py b/tests/utils/stl/test/tests.py index 1f037321f87..9517c207571 100644 --- a/tests/utils/stl/test/tests.py +++ b/tests/utils/stl/test/tests.py @@ -11,12 +11,17 @@ from pathlib import Path import enum import os +import re import shutil from lit.Test import Test +import lit from stl.compiler import CXXCompiler +_CMAKE_TARGET_NAME_REGEX = re.compile('[^a-zA-Z0-9_.+\-]+') +_name_counter = 0 + _compiler_path_cache = dict() @@ -39,9 +44,12 @@ def __init__(self, suite, path_in_suite, lit_config, test_config, self.skipped = False Test.__init__(self, suite, path_in_suite, test_config, file_path) + self._configure_name() self._configure_test_type(suite, path_in_suite, lit_config, - test_config, env_num) + test_config) if self.test_type is TestType.SKIPPED: + self.script_result = (lit.Test.SKIPPED, + "Test was marked as skipped") return self._configure_cxx(lit_config, envlst_entry, default_cxx) @@ -53,6 +61,46 @@ def __init__(self, suite, path_in_suite, lit_config, test_config, elif flag.startswith('BE', 1): self.requires.append('edg') + self.script_result = self._get_integrated_script_result(lit_config) + + def _get_integrated_script_result(self, lit_config): + name = self.path_in_suite[-1] + name_root, name_ext = os.path.splitext(name) + is_sh_self = name_root.endswith('.sh') + is_objcxx_self = name.endswith('.mm') + + if is_sh_self: + return (lit.Test.UNSUPPORTED, + "Sh selfs are currently unsupported") + + if is_objcxx_self: + return (lit.Test.UNSUPPORTED, + "Objective-C selfs are unsupported") + + if self.config.unsupported: + return (lit.Test.UNSUPPORTED, + "A lit.local.cfg marked this unsupported") + + if lit_config.noExecute: + return lit.Test.Result(lit.Test.PASS) + + script = lit.TestRunner.parseIntegratedTestScript( + self, require_script=False) + + if isinstance(script, lit.Test.Result): + return script + + return None + + def _configure_name(self): + global _name_counter + + self.name = _CMAKE_TARGET_NAME_REGEX.sub( + str(_name_counter), '-'.join(self.path_in_suite[:-1])) + \ + '--' + self.env_num + + _name_counter = _name_counter + 1 + def getOutputDir(self): return Path(os.path.join( self.suite.getExecPath(self.path_in_suite[:-1]))) / self.env_num @@ -70,28 +118,28 @@ def getTestFilePath(self): return self.getOutputDir() / 'test.cmake' def getTestName(self): - return '-'.join(self.path_in_suite[:-1]) + "--" + self.env_num + return self.name def getFullName(self): return self.suite.config.name + '--' + self.getTestName() def _configure_test_type(self, suite, path_in_suite, lit_config, - test_config, env_num): - test_name = self.getTestName() + test_config): + test_name = '/'.join(path_in_suite) + ':' + self.env_num self.test_type = None current_prefix = "" - for prefix, result in \ - chain(test_config.expected_results.items(), - lit_config.expected_results.get(test_config.name, - dict()).items()): + for prefix, type in \ + chain(test_config.test_type_overrides.items(), + lit_config.test_type_overrides.get(test_config.name, + dict()).items()): if test_name == prefix: - self.test_type = result + self.test_type = type return elif test_name.startswith(prefix) and \ len(prefix) > len(current_prefix): current_prefix = prefix - self.test_type = result + self.test_type = type if self.test_type is not None: return @@ -171,3 +219,12 @@ def getOutputDir(self): return Path(os.path.join( self.suite.getExecPath(self.path_in_suite[:-1]))) / dir_name / \ self.env_num + + def _configure_name(self): + global _name_counter + + self.name = _CMAKE_TARGET_NAME_REGEX.sub( + str(_name_counter), '-'.join(self.path_in_suite[:-1]) + '-' + + self.getOutputBaseName()) + "--" + self.env_num + + _name_counter = _name_counter + 1 From 665ab8f66b1412a21364b22f1cf939a82335b225 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Sat, 25 Apr 2020 06:43:53 -0700 Subject: [PATCH 39/40] fixups --- tests/libcxx/test_type_overrides.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libcxx/test_type_overrides.txt b/tests/libcxx/test_type_overrides.txt index 20a169d8265..0d180057ea0 100644 --- a/tests/libcxx/test_type_overrides.txt +++ b/tests/libcxx/test_type_overrides.txt @@ -587,7 +587,7 @@ std/strings/string.view/char.bad.fail.cpp:0 COMPILE_FAIL # Predicate count assertions - IDL2 is slightly bending the Standard's rules here. std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp RUN_FAIL -std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp RUN_FAIL +std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp COMPILE_FAIL std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp RUN_FAIL # STL bug: We don't match strtod / strtof when doing field extraction for hexfloats, or special cases like inf From caebb8a4823989a5e8fc184d144a8d6c56398c2b Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Sat, 25 Apr 2020 07:02:35 -0700 Subject: [PATCH 40/40] fixups --- tests/libcxx/test_type_overrides.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libcxx/test_type_overrides.txt b/tests/libcxx/test_type_overrides.txt index 0d180057ea0..494be05aefe 100644 --- a/tests/libcxx/test_type_overrides.txt +++ b/tests/libcxx/test_type_overrides.txt @@ -955,7 +955,7 @@ std/localization/locales/locale.convenience/conversions/conversions.string/ctor_ # Not yet analyzed, likely STL bugs. Various assertions. std/input.output/iostream.format/ext.manip/get_money.pass.cpp RUN_FAIL -std/input.output/iostream.format/ext.manip/put_money.pass.cpp RUN_FAIL +std/input.output/iostream.format/ext.manip/put_money.pass.cpp COMPILE_FAIL std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp RUN_FAIL # Not yet analyzed, likely STL bugs. Assertion failed: os.str() == a