Skip to content

Commit

Permalink
build: fix build on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
JaDogg committed Nov 1, 2023
1 parent 50e9fb9 commit 5b5f323
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
25 changes: 22 additions & 3 deletions compiler/scripts/e2e_snapshot_windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"test_data/compiler_tests/all_integers.yaka": "\n\nreturn := 0",
"test_data/compiler_tests/array_test.yaka": "Printing [a]\n1\n2\n3\n4\n5\n6\n7\nPrinting [b]\nHello\nWorld\nHaha\n\nreturn := 0",
"test_data/compiler_tests/arrstack.yaka": "3\n2\n1\n\nreturn := 0",
"test_data/compiler_tests/auto_casting/autocast.yaka": "\"a\" = 1\n\"b\" = 2\n\"c\" = 3\n\"d\" = 6\n\"e\" = 7\n\"f\" = 2\n\"g\" = 6.000000\n\"h\" = 7.000000\n\"i\" = 6.000000\n\"j\" = 1.000000\n\"k\" = 5.000000\n\"l\" = 1\n\"A\" = 10\n\"B\" = 10\n\"C\" = 0\n\nreturn := 0",
"test_data/compiler_tests/binarydata_builtin_test.yaka": "ok\n\nreturn := 0",
"test_data/compiler_tests/casting_test.yaka": "\n\nreturn := 0",
"test_data/compiler_tests/class_stuff.yaka": "1\n\nreturn := 0",
Expand All @@ -15,6 +16,7 @@
"test_data/compiler_tests/eachelem_for.yaka": "1 - 4\n1 - 5\n1 - 6\n1 - 7\n2 - 4\n2 - 5\n2 - 6\n2 - 7\n3 - 4\n3 - 5\n3 - 6\n3 - 7\n\nreturn := 0",
"test_data/compiler_tests/elif_testing.yaka": "\n\nreturn := 0",
"test_data/compiler_tests/endless_for.yaka": "1\n1\n\nreturn := 0",
"test_data/compiler_tests/for_loop_test.yaka": "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\nhello hello hello hello\nxxx\n0\n2\n4\n6\n8\n\nreturn := 0",
"test_data/compiler_tests/function_datatype_passing_calling_test.yaka": "Hello World\n\nreturn := 0",
"test_data/compiler_tests/function_datatype_test.yaka": "Hello World\n\nreturn := 0",
"test_data/compiler_tests/functional_test_countif.yaka": ">> countif str test <<\ncount len 3 ==> 3\ncount len 5 ==> 2\n>> countif int test <<\ncount up to 5 ==> 5\ncompleted.\n\nreturn := 0",
Expand All @@ -29,7 +31,7 @@
"test_data/compiler_tests/loops_and_logic.yaka": "2\nHello\n4\n3\nHello\n7\n4\nHello\n10\n5\nHello\n13\n6\nHello\n16\n7\nHello\n19\n8\nHello\n22\n9\nHello\n25\n11\nHello\n29\n12\nHello\n32\n13\nHello\n35\n14\nHello\n38\n15\nHello\n41\n16\nHello\n44\n17\nHello\n47\n18\nHello\n50\n19\nHello\n53\n21\nHello\n\nreturn := 0",
"test_data/compiler_tests/native_constants.yaka": "3\n\nreturn := 0",
"test_data/compiler_tests/native_func_sort.yaka": "before x1:\nlen=8\n1 2 3 3 2 1 5 4\nafter x1:\nlen=8\n1 1 2 2 3 3 4 5\nbefore x2:\nlen=8\n1 2 3 3 2 1 5 4\nafter x2:\nlen=8\n5 4 3 3 2 2 1 1\nbefore x3:\nlen=8\n1 2 3 3 2 1 5 4\nafter x3:\nlen=8\n1 1 2 2 3 3 4 5\nbefore x4:\nlen=8\n1 2 3 3 2 1 5 4\nafter x4:\nlen=8\n1 1 2 2 3 3 4 5\n\nreturn := 0",
"test_data/compiler_tests/native_function_type_tests.yaka": "error: FileNotFound\n\nreturn := 4294967295",
"test_data/compiler_tests/native_function_type_tests.yaka": "hello world\n\nreturn := 0",
"test_data/compiler_tests/nativefunc.yaka": "----->>> this is my code <<<<------\ntest.c is empty or not foundruntime_features := none!\n\nreturn := 0",
"test_data/compiler_tests/none_comparison.yaka": "True\nFalse\nFalse\nFalse\n\nreturn := 0",
"test_data/compiler_tests/normal_hash_map.yaka": "1 = 42\nlength of this map is = 2\n1 is located at = 0\n30 is located at = -1\nbye!\n\nreturn := 0",
Expand All @@ -38,6 +40,22 @@
"test_data/compiler_tests/sort_test.yaka": "before:\nlen=14\n5 3 1 4 4 4 4 2 50 30 10 40 -1 20\nafter:\nlen=14\n50 40 30 20 10 5 4 4 4 4 3 2 1 -1\n\nreturn := 0",
"test_data/compiler_tests/str_getref_unref.yaka": "hello world\nhello world\nhello world\nhello world\nhello world\nhello world\nhello world\nhello world\nhello world\nhello world\nhello world\nhello world\nhello world\nhello world\nhello world\nTrue\n world\n\nreturn := 0",
"test_data/compiler_tests/string_hash.yaka": "hello = 42\nlength of this map is = 2\n\"hello\" is located at = 0\n\"unknown\" is located at = -1\nhello in m2 = 42.000000\nhello in m3 = 123.000000\nbye!\n\nreturn := 0",
"test_data/compiler_tests/string_tests/compare_mixed.yaka": "True\nTrue\nTrue\nTrue\nTrue\nTrue\n\nreturn := 0",
"test_data/compiler_tests/string_tests/compare_with_none.yaka": "False\nFalse\nTrue\nFalse\nTrue\nTrue\nFalse\nTrue\n\nreturn := 0",
"test_data/compiler_tests/string_tests/concat_lit.yaka": "Printing sr: Oi Hello there Another\nPrinting str: Oi Hello there Another\n\nreturn := 0",
"test_data/compiler_tests/string_tests/concat_mixed.yaka": "Printing sr: Hello World Hehe\nPrinting str: Hello World Hehe\nPrinting str: Ha World Hello\nPrinting sr: Ha World Hello\n\nreturn := 0",
"test_data/compiler_tests/string_tests/concat_sr.yaka": "Printing sr: Hi thereHi\nPrinting str: Hi there\nPrinting str: Hi there Hello\n\nreturn := 0",
"test_data/compiler_tests/string_tests/concat_str.yaka": "Printing str: Oi Hello\n\nreturn := 0",
"test_data/compiler_tests/string_tests/literal_comparison.yaka": "True\nFalse\nFalse\nTrue\n\nreturn := 0",
"test_data/compiler_tests/string_tests/pass_lit_sr_to_str.yaka": "Printing sr: Oi\nPrinting str: ha\nPrinting str: Oi oi\n\nreturn := 0",
"test_data/compiler_tests/string_tests/pass_literal_to_sr.yaka": "Printing sr: Oi\n\nreturn := 0",
"test_data/compiler_tests/string_tests/returning_strings.yaka": "Hello\nHello\nOi\n\nreturn := 0",
"test_data/compiler_tests/string_tests/sr_functional_test_countif.yaka": ">> countif sr test <<\ncount len 3 ==> 3\ncount len 5 ==> 2\n>> countif int test <<\ncount up to 5 ==> 5\ncompleted.\n\nreturn := 0",
"test_data/compiler_tests/string_tests/sr_functional_test_filter.yaka": ">> filter sr test <<\nBefore =>>\nHello\nWorld\nHow\nAre\nYou\nFiltered =>>\nHow\nAre\nYou\nKeep All =>>\nHello\nWorld\nHow\nAre\nYou\n>> filter int test <<\nKeep Upto 5 =>>\n1\n2\n3\n4\n5\nKeep Upto 7 =>>\n1\n2\n3\n4\n5\n6\n7\nKeep div 2 (even) =>>\n2\n4\n6\n8\n10\n>> completed.\n\nreturn := 0",
"test_data/compiler_tests/string_tests/sr_functional_test_foreach.yaka": ">> foreach sr test <<\n10 : Hello\n10 : World\n10 : How\n10 : Are\n10 : You\n20 : Hello\n20 : World\n20 : How\n20 : Are\n20 : You\n>> foreach int test <<\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n1\n2\n3\n4\n5\ncompleted.\n\nreturn := 0",
"test_data/compiler_tests/string_tests/sr_functional_test_map.yaka": ">> map sr test <<\nmap to_lengths ==>\n5\n5\n3\n3\n3\n>> countif int test <<\nmap to_pow2 ==>\n1\n4\n9\n16\n25\n36\n49\n64\n81\n100\ncompleted.\ntrue\n\nreturn := 0",
"test_data/compiler_tests/string_tests/str_to_sr_create_str_lit.yaka": "Printing sr: Oi\nPrinting sr: Ha\n\nreturn := 0",
"test_data/compiler_tests/string_tests/variables_using_sr.yaka": "Printing sr: Oi\nPrinting str: Oi oi\n\nreturn := 0",
"test_data/compiler_tests/test1.yaka": "Hello World\n\nreturn := 0",
"test_data/compiler_tests/test2.yaka": "3628800\n362880\n40320\n5040\n720\n120\n24\n6\n2\n1\naaaaaaaaaab\n2 From defer --> Program Completed\n1 From defer --> Program Completed\n\nreturn := 0",
"test_data/compiler_tests/test3.yaka": "10\n9\n8\n7\n6\n5\n4\n3\n2\n1\n\nreturn := 0",
Expand All @@ -47,7 +65,7 @@
"test_data/compiler_tests/test7.yaka": "1\n100\n\nreturn := 0",
"test_data/compiler_tests/tuple_test.yaka": "2\n3\n100\nHello\n\nreturn := 0",
"test_data/compiler_tests/voidfunc.yaka": "\n\nreturn := 0",
"test_data/data_type_test.yaka": "Failed to compile data type:\n\nreturn := 4294967295",
"test_data/data_type_test.yaka": "data_type_test.yaka:3:5 at \"b\" --> cannot find class HashMap in data_type_test.yaka\n\nreturn := 4294967295",
"test_data/document_samples/factorial.yaka": "factorial(0) = 1\nfactorial(1) = 1\nfactorial(2) = 2\nfactorial(3) = 6\nfactorial(4) = 24\nfactorial(5) = 120\nfactorial(6) = 720\nfactorial(7) = 5040\nfactorial(8) = 40320\nfactorial(9) = 362880\n\nreturn := 0",
"test_data/import_tests/city/house.yaka": "Critical !! main() function must be present\n\nreturn := 4294967295",
"test_data/import_tests/jungle.yaka": "Critical !! main() function must be present\n\nreturn := 4294967295",
Expand All @@ -68,5 +86,6 @@
"test_data/sample_hello_threads.yaka": "File not found or unable to read:cpu.yaka\n\nFailed to initialize parsing:sample_hello_threads.yaka\n\nreturn := 4294967295",
"test_data/sample_negative_numbers.yaka": "Invalid statement detected. Only def, class, import, runtimefeature or constant statements are supported at module level.\n\nCritical !! main() function must be present\n\nreturn := 4294967295",
"test_data/simple_programs/defer_test.yaka": "1\n2\n3\n4\n\nreturn := 0",
"test_data/test_compiler.yaka": "3628800\n362880\n40320\n5040\n720\n120\n24\n6\n2\n1\naaaaaaaaaab\n2 From defer --> Program Completed\n1 From defer --> Program Completed\n\nreturn := 0"
"test_data/test_compiler.yaka": "3628800\n362880\n40320\n5040\n720\n120\n24\n6\n2\n1\naaaaaaaaaab\n2 From defer --> Program Completed\n1 From defer --> Program Completed\n\nreturn := 0",
"test_libs/tests.yaka": "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\u2566 \u2566\u2554\u2550\u2557\u2566\u2554\u2550\u250c\u2500\u2510\u252c \u252c\u2554\u2550\u2557\n\u255a\u2566\u255d\u2560\u2550\u2563\u2560\u2569\u2557\u2514\u2500\u2510\u251c\u2500\u2524\u2560\u2550\u2563\n \u2569 \u2569 \u2569\u2569 \u2569\u2514\u2500\u2518\u2534 \u2534\u2569 \u2569\n \u2554\u2566\u2557\u2554\u2550\u2557\u2554\u2550\u2557\u2554\u2566\u2557\u2554\u2550\u2557\n \u2551 \u2551\u2563 \u255a\u2550\u2557 \u2551 \u255a\u2550\u2557\n \u2569 \u255a\u2550\u255d\u255a\u2550\u255d \u2569 \u255a\u2550\u255d\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nTEST - assumptions\n success <- char is 1 byte\n success <- int is 4 byte\nTEST - libs.strings.contains\n success <- strings.contains(\"\", \"\")\n success <- strings.contains(\"a\", \"a\")\n success <- strings.contains(\"ab\", \"a\")\n success <- strings.contains(\"a\", \"ab\")\nTEST - libs.strings.startswith\n success <- strings.startswith(\"\", \"\")\n success <- strings.startswith(\"a\", \"a\")\n success <- strings.startswith(\"ab\", \"a\")\n\nreturn := 0"
}
2 changes: 1 addition & 1 deletion compiler/src/carpntr_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ std::string ws2s(const std::wstring &wide) {
[](wchar_t c) { return (char) c; });
return str;
}
int execute_process(std::filesystem::path carpntr_path, int argc,
int execute_process(const std::filesystem::path& carpntr_path, int argc,
char **arguments) {
std::string argument{};
ArgvQuote(ws2s(carpntr_path.wstring()), argument, false);
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/compiler/multifile_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ multifile_compiler::compile(const std::string &main_file) {
LOG_COMP("compile:" << main_file);
auto libs_path = std::filesystem::path{get_my_exe_path()}.parent_path();
libs_path = libs_path.parent_path() / "libs";
return compile(main_file, libs_path);
return compile(main_file, libs_path.string());
}
//
multifile_compiler_result
Expand Down

0 comments on commit 5b5f323

Please sign in to comment.