diff --git a/compiler/test/compilable/extra-files/objdump-postscript.sh b/compiler/test/compilable/extra-files/objdump-postscript.sh index e2daeecf22..1743ace1ea 100644 --- a/compiler/test/compilable/extra-files/objdump-postscript.sh +++ b/compiler/test/compilable/extra-files/objdump-postscript.sh @@ -3,7 +3,9 @@ source tools/common_funcs.sh expect_file=${EXTRA_FILES}/${TEST_NAME}.out -obj_file=${OUTPUT_BASE}_0.o +# We are only used by cdcmp, which is a D test, +# otherwise we could use ${OUTPUT_BASE} and then figure out language. +obj_file=${RESULTS_TEST_DIR}/d/${TEST_NAME}_0.o echo Creating objdump objdump --disassemble --disassembler-options=intel "${obj_file}" > "${obj_file}.dump" @@ -14,4 +16,4 @@ echo SANITIZING Objdump... diff -up --strip-trailing-cr "${expect_file}" "${obj_file}.dump.sanitized" -rm_retry "${OUTPUT_BASE}.o"{,.dump,.dump,.sanitized} +rm_retry ${obj_file}{,.dump,.dump,.sanitized} diff --git a/compiler/test/compilable/c_ident_c99.c b/compiler/test/compilable/ident_c99.c similarity index 100% rename from compiler/test/compilable/c_ident_c99.c rename to compiler/test/compilable/ident_c99.c diff --git a/compiler/test/tools/d_do_test.d b/compiler/test/tools/d_do_test.d index 551e0ed72f..c30cb02327 100755 --- a/compiler/test/tools/d_do_test.d +++ b/compiler/test/tools/d_do_test.d @@ -1598,10 +1598,22 @@ int tryMain(string[] args) const input_dir = input_file.dirName(); const test_base_name = input_file.baseName(); const test_name = test_base_name.stripExtension(); + const test_ext = test_base_name.extension(); - const result_path = envData.results_dir ~ envData.sep; - const output_dir = result_path ~ input_dir; - const output_file = result_path ~ input_file ~ ".out"; + // Previously we did not take into account the test file extension, + // because of ImportC we now have the ability to have conflicting source file basenames (when ignoring extension). + // This can cause a race condition with the concurrent test runner, + // in which whilst one test is running another will try to clobber it and fail. + // Unfortunately dshell does not take into account our output directory, + // at least not in a way that'll allow us to take advantage of the test extension. + // However since its not really an issue for clobbering, we'll ignore it. + const result_path = envData.results_dir ~ envData.sep; + const output_dir_base = result_path ~ input_dir; + const output_dir = (input_dir == "dshell" ? output_dir_base : (output_dir_base ~ envData.sep ~ test_ext[1 .. $])); + const output_file = result_path ~ input_file ~ ".out"; + + // We are potentially creating a test extension specific directory + mkdirRecurse(output_dir); TestArgs testArgs; switch (input_dir) @@ -1622,7 +1634,7 @@ int tryMain(string[] args) return 1; } - if (test_base_name.extension() == ".sh") + if (test_ext == ".sh") { string file = cast(string) std.file.read(input_file); string disabledPlatforms;