diff --git a/es2panda/aot/main.cpp b/es2panda/aot/main.cpp index 9c57e484d73405ec031aa9dd2eaea7efc3ddccef..ecb6860511592287dc95f7c440c779c4b0558519 100644 --- a/es2panda/aot/main.cpp +++ b/es2panda/aot/main.cpp @@ -122,6 +122,8 @@ static void DumpProgramInfos(const std::map &programsInfo, const std::unique_ptr &options) { + DumpProgramInfos(programsInfo, options); + if (programsInfo.size() == 1) { auto *prog = &(programsInfo.begin()->second->program); if (options->OutputFiles().empty() && options->CompilerOutput().empty()) { @@ -147,8 +149,6 @@ static bool GenerateProgram(const std::mapsource = buffer; - } - if (!src_->fileName.empty()) { auto cacheFileIter = options_->cacheFiles.find(src_->fileName); if (cacheFileIter != options_->cacheFiles.end()) { src_->hash = GetHash32String(reinterpret_cast(buffer.c_str())); diff --git a/es2panda/test/base64/inputFile/expected.txt b/es2panda/test/base64/inputFile/expected.txt index dac0202f241537c35a6b949376b473a3d4164169..486c8cb8c615771b786e1364bec9fcf8cc56197e 100644 --- a/es2panda/test/base64/inputFile/expected.txt +++ b/es2panda/test/base64/inputFile/expected.txt @@ -11,4 +11,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -UEFOREEAAAAAAAAACQAAAPwBAACMAAAAFQAAAAQAAAA8AAAAAQAAAPgBAAAAAAAATAAAAAEAAABMAAAAuwAAAIwAAADhAAAADQEAAIwAAAD8AQAAAgAAAHQAAAADAAAAfAAAAAAAAACIAAAAAQAAAIgAAAC7AAAADQEAAKEAAACvAAAAtgAAAD4BAAAnTF9FU1R5cGVBbm5vdGF0aW9uOwAZaGVsbG8gd29ybGQhAAtwcmludAAHc3RyADNMX0VTU2xvdE51bWJlckFubm90YXRpb247AAAAAACAQAAAAgAAJ0xfRVNUeXBlSW5mb1JlY29yZDsAAAAAAAEAAAIAABdmdW5jX21haW5fMAATTF9HTE9CQUw7AAAAAAABAAECAAABAAAAAAEAAIgCAb8BAAACAAXrAQAABrIBAAAA7u4AAMMBL21udC9jaGVucWl1eWFvL2NvZGUvb3Blbmhhcm1vbnkvYXJrY29tcGlsZXIvZXRzX2Zyb250ZW5kL2VzMnBhbmRhL3Rlc3QvYmFzZTY0L2lucHV0RmlsZS9pbnB1dC5qcwAVU2xvdE51bWJlcgAAAAEApgEAAAUAAAA3BwMhAERwRIFEkj4AAEgAAAIAPwEBAGEFPwICAGEGYAUqAwYAZQkLAQIQiQD/////DwAFwgIABhAA5AEAAA== +UEFOREEAAAAAAAAACQAAAKQBAACMAAAAFQAAAAQAAAA8AAAAAQAAAKABAAAAAAAATAAAAAEAAABMAAAAuwAAAIwAAADhAAAADQEAAIwAAACkAQAAAgAAAHQAAAADAAAAfAAAAAAAAACIAAAAAQAAAIgAAAC7AAAADQEAAKEAAACvAAAAtgAAAD4BAAAnTF9FU1R5cGVBbm5vdGF0aW9uOwAZaGVsbG8gd29ybGQhAAtwcmludAAHc3RyADNMX0VTU2xvdE51bWJlckFubm90YXRpb247AAAAAACAQAAAAgAAJ0xfRVNUeXBlSW5mb1JlY29yZDsAAAAAAAEAAAIAABdmdW5jX21haW5fMAATTF9HTE9CQUw7AAAAAAABAAECAAABAAAAAAEAAIgCAWUBAAACAAWRAQAABlgBAAAA7u4AABFpbnB1dC5qcwAVU2xvdE51bWJlcgAAAAEATAEAAAUAAAA3BwMhAERwRIFEkj4AAEgAAAIAPwEBAGEFPwICAGEGYAUqAwYAZQkLAQIQiQD/////DwAFwgIABhAAAACKAQAA diff --git a/es2panda/test/runner.py b/es2panda/test/runner.py index 33de0a2c4da6dd83c5b576173a1463a3a6e707ac..a74bdb40dbd945217dad0330a7dd84bdea3edf92 100755 --- a/es2panda/test/runner.py +++ b/es2panda/test/runner.py @@ -1094,7 +1094,9 @@ class Base64Test(Test): def run(self, runner): cmd = runner.cmd_prefix + [runner.es2panda, "--base64Output"] if self.input_type == "file": - cmd.extend([os.path.join(self.path, "input.js")]) + input_file_name = 'input.js' + cmd.extend(['--source-file', input_file_name]) + cmd.extend([os.path.join(self.path, input_file_name)]) elif self.input_type == "string": input_file = os.path.join(self.path, "input.txt") try: @@ -1145,6 +1147,9 @@ class Base64Runner(Runner): self.tests.append(Base64Test(os.path.join(self.test_directory, "inputFile"), "file")) self.tests.append(Base64Test(os.path.join(self.test_directory, "inputString"), "string")) + def test_path(self, src): + return os.path.basename(src) + def main(): args = get_args()