Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
+intrude import app::app_base # For test_bound_platform
import aware
redef fun bound_platform do return "Android"
import aware
redef fun bound_platform do return "Android"
+
+redef fun test_bound_platform do end
# However, this value can be used in log files and communications with servers.
fun bound_platform: String do return "none"
# However, this value can be used in log files and communications with servers.
fun bound_platform: String do return "none"
+# Test if the application was bound to a platform, if not crash
+private fun test_bound_platform
+do
+ print_error "Apps must be bound to a platform at compilation using `-m linux` or `-m android`"
+ exit 1
+end
+
+if "NIT_TESTING".environ == "true" then exit 0
+
+test_bound_platform
+
# right after this method returns. They should not be preserved.
fun accept_event(event: InputEvent): Bool do return false
end
# right after this method returns. They should not be preserved.
fun accept_event(event: InputEvent): Bool do return false
end
-
-redef class Sys
- redef fun run
- do
- if "NIT_TESTING".environ == "true" then exit 0
- super
- end
-end
+intrude import app::app_base # For test_bound_platform
redef class App
# Path to the expected location of the asset folder of this program
redef class App
# Path to the expected location of the asset folder of this program
end
redef fun bound_platform do return "GNU/Linux"
end
redef fun bound_platform do return "GNU/Linux"
+
+redef fun test_bound_platform do end