From 7e15c9aa1366b6caab36252175856137f07e30b4 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 29 Jul 2020 17:24:45 -0700 Subject: [PATCH 1/3] Enable tests/std/tests/Dev09_172666_tr1_tuple_odr .... which has a custom build process. --- .../Dev09_172666_tr1_tuple_odr/__init__.py | 2 ++ .../custom_format.py | 23 +++++++++++++++++++ .../Dev09_172666_tr1_tuple_odr/lit.local.cfg | 10 ++++++++ .../{one.cpp => test.cpp} | 9 ++++---- .../{two.cpp => test2.cpp} | 0 .../P0607R0_inline_variables/custom_format.py | 2 +- 6 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 tests/std/tests/Dev09_172666_tr1_tuple_odr/__init__.py create mode 100644 tests/std/tests/Dev09_172666_tr1_tuple_odr/custom_format.py create mode 100644 tests/std/tests/Dev09_172666_tr1_tuple_odr/lit.local.cfg rename tests/std/tests/Dev09_172666_tr1_tuple_odr/{one.cpp => test.cpp} (70%) rename tests/std/tests/Dev09_172666_tr1_tuple_odr/{two.cpp => test2.cpp} (100%) diff --git a/tests/std/tests/Dev09_172666_tr1_tuple_odr/__init__.py b/tests/std/tests/Dev09_172666_tr1_tuple_odr/__init__.py new file mode 100644 index 00000000000..2ac2a854cb0 --- /dev/null +++ b/tests/std/tests/Dev09_172666_tr1_tuple_odr/__init__.py @@ -0,0 +1,2 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception diff --git a/tests/std/tests/Dev09_172666_tr1_tuple_odr/custom_format.py b/tests/std/tests/Dev09_172666_tr1_tuple_odr/custom_format.py new file mode 100644 index 00000000000..323790ec7cb --- /dev/null +++ b/tests/std/tests/Dev09_172666_tr1_tuple_odr/custom_format.py @@ -0,0 +1,23 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +from pathlib import Path + +from stl.test.format import STLTestFormat, TestStep + + +class CustomTestFormat(STLTestFormat): + def getBuildSteps(self, test, lit_config, shared): + shared.exec_dir = test.getExecDir() + exe_source = Path(test.getSourcePath()) + test2_source = exe_source.parent / 'test2.cpp' + output_base = test.getOutputBaseName() + output_dir = test.getOutputDir() + + cmd, out_files, shared.exec_file = \ + test.cxx.executeBasedOnFlagsCmd([exe_source, test2_source], + output_dir, shared.exec_dir, + output_base, [], [], []) + + yield TestStep(cmd, shared.exec_dir, [exe_source, test2_source], + test.cxx.compile_env) diff --git a/tests/std/tests/Dev09_172666_tr1_tuple_odr/lit.local.cfg b/tests/std/tests/Dev09_172666_tr1_tuple_odr/lit.local.cfg new file mode 100644 index 00000000000..4c325b48119 --- /dev/null +++ b/tests/std/tests/Dev09_172666_tr1_tuple_odr/lit.local.cfg @@ -0,0 +1,10 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import Dev09_172666_tr1_tuple_odr.custom_format + +config.test_format = \ + Dev09_172666_tr1_tuple_odr.custom_format.CustomTestFormat(config.test_format.cxx, + config.test_format.execute_external, + config.test_format.build_executor, + config.test_format.test_executor) diff --git a/tests/std/tests/Dev09_172666_tr1_tuple_odr/one.cpp b/tests/std/tests/Dev09_172666_tr1_tuple_odr/test.cpp similarity index 70% rename from tests/std/tests/Dev09_172666_tr1_tuple_odr/one.cpp rename to tests/std/tests/Dev09_172666_tr1_tuple_odr/test.cpp index 05cd4dc827d..5f18f8dedea 100644 --- a/tests/std/tests/Dev09_172666_tr1_tuple_odr/one.cpp +++ b/tests/std/tests/Dev09_172666_tr1_tuple_odr/test.cpp @@ -15,11 +15,12 @@ inline bool test_wchar_t_minus() { // LNK2031: calling convention missing in metadata errors, which are irrelevant here. #if defined(_M_CEE_PURE) && !defined(_NATIVE_WCHAR_T_DEFINED) return true; -#else - return fs::file_size(fs::current_path() / "two.cpp") != 0u; -#endif +#else // ^^^ /clr:pure /Zc:wchar_t- / Other vvv + return fs::file_size(fs::current_path() / "Dev09_172666_tr1_tuple_odr.exe") != 0u; +#endif // defined(_M_CEE_PURE) && !defined(_NATIVE_WCHAR_T_DEFINED) } int main() { - assert(meow() == 1729 && test_wchar_t_minus()); + assert(meow() == 1729); + assert(test_wchar_t_minus()); } diff --git a/tests/std/tests/Dev09_172666_tr1_tuple_odr/two.cpp b/tests/std/tests/Dev09_172666_tr1_tuple_odr/test2.cpp similarity index 100% rename from tests/std/tests/Dev09_172666_tr1_tuple_odr/two.cpp rename to tests/std/tests/Dev09_172666_tr1_tuple_odr/test2.cpp diff --git a/tests/std/tests/P0607R0_inline_variables/custom_format.py b/tests/std/tests/P0607R0_inline_variables/custom_format.py index 323790ec7cb..9455e2bc65c 100644 --- a/tests/std/tests/P0607R0_inline_variables/custom_format.py +++ b/tests/std/tests/P0607R0_inline_variables/custom_format.py @@ -10,7 +10,7 @@ class CustomTestFormat(STLTestFormat): def getBuildSteps(self, test, lit_config, shared): shared.exec_dir = test.getExecDir() exe_source = Path(test.getSourcePath()) - test2_source = exe_source.parent / 'test2.cpp' + test2_source = exe_source.parent / 'two.cpp' output_base = test.getOutputBaseName() output_dir = test.getOutputDir() From 7fa3c735c584396d357c263e3124409b7422192b Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 29 Jul 2020 17:47:07 -0700 Subject: [PATCH 2/3] Revert accidental change to P0607R0_inline_variables; also enable VSO_0000000_matching_npos_address --- .../P0607R0_inline_variables/custom_format.py | 2 +- .../__init__.py | 2 ++ .../custom_format.py | 23 +++++++++++++++++++ .../lit.local.cfg | 10 ++++++++ .../{main.cpp => test.cpp} | 0 .../{a.cpp => test2.cpp} | 0 6 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/std/tests/VSO_0000000_matching_npos_address/__init__.py create mode 100644 tests/std/tests/VSO_0000000_matching_npos_address/custom_format.py create mode 100644 tests/std/tests/VSO_0000000_matching_npos_address/lit.local.cfg rename tests/std/tests/VSO_0000000_matching_npos_address/{main.cpp => test.cpp} (100%) rename tests/std/tests/VSO_0000000_matching_npos_address/{a.cpp => test2.cpp} (100%) diff --git a/tests/std/tests/P0607R0_inline_variables/custom_format.py b/tests/std/tests/P0607R0_inline_variables/custom_format.py index 9455e2bc65c..323790ec7cb 100644 --- a/tests/std/tests/P0607R0_inline_variables/custom_format.py +++ b/tests/std/tests/P0607R0_inline_variables/custom_format.py @@ -10,7 +10,7 @@ class CustomTestFormat(STLTestFormat): def getBuildSteps(self, test, lit_config, shared): shared.exec_dir = test.getExecDir() exe_source = Path(test.getSourcePath()) - test2_source = exe_source.parent / 'two.cpp' + test2_source = exe_source.parent / 'test2.cpp' output_base = test.getOutputBaseName() output_dir = test.getOutputDir() diff --git a/tests/std/tests/VSO_0000000_matching_npos_address/__init__.py b/tests/std/tests/VSO_0000000_matching_npos_address/__init__.py new file mode 100644 index 00000000000..2ac2a854cb0 --- /dev/null +++ b/tests/std/tests/VSO_0000000_matching_npos_address/__init__.py @@ -0,0 +1,2 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception diff --git a/tests/std/tests/VSO_0000000_matching_npos_address/custom_format.py b/tests/std/tests/VSO_0000000_matching_npos_address/custom_format.py new file mode 100644 index 00000000000..323790ec7cb --- /dev/null +++ b/tests/std/tests/VSO_0000000_matching_npos_address/custom_format.py @@ -0,0 +1,23 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +from pathlib import Path + +from stl.test.format import STLTestFormat, TestStep + + +class CustomTestFormat(STLTestFormat): + def getBuildSteps(self, test, lit_config, shared): + shared.exec_dir = test.getExecDir() + exe_source = Path(test.getSourcePath()) + test2_source = exe_source.parent / 'test2.cpp' + output_base = test.getOutputBaseName() + output_dir = test.getOutputDir() + + cmd, out_files, shared.exec_file = \ + test.cxx.executeBasedOnFlagsCmd([exe_source, test2_source], + output_dir, shared.exec_dir, + output_base, [], [], []) + + yield TestStep(cmd, shared.exec_dir, [exe_source, test2_source], + test.cxx.compile_env) diff --git a/tests/std/tests/VSO_0000000_matching_npos_address/lit.local.cfg b/tests/std/tests/VSO_0000000_matching_npos_address/lit.local.cfg new file mode 100644 index 00000000000..4c325b48119 --- /dev/null +++ b/tests/std/tests/VSO_0000000_matching_npos_address/lit.local.cfg @@ -0,0 +1,10 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import Dev09_172666_tr1_tuple_odr.custom_format + +config.test_format = \ + Dev09_172666_tr1_tuple_odr.custom_format.CustomTestFormat(config.test_format.cxx, + config.test_format.execute_external, + config.test_format.build_executor, + config.test_format.test_executor) diff --git a/tests/std/tests/VSO_0000000_matching_npos_address/main.cpp b/tests/std/tests/VSO_0000000_matching_npos_address/test.cpp similarity index 100% rename from tests/std/tests/VSO_0000000_matching_npos_address/main.cpp rename to tests/std/tests/VSO_0000000_matching_npos_address/test.cpp diff --git a/tests/std/tests/VSO_0000000_matching_npos_address/a.cpp b/tests/std/tests/VSO_0000000_matching_npos_address/test2.cpp similarity index 100% rename from tests/std/tests/VSO_0000000_matching_npos_address/a.cpp rename to tests/std/tests/VSO_0000000_matching_npos_address/test2.cpp From 740a3f0a3c8579757a9814499f6bfb8c3433efaa Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 29 Jul 2020 17:59:35 -0700 Subject: [PATCH 3/3] *sigh* --- .../VSO_0000000_matching_npos_address/lit.local.cfg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/std/tests/VSO_0000000_matching_npos_address/lit.local.cfg b/tests/std/tests/VSO_0000000_matching_npos_address/lit.local.cfg index 4c325b48119..994f1aefbc5 100644 --- a/tests/std/tests/VSO_0000000_matching_npos_address/lit.local.cfg +++ b/tests/std/tests/VSO_0000000_matching_npos_address/lit.local.cfg @@ -1,10 +1,10 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -import Dev09_172666_tr1_tuple_odr.custom_format +import VSO_0000000_matching_npos_address.custom_format config.test_format = \ - Dev09_172666_tr1_tuple_odr.custom_format.CustomTestFormat(config.test_format.cxx, - config.test_format.execute_external, - config.test_format.build_executor, - config.test_format.test_executor) + VSO_0000000_matching_npos_address.custom_format.CustomTestFormat(config.test_format.cxx, + config.test_format.execute_external, + config.test_format.build_executor, + config.test_format.test_executor)