Skip to content

Instantly share code, notes, and snippets.

View TorstenRobitzki's full-sized avatar

Torsten Robitzki TorstenRobitzki

View GitHub Profile
@TorstenRobitzki
TorstenRobitzki / run_tests.js
Created November 20, 2012 13:02
js file to run jasmine tests
var page = require('webpage').create();
page.viewportSize = { width: 480, height: 800 };
( function() {
var load = function( name ) {
if ( !page.injectJs( name ) ) throw ( "error loading " + name );
}
load( "/Users/todi/.rvm/gems/ruby-1.9.3-p327/gems/jasmine-core-1.2.0/lib/jasmine-core/jasmine.js" );
load( "/Users/todi/pland/lib/jasmine/console-runner.js" );
@TorstenRobitzki
TorstenRobitzki / gist:4125852
Created November 21, 2012 16:29
a minimum yasmine example
page = require('webpage').create();
page.viewportSize = { width: 1000, height: 700 };
phantom.viewportSize = { width: 1000, height: 700 };
page.open( "http://robitzki.de", function(status) {
try {
if ( status == "success" && page.injectJs( "jquery.min.js" ) )
{
result = page.evaluate( function() {
$('body').append('<div class="test_canvas"></div>')
@TorstenRobitzki
TorstenRobitzki / jasmine_phantom.rake
Created November 24, 2012 12:36
test:scripts rake task to unit-test scripts with jasmine in a rails application
module JasminPhantomHelper
def self.manifest_file_name
@cached_name ||= if Pland::Application.config.assets.manifest
path = File.join(cPland::Application.onfig.assets.manifest, "manifest.yml")
else
path = File.join(Rails.public_path, Pland::Application.config.assets.prefix, "manifest.yml")
end
@cached_name
end
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <string>
BOOST_AUTO_TEST_CASE( test_concatenation_of_strings )
{
BOOST_CHECK_EQUAL( std::string( "abc" ) + std::string( "def" ), "abcdef" );
}
set(ANT_LIB_SOURCE "${EXTERNAL_LIBRARIES_SOURCE_DIR}/ANT_Library_MacOSX_Package/ANT_LIB/")
set(DISABLES_WARNINGS "-Wno-comment -Wno-unused-function -Wno-unused-const-variable -Wno-reorder -Wno-null-conversion")
set(DISABLES_WARNINGS "${DISABLES_WARNINGS} -Wno-implicit-function-declaration -Wno-int-to-void-pointer-cast -Wno-sometimes-uninitialized")
set(DISABLES_WARNINGS "${DISABLES_WARNINGS} -Wno-unused-private-field -Wno-non-literal-null-conversion -Wno-unsequenced -Wno-tautological-constant-out-of-range-compare")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DISABLES_WARNINGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DISABLES_WARNINGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework IOKit -framework CoreFoundation")
#include <nrf.h>
#include <cstdint>
#include <type_traits>
#include <utility>
#include "bootloader/services.hpp"
/* we need a large constant data section to simulate a real firmware size-wise */
/* The data should be random enough that it can not be compressed to easy and
care should be taken, that it doesn't get optimized away */